public void activate() { super.activate(); ScalableRootEditPart root = (ScalableRootEditPart) getViewer().getRootEditPart(); ConnectionLayer connLayer = (ConnectionLayer) root.getLayer(LayerConstants.CONNECTION_LAYER); GraphicalEditPart contentEditPart = (GraphicalEditPart) root.getContents(); FanRouter router = new FanRouter(); router.setSeparation(100); ShortestPathConnectionRouter spRouter = new ShortestPathConnectionRouter(contentEditPart.getFigure()); router.setNextRouter(spRouter); connLayer.setConnectionRouter(router); GraphSelectionManager.ME.selectionPartChanged(this); }
protected void refreshVisuals() { super.refreshVisuals(); ConnectionLayer connectionLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER); connectionLayer.setConnectionRouter(new ShortestPathConnectionRouter(figure)); if ((getViewer().getControl().getStyle() & SWT.MIRRORED) == 0) { connectionLayer.setAntialias(SWT.ON); } Animation.run(400); }
protected IFigure createFigure() { Figure f = new FreeformLayer(); f.setBorder(new MarginBorder(3)); f.setLayoutManager(new FreeformLayout()); // Create the static router for the connection layer ConnectionLayer connLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER); connLayer.setConnectionRouter(new ShortestPathConnectionRouter(f)); return f; }