Java 类org.eclipse.draw2d.Animation 实例源码

项目:OpenSPIFe    文件:Timeline.java   
@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;
    }
}
项目:gef-gwt    文件:DrawerFigure.java   
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();
            }
        }
    });
}
项目:bdf2    文件:SchemaEditPart.java   
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);
}
项目:gef-gwt    文件:PinnablePaletteStackFigure.java   
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);
                    }
                }
            }
        }
    }
}
项目:d-case_editor    文件:ArrangeAllCommand.java   
@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();
}