Search in sources :

Example 6 with BendpointConnectionRouter

use of org.eclipse.draw2d.BendpointConnectionRouter in project webtools.sourceediting by eclipse.

the class RootEditPart method activate.

public void activate() {
    super.activate();
    // Set up Connection layer with a router, if it doesn't already have one
    ConnectionLayer connectionLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    if (connectionLayer != null) {
        connectionLayer.setConnectionRouter(new BendpointConnectionRouter());
    }
    Figure figure = (Figure) getLayer(LayerConstants.FEEDBACK_LAYER);
    if (figure != null) {
        if (getViewer() instanceof ScrollingGraphicalViewer) {
        // ScrollingGraphicalViewer sgv = (ScrollingGraphicalViewer)getViewer();
        // IndexFigure indexFigure = new IndexFigure(sgv);
        // figure.add(indexFigure);
        // getViewer().addPropertyChangeListener(indexFigure);
        }
    }
    refresh();
}
Also used : ScrollingGraphicalViewer(org.eclipse.gef.ui.parts.ScrollingGraphicalViewer) BendpointConnectionRouter(org.eclipse.draw2d.BendpointConnectionRouter) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer) IFigure(org.eclipse.draw2d.IFigure) Figure(org.eclipse.draw2d.Figure) RectangleFigure(org.eclipse.draw2d.RectangleFigure)

Example 7 with BendpointConnectionRouter

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

the class AbstractDiagramPart method setConnectionRouter.

/**
 * Set Connection Router type for the whole diagram
 */
protected void setConnectionRouter(boolean withAnimation) {
    // Animation
    if (withAnimation && AnimationUtil.doAnimate()) {
        Animation.markBegin();
    }
    ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
    switch(getModel().getConnectionRouterType()) {
        case IDiagramModel.CONNECTION_ROUTER_MANHATTAN:
            cLayer.setConnectionRouter(new ManhattanConnectionRouter());
            break;
        case IDiagramModel.CONNECTION_ROUTER_BENDPOINT:
        default:
            AutomaticRouter router = new FanRouter();
            router.setNextRouter(new BendpointConnectionRouter());
            cLayer.setConnectionRouter(router);
            break;
    }
    if (withAnimation && AnimationUtil.doAnimate()) {
        Animation.run(AnimationUtil.animationSpeed());
    }
}
Also used : AutomaticRouter(org.eclipse.draw2d.AutomaticRouter) BendpointConnectionRouter(org.eclipse.draw2d.BendpointConnectionRouter) ManhattanConnectionRouter(org.eclipse.draw2d.ManhattanConnectionRouter) FanRouter(org.eclipse.draw2d.FanRouter) ConnectionLayer(org.eclipse.draw2d.ConnectionLayer)

Example 8 with BendpointConnectionRouter

use of org.eclipse.draw2d.BendpointConnectionRouter in project dbeaver by serge-rider.

the class DummyEdgePart method createFigure.

/**
 * @see org.eclipse.gef.editparts.AbstractConnectionEditPart#createFigure()
 */
protected IFigure createFigure() {
    PolylineConnection conn = new PolylineConnection();
    conn.setConnectionRouter(new BendpointConnectionRouter());
    conn.setVisible(true);
    return conn;
}
Also used : BendpointConnectionRouter(org.eclipse.draw2d.BendpointConnectionRouter) PolylineConnection(org.eclipse.draw2d.PolylineConnection)

Example 9 with BendpointConnectionRouter

use of org.eclipse.draw2d.BendpointConnectionRouter in project jbosstools-hibernate by jbosstools.

the class DummyEdgePart method createFigure.

/**
 * @see org.eclipse.gef.editparts.AbstractConnectionEditPart#createFigure()
 */
protected IFigure createFigure() {
    PolylineConnection conn = new PolylineConnection();
    conn.setConnectionRouter(new BendpointConnectionRouter());
    conn.setVisible(false);
    return conn;
}
Also used : BendpointConnectionRouter(org.eclipse.draw2d.BendpointConnectionRouter) PolylineConnection(org.eclipse.draw2d.PolylineConnection)

Aggregations

BendpointConnectionRouter (org.eclipse.draw2d.BendpointConnectionRouter)9 PolylineConnection (org.eclipse.draw2d.PolylineConnection)6 ConnectionLayer (org.eclipse.draw2d.ConnectionLayer)3 AutomaticRouter (org.eclipse.draw2d.AutomaticRouter)2 FanRouter (org.eclipse.draw2d.FanRouter)2 ManhattanConnectionRouter (org.eclipse.draw2d.ManhattanConnectionRouter)2 Figure (org.eclipse.draw2d.Figure)1 IFigure (org.eclipse.draw2d.IFigure)1 PolygonDecoration (org.eclipse.draw2d.PolygonDecoration)1 RectangleFigure (org.eclipse.draw2d.RectangleFigure)1 ScrollingGraphicalViewer (org.eclipse.gef.ui.parts.ScrollingGraphicalViewer)1