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

项目: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();
}
项目:gef-gwt    文件:FreeformGraphicalRootEditPart.java   
/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
protected IFigure createFigure() {
    FreeformViewport viewport = new FreeformViewport();
    innerLayers = new FreeformLayeredPane();
    createLayers(innerLayers);
    viewport.setContents(innerLayers);
    return viewport;
}
项目:gef-gwt    文件:FreeformGraphicalRootEditPart.java   
/**
 * Creates a layered pane and the layers that should be printed.
 * 
 * @see org.eclipse.gef.print.PrintGraphicalViewerOperation
 * @return a new LayeredPane containing the printable layers
 */
protected LayeredPane createPrintableLayers() {
    FreeformLayeredPane layeredPane = new FreeformLayeredPane();
    layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
    layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
    return layeredPane;
}
项目:birt    文件:CrosstabTableEditPart.java   
protected IFigure createFigure( )
{
    TableFigure viewport = new TableFigure( );
    viewport.setOpaque( false );

    innerLayers = new FreeformLayeredPane( );
    createLayers( innerLayers );
    viewport.setContents( innerLayers );
    return viewport;
}
项目:birt    文件:TableEditPart.java   
protected IFigure createFigure( )
{
    TableFigure viewport = new TableFigure( );
    viewport.setOpaque( false );

    innerLayers = new FreeformLayeredPane( );
    createLayers( innerLayers );
    viewport.setContents( innerLayers );
    return viewport;
}
项目:birt    文件:AbstractTableEditPart.java   
/**
 * Creates a layered pane and the layers that should be printed.
 * 
 * @see org.eclipse.gef.print.PrintGraphicalViewerOperation
 * @return a new LayeredPane containing the printable layers
 */
protected LayeredPane createPrintableLayers( )
{
    FreeformLayeredPane layeredPane = new FreeformLayeredPane( );
    FreeformLayer layer = new FreeformLayer( );

    layer.setLayoutManager( new TableLayout( this ) );
    layeredPane.add( layer, PRIMARY_LAYER );
    layeredPane.add( new TableBorderLayer( this ), BORDER_LAYER );
    return layeredPane;
}
项目:seg.jUCMNav    文件:GrlConnectionOnBottomRootEditPart.java   
/**
 * Overwrite this function and add the connection layer before the primary layer. This will make the nodes display on top of the connections.
 */
protected LayeredPane createPrintableLayers() {
    FreeformLayeredPane layeredPane = new FreeformLayeredPane();

    FreeformLayer comp = new FreeformLayer();
    comp.setLayoutManager(new FreeformLayout());

    layeredPane.add(comp, COMPONENT_LAYER);

    layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
    layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
    return layeredPane;

}
项目: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    文件:UCMConnectionOnBottomRootEditPart.java   
/**
 * Overwrite this function and add the connection layer before the primary layer. This will make the nodes display on top of the connections.
 */
protected LayeredPane createPrintableLayers() {
    FreeformLayeredPane layeredPane = new FreeformLayeredPane();

    FreeformLayer comp = new FreeformLayer();
    comp.setLayoutManager(new FreeformLayout());

    layeredPane.add(comp, COMPONENT_LAYER);
    layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
    layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
    return layeredPane;
}
项目:relations    文件:RelationsRootEditPart.java   
@Override
protected LayeredPane createPrintableLayers() {
    final FreeformLayeredPane layeredPane = new FreeformLayeredPane();
    layeredPane.add(new ConnectionLayer(), CONNECTION_LAYER);
    layeredPane.add(new FreeformLayer(), PRIMARY_LAYER);
    return layeredPane;
}