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

项目:seg.jUCMNav    文件:ActorRefEditPart.java   
/**
 * Creates the figure for actor refs, and also adds evaluation labels / icons to the background.
 * 
 * @see seg.jUCMNav.editparts.ModelElementEditPart#createFigure()
 */
protected IFigure createFigure() {
    evaluationLabel = new Label();
    evaluationLabel.setForegroundColor(ColorManager.LINKREFLABEL);

    evaluationLabel.setSize(78, 16); // increased from 58,16
    evaluationImg = (JUCMNavPlugin.getImage("icons/Actor16.gif")); //$NON-NLS-1$
    evaluationLabel.setIcon(evaluationImg);
    evaluationLabel.setText(""); //$NON-NLS-1$
    evaluationLabel.setVisible(true);
    try {
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).add(evaluationLabel);
    } catch (Exception ex) {
        System.out.println("problem with scaling grl evaluation label"); //$NON-NLS-1$
        // bug 435: old code.. hoping new code is more robust.
        ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().add(evaluationLabel);
    }

    return new ActorFigure();
}
项目:seg.jUCMNav    文件:ActorRefEditPart.java   
/**
 * Overriding because we also have to listen to the Actor definition
 * 
 * @see org.eclipse.gef.EditPart#deactivate()
 */
public void deactivate() {
    if (isActive()) {
        // if (evaluationImg != null) {
        // evaluationImg.dispose();
        // evaluationImg = null;
        // }
        // ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().remove(evaluationLabel);
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).remove(evaluationLabel);
        if (getActorRef().getContDef() != null) {
            getActorRef().getContDef().eAdapters().remove(this);
        }
    }

    // stop listening to reference
    super.deactivate();
}
项目:Hydrograph    文件:FixedConnectionAnchor.java   
/**
 * @see org.eclipse.draw2d.AbstractConnectionAnchor#ancestorMoved(IFigure)
 */
@Override
public void ancestorMoved(IFigure figure) {
    if (figure instanceof ScalableFigure)
        return;
    super.ancestorMoved(figure);
}
项目:seg.jUCMNav    文件:IntentionalElementEditPart.java   
/**
 * Create the GrlNode figure and associated evaluation labels.
 * 
 * @see seg.jUCMNav.editparts.ModelElementEditPart#createFigure()
 */
protected IFigure createFigure() {
    IntentionalElementFigure fig = new IntentionalElementFigure();

    evaluationLabel = new Label();
    evaluationLabel.setForegroundColor(ColorManager.LINKREFLABEL);
    evaluationLabel.setVisible(false);

    evaluationLabel.setSize(100, 16); // resized from 60, 16
    evaluationLabel.setTextAlignment(PositionConstants.LEFT);
    kpiEvaluationValueLabel = new Label();
    kpiEvaluationValueLabel.setForegroundColor(ColorManager.BLUE);
    kpiEvaluationValueLabel.setVisible(false);
    kpiEvaluationValueLabel.setSize(70, 16);

    try {
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).add(evaluationLabel);
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).add(kpiEvaluationValueLabel);
    } catch (Exception ex) {
        System.out.println("problem with scaling grl evaluation label"); //$NON-NLS-1$
        // bug 435: old code.. hoping new code is more robust
        ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().add(evaluationLabel);
        ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().add(kpiEvaluationValueLabel);
    }
    return fig;
}
项目:seg.jUCMNav    文件:IntentionalElementEditPart.java   
/**
 * Overriding because we also have to listen to the Component definition
 * 
 * @see org.eclipse.gef.EditPart#deactivate()
 */
public void deactivate() {
    if (isActive()) {
        // bug 435: ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure().remove(evaluationLabel);
        ((ScalableFigure) ((FreeformLayeredPane) ((FreeformViewport) ((GrlConnectionOnBottomRootEditPart) getRoot()).getFigure()).getChildren().get(0))
                .getChildren().get(0)).remove(evaluationLabel);
        if (getNode() instanceof IntentionalElementRef && (getNode()).getDef() != null)
            (getNode()).getDef().eAdapters().remove(this);
    }
    super.deactivate();

}
项目:seg.jUCMNav    文件:DelegatingZoomManager.java   
/**
 * Creates a new DelegatingZoomManager instance.
 */
public DelegatingZoomManager(UCMNavMultiPageEditor editor) {
    super((ScalableFigure) null, (Viewport) null);

    setEditor(editor);

    List zoomLevels = new ArrayList(3);
    zoomLevels.add(ZoomManager.FIT_ALL);
    zoomLevels.add(ZoomManager.FIT_WIDTH);
    zoomLevels.add(ZoomManager.FIT_HEIGHT);
    setZoomLevelContributions(zoomLevels);

}
项目:NEXCORE-UML-Modeler    文件:FixedConnectionAnchor.java   
/**
 * @see org.eclipse.draw2d.AbstractConnectionAnchor#ancestorMoved(IFigure)
 */
public void ancestorMoved(IFigure figure) {
    if (figure instanceof ScalableFigure)
        return;
    super.ancestorMoved(figure);
}
项目:gef-gwt    文件:ScalableFreeformRootEditPart.java   
/**
 * Constructor for ScalableFreeformRootEditPart
 */
public ScalableFreeformRootEditPart() {
    zoomManager = new ZoomManager((ScalableFigure) getScaledLayers(),
            ((Viewport) getFigure()));
}
项目:seg.jUCMNav    文件:DelegatingZoomManager.java   
public ScalableFigure getScalableFigure() {
    if (null == currentZoomManager)
        return null;

    return currentZoomManager.getScalableFigure();
}
项目:cogtool    文件:InteractionDrawingEditor.java   
public void addScaledInteractionFigure(ScalableFigure f, int atDepth)
{
    // Scale the given figure
    f.setScale(contents.getScale());
    addInteractionFigure(f, atDepth);
}
项目:gef-gwt    文件:ZoomManager.java   
/**
 * Creates a new ZoomManager.
 * 
 * @param pane
 *            The ScalableFigure associated with this ZoomManager
 * @param viewport
 *            The Viewport assoicated with this ZoomManager
 */
public ZoomManager(ScalableFigure pane, Viewport viewport) {
    this.pane = pane;
    this.viewport = viewport;
}
项目:gef-gwt    文件:ZoomManager.java   
/**
 * Returns the figure which performs the actual zooming.
 * 
 * @return the scalable figure
 */
public ScalableFigure getScalableFigure() {
    return pane;
}