Search in sources :

Example 1 with LayeredPane

use of org.eclipse.draw2d.LayeredPane in project tdi-studio-se by Talend.

the class BusinessDiagramEditor method configureGraphicalViewer.

/**
     * @generated
     */
@Override
protected void configureGraphicalViewer() {
    super.configureGraphicalViewer();
    IDiagramGraphicalViewer viewer = getDiagramGraphicalViewer();
    // customize popup menu
    ContextMenuProvider provider = new BusinessDiagramActionProvider(this, viewer);
    viewer.setContextMenu(provider);
    getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, viewer);
    DiagramRootEditPart root = (DiagramRootEditPart) getDiagramGraphicalViewer().getRootEditPart();
    LayeredPane printableLayers = (LayeredPane) root.getLayer(LayerConstants.PRINTABLE_LAYERS);
    FreeformLayer extLabelsLayer = new FreeformLayer();
    extLabelsLayer.setLayoutManager(new DelegatingLayout());
    printableLayers.addLayerAfter(extLabelsLayer, BusinessEditPartFactory.EXTERNAL_NODE_LABELS_LAYER, LayerConstants.PRIMARY_LAYER);
    LayeredPane scalableLayers = (LayeredPane) root.getLayer(LayerConstants.SCALABLE_LAYERS);
    FreeformLayer scaledFeedbackLayer = new FreeformLayer();
    scaledFeedbackLayer.setEnabled(false);
    scalableLayers.addLayerAfter(scaledFeedbackLayer, LayerConstants.SCALED_FEEDBACK_LAYER, DiagramRootEditPart.DECORATION_UNPRINTABLE_LAYER);
}
Also used : IDiagramGraphicalViewer(org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer) DelegatingLayout(org.eclipse.draw2d.DelegatingLayout) LayeredPane(org.eclipse.draw2d.LayeredPane) FreeformLayer(org.eclipse.draw2d.FreeformLayer) BusinessDiagramActionProvider(org.talend.designer.business.model.business.diagram.providers.BusinessDiagramActionProvider) ContextMenuProvider(org.eclipse.gef.ContextMenuProvider) DiagramRootEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart)

Example 2 with LayeredPane

use of org.eclipse.draw2d.LayeredPane in project cubrid-manager by CUBRID.

the class ERScalableFreeformRootEditPart method getLayer.

public IFigure getLayer(Object key) {
    IFigure innerLayer = innerLayers == null ? null : innerLayers.getLayer(key);
    if (innerLayer != null) {
        return innerLayer;
    }
    LayeredPane scaledLayers = getScaledLayers();
    IFigure layer = scaledLayers == null ? null : scaledLayers.getLayer(key);
    if (layer != null) {
        return layer;
    }
    if (getPrintableLayers() == null) {
        return null;
    }
    return getPrintableLayers().getLayer(key);
}
Also used : FreeformLayeredPane(org.eclipse.draw2d.FreeformLayeredPane) LayeredPane(org.eclipse.draw2d.LayeredPane) IFigure(org.eclipse.draw2d.IFigure)

Aggregations

LayeredPane (org.eclipse.draw2d.LayeredPane)2 DelegatingLayout (org.eclipse.draw2d.DelegatingLayout)1 FreeformLayer (org.eclipse.draw2d.FreeformLayer)1 FreeformLayeredPane (org.eclipse.draw2d.FreeformLayeredPane)1 IFigure (org.eclipse.draw2d.IFigure)1 ContextMenuProvider (org.eclipse.gef.ContextMenuProvider)1 DiagramRootEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart)1 IDiagramGraphicalViewer (org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramGraphicalViewer)1 BusinessDiagramActionProvider (org.talend.designer.business.model.business.diagram.providers.BusinessDiagramActionProvider)1