@Override protected IFigure createMain () { final Figure baseFigure = new LayeredPane (); final Layer rootFigure = new Layer (); this.connLayer = new ConnectionLayer (); this.connLayer.setAntialias ( 1 ); this.connLayer.setConnectionRouter ( ConnectionRouter.NULL ); baseFigure.add ( this.connLayer ); baseFigure.add ( rootFigure ); rootFigure.setLayoutManager ( new BorderLayout () ); rootFigure.setBackgroundColor ( ColorConstants.white ); rootFigure.add ( createArrowFigure (), BorderLayout.RIGHT ); rootFigure.add ( createEntryGrid ( this.connLayer ), BorderLayout.CENTER ); return baseFigure; }
@Override protected IFigure createFigure() { Link link = (Link) getModel(); link.editPart = this; SankeyDiagram editor = ((ProductSystemNode) link.sourceNode.parent).editor; PolylineConnection conn = new LinkFigure(link.getWidth(), editor); if (editor.isRouted()) { conn.setConnectionRouter(ROUTER); } else { conn.setConnectionRouter(ConnectionRouter.NULL); } link.figure = conn; conn.setTolerance(0); conn.setForegroundColor(link.getColor()); return conn; }
public void setConnectionRouter( ConnectionRouter cr ) { if ( cr == null ) super.setConnectionRouter( new ColumnConnectionRouter( ) ); else super.setConnectionRouter( cr ); }
public void setRouted(boolean routed) { this.routed = routed; ConnectionRouter router = ConnectionRouter.NULL; if (routed) router = TreeConnectionRouter.instance; for (ProcessNode node : model.getChildren()) for (Link link : node.links) link.figure.setConnectionRouter(router); }
public void setRouted(boolean enabled) { ConnectionRouter router = ConnectionRouter.NULL; if (enabled) router = LinkPart.ROUTER; for (Node node : children) { if (!(node instanceof ProcessNode)) continue; ProcessNode pNode = (ProcessNode) node; for (Link link : pNode.links) { link.figure.setConnectionRouter(router); } } }
private ConnectionRouter getConnectionRouter() { return getEditor().isRouted() ? TreeConnectionRouter.instance : ConnectionRouter.NULL; }
@Override protected ConnectionRouter getDummyConnectionRouter(CreateConnectionRequest request) { return ConnectionRouter.NULL; }
/** * Returns the ConnectionRouter for the creation feedback's connection. * * @param request * the create request * @return a connection router * @since 3.2 */ protected ConnectionRouter getDummyConnectionRouter( CreateConnectionRequest request) { return ((ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER)) .getConnectionRouter(); }