Java 类org.eclipse.draw2d.ShortestPathConnectionRouter 实例源码

项目:gw4e.project    文件:GraphPart.java   
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);
}
项目:bdf2    文件:SchemaEditPart.java   
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);
}
项目:lunifera-sharky-m2m    文件:DiagramEditPart.java   
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;
}
项目:lunifera-sharky-m2m    文件:DiagramEditPart.java   
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;
}