Search in sources :

Example 1 with AutomaticRouter

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

the class AbstractDiagramPart method refreshVisuals.

@Override
public void refreshVisuals() {
    // on the connection figures - see AbstractConnectionFigure
    if (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 (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 2 with AutomaticRouter

use of org.eclipse.draw2d.AutomaticRouter 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)

Aggregations

AutomaticRouter (org.eclipse.draw2d.AutomaticRouter)2 BendpointConnectionRouter (org.eclipse.draw2d.BendpointConnectionRouter)2 ConnectionLayer (org.eclipse.draw2d.ConnectionLayer)2 FanRouter (org.eclipse.draw2d.FanRouter)2 ManhattanConnectionRouter (org.eclipse.draw2d.ManhattanConnectionRouter)2