環境:Eclipse 3.4.1 (eclipse-modeling-ganymede-SR1-incubation-win32) ---- [[コネクションの途中のベンドポイントをドラッグしたときの動作]] [[ベンドポイントを永続化するコマンド]] [[ベンドポイントをモデルからフィガーの制約にロード箇所]] [[ベンドポイントのハンドルを表示している箇所]] [[マンハッタンルーター的な動作をするGMFのルーター]] ---- GMFのコネクション制御を行うEditPart基底クラス。 org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart extends AbstractConnectionEditPart protected void refreshVisuals() { super.refreshVisuals(); refreshVisibility(); refreshForegroundColor(); refreshRoutingStyles(); refreshSmoothness(); refreshJumplinks(); refreshBendpoints(); refreshFont(); } フィガーの作成・・・いちいちテンプレートメソッド・・・ final protected IFigure createFigure() { return createConnectionFigure(); } abstract protected Connection createConnectionFigure(); installRouterメソッド内で、Styleに設定したルーティングより使用するルーティングクラスが決定する。 ルーティングクラスはレイヤーより取得している・・・ org.eclipse.gmf.runtime.draw2d.ui.internal.figures.ConnectionLayerEx extends ConnectionLayer protected void installRouter() { ConnectionLayer cLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER); RoutingStyle style = (RoutingStyle) ((View) getModel()) .getStyle(NotationPackage.Literals.ROUTING_STYLE); if (style != null && cLayer instanceof ConnectionLayerEx) { ConnectionLayerEx cLayerEx = (ConnectionLayerEx) cLayer; Routing routing = style.getRouting(); if (Routing.MANUAL_LITERAL == routing) { getConnectionFigure().setConnectionRouter( cLayerEx.getObliqueRouter()); } else if (Routing.RECTILINEAR_LITERAL == routing) { getConnectionFigure().setConnectionRouter( cLayerEx.getRectilinearRouter()); } else if (Routing.TREE_LITERAL == routing) { getConnectionFigure().setConnectionRouter( cLayerEx.getTreeRouter()); } } refreshRouterChange(); } 例えば org.eclipse.gmf.runtime.draw2d.ui.internal.routers.RectilinearRouter org.eclipse.gmf.runtime.draw2d.ui.internal.routers.BorderItemRectilinearRouter とか refreshBendpoints内でモデルから制約を取得してルーターにセットしている