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

项目:OpenSPIFe    文件:TreeTimelineDataEditPart.java   
/**
 * Upon activation, attach to the model element as a property change listener.
 */
@Override
public void activate() {
    if (!isActive()) {
        super.activate();
        TIMELINE_PREFERENCES.addPropertyChangeListener(this);
        TimelineViewer viewer = getViewer();
        viewer.addPropertyChangeListener(listener);
        if (viewer.isAnimated()) {
            figure.addLayoutListener(LayoutAnimator.getDefault());
        }
        ExpansionModel expansion = (ExpansionModel) getViewer().getProperty(ExpansionModel.ID);
        if (expansion != null) {
            expansion.addPropertyChangeListener(listener);
        }
        TreeTimelineContentProvider cp = getViewer().getTreeTimelineContentProvider();
        if (cp != null) {
            cp.addListener(listener);
        }
        refreshVisuals();
    }
}
项目:DarwinSPL    文件:DwFeatureModelEditPart.java   
@Override
protected IFigure createFigure() {
    ScalableFreeformLayeredPane layer = new ScalableFreeformLayeredPane();
    layer.setLayoutManager(new FreeformLayout());
    layer.setBorder(new LineBorder(1));
    layer.addLayoutListener(LayoutAnimator.getDefault());
    return layer;
}
项目:statecharts    文件:RegionCompartmentEditPart.java   
@Override
protected IFigure createFigure() {
    ShapeCompartmentFigure figure = new ShapeCompartmentFigure(getCompartmentName(), getMapMode());
    figure.getContentPane().setLayoutManager(getLayoutManager());
    figure.getContentPane().addLayoutListener(LayoutAnimator.getDefault());
    figure.setBorder(null);
    figure.setFitContents(true);
    figure.setToolTip((String) null);
    return figure;
}
项目:OpenSPIFe    文件:TreeTimelineDataEditPart.java   
/**
 * Upon deactivation, detach from the model element as a property change listener.
 */
@Override
public void deactivate() {
    if (isActive()) {
        TIMELINE_PREFERENCES.removePropertyChangeListener(this);
        TimelineViewer viewer = getViewer();
        viewer.removePropertyChangeListener(listener);
        if (viewer.isAnimated()) {
            figure.removeLayoutListener(LayoutAnimator.getDefault());
        }
        ExpansionModel expansion = (ExpansionModel) getViewer().getProperty(ExpansionModel.ID);
        if (expansion != null) {
            expansion.removePropertyChangeListener(listener);
        }
        if (alternatingColor != null) {
            //alternatingColor.dispose();
            alternatingColor = null;
        }
        if (alternatingBorderColor != null) {
            alternatingBorderColor = null;
        }
        if (horizontalLineColor != null) {
            horizontalLineColor = null;
        }
        TreeTimelineContentProvider cp = getViewer().getTreeTimelineContentProvider();
        if (cp != null) {
            cp.removeListener(listener);
        }
        super.deactivate();
    }
}
项目:OpenSPIFe    文件:TreeTimelineDataRowEditPart.java   
@Override
public void activate() {
    if (getViewer().isAnimated()) {
        getFigure().addLayoutListener(LayoutAnimator.getDefault());
    }
    getFigure().addLayoutListener(new LayoutListener.Stub() {
        @Override public void postLayout(IFigure container) { updateVisibility(); }
    });
    TIMELINE_PREFERENCES.addPropertyChangeListener(listener);
    getTimeline().addPropertyChangeListener(listener);
    getViewer().addPropertyChangeListener(listener);
    getViewer().getTreeTimelineContentProvider().addListener(listener);
    getViewer().getTimelineSectionModel().eAdapters().add(listener);
    super.activate();
}
项目:OpenSPIFe    文件:TreeTimelineDataRowEditPart.java   
@Override
public void deactivate() {
    if (getViewer().isAnimated()) {
        getFigure().removeLayoutListener(LayoutAnimator.getDefault());
    }
    getTimeline().removePropertyChangeListener(listener);
    getViewer().getTimelineSectionModel().eAdapters().remove(listener);
    getViewer().removePropertyChangeListener(listener);
    getViewer().getTreeTimelineContentProvider().removeListener(listener);
    TIMELINE_PREFERENCES.removePropertyChangeListener(listener);
    super.deactivate();
}