Search in sources :

Example 6 with ConnectionLayer

use of org.eclipse.draw2d.ConnectionLayer in project dbeaver by dbeaver.

the class DiagramPart method createFigure.

@Override
protected IFigure createFigure() {
    EntityDiagramFigure figure = new EntityDiagramFigure(this);
    delegatingLayoutManager = new DelegatingLayoutManager(this);
    figure.setLayoutManager(delegatingLayoutManager);
    /*
        ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
        ViewportAwareConnectionLayerClippingStrategy clippingStrategy = new ViewportAwareConnectionLayerClippingStrategy(cLayer);
        figure.setClippingStrategy(clippingStrategy);
*/
    Control control = getViewer().getControl();
    ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    if ((control.getStyle() & SWT.MIRRORED) == 0) {
        cLayer.setAntialias(SWT.ON);
    }
    FanRouter router = new FanRouter();
    router.setSeparation(15);
    // router.setNextRouter(new BendpointConnectionRouter());
    router.setNextRouter(new ShortestPathConnectionRouter(figure));
    // router.setNextRouter(new ManhattanConnectionRouter());
    // router.setNextRouter(new BendpointConnectionRouter());
    cLayer.setConnectionRouter(router);
    return figure;
}
Also used : EntityDiagramFigure(org.jkiss.dbeaver.erd.ui.figures.EntityDiagramFigure) Control(org.eclipse.swt.widgets.Control) ShortestPathConnectionRouter(org.eclipse.draw2d.ShortestPathConnectionRouter) DelegatingLayoutManager(org.jkiss.dbeaver.erd.ui.layout.DelegatingLayoutManager) FanRouter(org.eclipse.draw2d.FanRouter) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 7 with ConnectionLayer

use of org.eclipse.draw2d.ConnectionLayer in project archi by archimatetool.

the class GraphicalRootEditPart method createFigure.

/**
 * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    innerLayers = new LayeredPane();
    printableLayers = new LayeredPane();
    Layer layer = new Layer();
    layer.setLayoutManager(new StackLayout());
    printableLayers.add(layer, PRIMARY_LAYER);
    layer = new ConnectionLayer();
    layer.setPreferredSize(new Dimension(5, 5));
    printableLayers.add(layer, CONNECTION_LAYER);
    innerLayers.add(printableLayers, PRINTABLE_LAYERS);
    layer = new Layer();
    layer.setPreferredSize(new Dimension(5, 5));
    innerLayers.add(layer, HANDLE_LAYER);
    layer = new FeedbackLayer();
    layer.setPreferredSize(new Dimension(5, 5));
    innerLayers.add(layer, FEEDBACK_LAYER);
    ScrollPane pane = new ScrollPane();
    pane.setViewport(new Viewport(true));
    pane.setContents(innerLayers);
    return pane;
}
Also used : LayeredPane(org.eclipse.draw2d.LayeredPane) ScrollPane(org.eclipse.draw2d.ScrollPane) StackLayout(org.eclipse.draw2d.StackLayout) Viewport(org.eclipse.draw2d.Viewport) Dimension(org.eclipse.draw2d.geometry.Dimension) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer) Layer(org.eclipse.draw2d.Layer) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 8 with ConnectionLayer

use of org.eclipse.draw2d.ConnectionLayer in project archi by archimatetool.

the class FreeformGraphicalRootEditPart method createPrintableLayers.

/**
 * 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;
}
Also used : FreeformLayeredPane(org.eclipse.draw2d.FreeformLayeredPane) FreeformLayer(org.eclipse.draw2d.FreeformLayer) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 9 with ConnectionLayer

use of org.eclipse.draw2d.ConnectionLayer in project archi by archimatetool.

the class ScalableRootEditPart method createPrintableLayers.

/**
 * 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() {
    LayeredPane pane = new LayeredPane();
    Layer layer = new Layer();
    layer.setLayoutManager(new StackLayout());
    pane.add(layer, PRIMARY_LAYER);
    layer = new ConnectionLayer();
    layer.setPreferredSize(new Dimension(5, 5));
    pane.add(layer, CONNECTION_LAYER);
    return pane;
}
Also used : LayeredPane(org.eclipse.draw2d.LayeredPane) ScalableLayeredPane(org.eclipse.draw2d.ScalableLayeredPane) StackLayout(org.eclipse.draw2d.StackLayout) Dimension(org.eclipse.draw2d.geometry.Dimension) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer) Layer(org.eclipse.draw2d.Layer) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 10 with ConnectionLayer

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

the class ProcessPart method refreshVisuals.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
     */
@Override
protected void refreshVisuals() {
    super.refreshVisuals();
    if (DesignerPlugin.getDefault().getPreferenceStore().getBoolean(TalendDesignerPrefConstants.EDITOR_ANTIALIASING)) {
        ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
        cLayer.setAntialias(SWT.ON);
    }
}
Also used : ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Aggregations

ConnectionLayer (org.eclipse.draw2d.ConnectionLayer)21 FanRouter (org.eclipse.draw2d.FanRouter)5 ArrayList (java.util.ArrayList)3 BendpointConnectionRouter (org.eclipse.draw2d.BendpointConnectionRouter)3 FreeformLayer (org.eclipse.draw2d.FreeformLayer)3 FreeformLayeredPane (org.eclipse.draw2d.FreeformLayeredPane)3 ManhattanConnectionRouter (org.eclipse.draw2d.ManhattanConnectionRouter)3 ShortestPathConnectionRouter (org.eclipse.draw2d.ShortestPathConnectionRouter)3 Control (org.eclipse.swt.widgets.Control)3 WidgetEditPartFactory (org.csstudio.opibuilder.editparts.WidgetEditPartFactory)2 AutomaticRouter (org.eclipse.draw2d.AutomaticRouter)2 IFigure (org.eclipse.draw2d.IFigure)2 Layer (org.eclipse.draw2d.Layer)2 LayeredPane (org.eclipse.draw2d.LayeredPane)2 ScalableFreeformLayeredPane (org.eclipse.draw2d.ScalableFreeformLayeredPane)2 StackLayout (org.eclipse.draw2d.StackLayout)2 Dimension (org.eclipse.draw2d.geometry.Dimension)2 ContextMenuProvider (org.eclipse.gef.ContextMenuProvider)2 ScalableFreeformRootEditPart (org.eclipse.gef.editparts.ScalableFreeformRootEditPart)2 ScrollingGraphicalViewer (org.eclipse.gef.ui.parts.ScrollingGraphicalViewer)2