Beispiel #1
0
 protected <T extends Object> void doRevealElement(
     final T element, final EntryCall<? super T> entryCall, final IEditorPart editor) {
   XDiagram _diagram = this.root.getDiagram();
   final InterpreterContext interpreterContext = new InterpreterContext(_diagram);
   entryCall.execute(element, this.configInterpreter, interpreterContext);
   CommandStack _commandStack = this.root.getCommandStack();
   interpreterContext.executeCommands(_commandStack);
   final IMappedElementDescriptor<T> descriptor = this.<T, Object>createMappedDescriptor(element);
   XDiagram _diagram_1 = interpreterContext.getDiagram();
   ObservableList<XNode> _nodes = _diagram_1.getNodes();
   XDiagram _diagram_2 = interpreterContext.getDiagram();
   ObservableList<XConnection> _connections = _diagram_2.getConnections();
   Iterable<XDomainObjectShape> _plus = Iterables.<XDomainObjectShape>concat(_nodes, _connections);
   final Function1<XDomainObjectShape, Boolean> _function =
       (XDomainObjectShape it) -> {
         DomainObjectDescriptor _domainObjectDescriptor = it.getDomainObjectDescriptor();
         return Boolean.valueOf(Objects.equal(_domainObjectDescriptor, descriptor));
       };
   final XDomainObjectShape centerShape =
       IterableExtensions.<XDomainObjectShape>findFirst(_plus, _function);
   CommandStack _commandStack_1 = this.root.getCommandStack();
   ParallelAnimationCommand _parallelAnimationCommand = new ParallelAnimationCommand();
   final Procedure1<ParallelAnimationCommand> _function_1 =
       (ParallelAnimationCommand it) -> {
         boolean _needsLayoutCommand = interpreterContext.needsLayoutCommand();
         if (_needsLayoutCommand) {
           Layouter _layouter = new Layouter();
           XDiagram _diagram_3 = interpreterContext.getDiagram();
           Duration _millis = DurationExtensions.millis(500);
           LazyCommand _createLayoutCommand =
               _layouter.createLayoutCommand(LayoutType.DOT, _diagram_3, _millis, centerShape);
           it.operator_add(_createLayoutCommand);
         }
         final Function1<XShape, Boolean> _function_2 =
             (XShape it_1) -> {
               return Boolean.valueOf(Objects.equal(it_1, centerShape));
             };
         SelectAndRevealCommand _selectAndRevealCommand =
             new SelectAndRevealCommand(this.root, _function_2);
         it.operator_add(_selectAndRevealCommand);
       };
   ParallelAnimationCommand _doubleArrow =
       ObjectExtensions.<ParallelAnimationCommand>operator_doubleArrow(
           _parallelAnimationCommand, _function_1);
   _commandStack_1.execute(_doubleArrow);
 }
Beispiel #2
0
 protected void refreshUpdateState() {
   XDiagram _diagram = this.root.getDiagram();
   final ReconcileBehavior behavior =
       _diagram.<ReconcileBehavior>getBehavior(ReconcileBehavior.class);
   boolean _notEquals = (!Objects.equal(behavior, null));
   if (_notEquals) {
     this.refreshDirtyState(behavior);
   }
   final ArrayList<XShape> allShapes = CollectionLiterals.<XShape>newArrayList();
   XDiagram _diagram_1 = this.root.getDiagram();
   ObservableList<XNode> _nodes = _diagram_1.getNodes();
   Iterables.<XShape>addAll(allShapes, _nodes);
   XDiagram _diagram_2 = this.root.getDiagram();
   ObservableList<XConnection> _connections = _diagram_2.getConnections();
   Iterables.<XShape>addAll(allShapes, _connections);
   final Consumer<XShape> _function =
       (XShape it) -> {
         ReconcileBehavior _behavior = it.<ReconcileBehavior>getBehavior(ReconcileBehavior.class);
         if (_behavior != null) {
           this.refreshDirtyState(_behavior);
         }
       };
   allShapes.forEach(_function);
 }