@Override public void historyNotification(OperationHistoryEvent event) { switch (event.getEventType()) { case OperationHistoryEvent.ABOUT_TO_EXECUTE: case OperationHistoryEvent.ABOUT_TO_REDO: case OperationHistoryEvent.ABOUT_TO_UNDO: if (WidgetUtils.inDisplayThread()) { Animation.markBegin(); } break; case OperationHistoryEvent.DONE: case OperationHistoryEvent.REDONE: case OperationHistoryEvent.UNDONE: if (WidgetUtils.inDisplayThread()) { Animation.run(150); } break; } }
public CollapseToggle(IFigure contents) { super(contents); setSelected(true); setRequestFocusEnabled(true); addChangeListener(new ChangeListener() { public void handleStateChanged(ChangeEvent e) { if (e.getPropertyName().equals( ButtonModel.SELECTED_PROPERTY)) { Animation.markBegin(); handleExpandStateChanged(); Animation.run(150); } else if (e.getPropertyName().equals( ButtonModel.MOUSEOVER_PROPERTY)) { repaint(); } } }); }
protected void refreshVisuals() { super.refreshVisuals(); ConnectionLayer connectionLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER); connectionLayer.setConnectionRouter(new ShortestPathConnectionRouter(figure)); if ((getViewer().getControl().getStyle() & SWT.MIRRORED) == 0) { connectionLayer.setAntialias(SWT.ON); } Animation.run(400); }
public void handleStateChanged(ChangeEvent event) { Clickable clickable = (Clickable) event.getSource(); if (event.getPropertyName() == ButtonModel.MOUSEOVER_PROPERTY && getActiveFigure() instanceof ToolEntryToggle) { ((ToolEntryToggle) getActiveFigure()) .setShowHoverFeedback(clickable.getModel() .isMouseOver()); } if (event.getPropertyName() == ButtonModel.SELECTED_PROPERTY) { Animation.markBegin(); handleExpandStateChanged(); Animation.run(150); // Now collapse other stacks when they are not pinned open or in // the // case of columns and icons layout mode (where only one stack // can // be expanded at a time for layout reasons). if (isExpanded()) { boolean collapseOtherStacks = (layoutMode == PaletteViewerPreferences.LAYOUT_COLUMNS || layoutMode == PaletteViewerPreferences.LAYOUT_ICONS); for (Iterator iterator = getParent().getChildren() .iterator(); iterator.hasNext();) { Object childFigure = iterator.next(); if (childFigure instanceof PinnablePaletteStackFigure && childFigure != PinnablePaletteStackFigure.this) { if (collapseOtherStacks || (((PinnablePaletteStackFigure) childFigure) .isExpanded() && !((PinnablePaletteStackFigure) childFigure) .isPinnedOpen())) { ((PinnablePaletteStackFigure) childFigure) .setExpanded(false); } } } } } }
@Override protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { if (this.argumentEditPart == null) { return CommandResult.newErrorCommandResult(""); } ArrangeRequest request = new ArrangeRequest( ActionIds.ACTION_ARRANGE_ALL, LAYOUT_TYPE); Command command = this.argumentEditPart.getCommand(request); Animation.markBegin(); command.execute(); Animation.run(CONST_ANIMATION_TIME); return CommandResult.newOKCommandResult(); }