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

项目:Hydrograph    文件:ContainerEditPart.java   
@Override
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 ManhattanConnectionRouter());
    return f;
}
项目:NEXCORE-UML-Modeler    文件:ActivityDiagramEditor.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.editor.AbstractDiagramEditor#initializeGraphicalViewer()
 */
@Override
protected void initializeGraphicalViewer() {
    super.initializeGraphicalViewer();
    GraphicalViewer viewer = getGraphicalViewer();
    // ManhattanConnectionRouter 설정
    if ("true".equals(PreferenceUtil.INSTANCE.getValueOfStringFieldEditor(ManagerConstant.PREFERENCE_ACTIVITYDIAGRAM_CONNECTION_ROUTER_USE))) {
        ScalableFreeformRootEditPart root = (ScalableFreeformRootEditPart) viewer.getRootEditPart();
        ConnectionLayer connLayer = (ConnectionLayer) root.getLayer(LayerConstants.CONNECTION_LAYER);
        connLayer.setConnectionRouter(new ManhattanConnectionRouter());
    }
}