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());
}
}
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());
}
}
Aggregations