本文整理汇总了Java中org.netbeans.api.visual.router.RouterFactory类的典型用法代码示例。如果您正苦于以下问题:Java RouterFactory类的具体用法?Java RouterFactory怎么用?Java RouterFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RouterFactory类属于org.netbeans.api.visual.router包,在下文中一共展示了RouterFactory类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VMDGraphScene
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
/**
* Creates a VMD graph scene with a specific color scheme.
* @param scheme the color scheme
*/
public VMDGraphScene (VMDColorScheme scheme) {
this.scheme = scheme;
setKeyEventProcessingType (EventProcessingType.FOCUSED_WIDGET_AND_ITS_PARENTS);
addChild (backgroundLayer);
addChild (mainLayer);
addChild (connectionLayer);
addChild (upperLayer);
router = RouterFactory.createOrthogonalSearchRouter (mainLayer, connectionLayer);
getActions ().addAction (ActionFactory.createZoomAction ());
getActions ().addAction (ActionFactory.createPanAction ());
getActions ().addAction (ActionFactory.createRectangularSelectAction (this, backgroundLayer));
sceneLayout = LayoutFactory.createSceneGraphLayout (this, new GridGraphLayout<String, String> ().setChecker (true));
}
示例2: ConnectionWidget
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
/**
* Creates a connection widget.
* @param scene the scene
*/
public ConnectionWidget (Scene scene) {
super (scene);
sourceAnchorShape = AnchorShape.NONE;
targetAnchorShape = AnchorShape.NONE;
controlPointShape = PointShape.NONE;
endPointShape = PointShape.NONE;
router = RouterFactory.createDirectRouter ();
routingRequired = true;
connectionWidgetLayout = new ConnectionWidgetLayout ();
setLayout (connectionWidgetLayout);
stroke = STROKE_DEFAULT;
paintControlPoints = false;
controlPointCutDistance = 0;
sourceEntry = new ConnectionEntry (true);
targetEntry = new ConnectionEntry (false);
routingPolicy = RoutingPolicy.ALWAYS_ROUTE;
}
示例3: testCollisionsCollector
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
public void testCollisionsCollector () {
Scene scene = new Scene ();
ConnectionWidget widget = new ConnectionWidget (scene);
widget.setSourceAnchor (AnchorFactory.createFixedAnchor (new Point (100, 100)));
widget.setTargetAnchor (AnchorFactory.createFixedAnchor (new Point (300, 200)));
widget.setRouter (RouterFactory.createOrthogonalSearchRouter (new CollisionsCollector() {
public void collectCollisions (List<Rectangle> verticalCollisions, List<Rectangle> horizontalCollisions) {
getRef ().println ("CollisionsCollector invoked");
}
}));
scene.addChild (widget);
JFrame frame = showFrame (scene);
frame.setVisible(false);
frame.dispose ();
compareReferenceFiles ();
}
示例4: testConnectionWidgetCollisionsCollector
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
public void testConnectionWidgetCollisionsCollector () {
Scene scene = new Scene ();
final ConnectionWidget widget = new ConnectionWidget (scene);
widget.setSourceAnchor (AnchorFactory.createFixedAnchor (new Point (100, 100)));
widget.setTargetAnchor (AnchorFactory.createFixedAnchor (new Point (300, 200)));
widget.setRouter (RouterFactory.createOrthogonalSearchRouter (new ConnectionWidgetCollisionsCollector () {
public void collectCollisions (ConnectionWidget connectionWidget, List<Rectangle> verticalCollisions, List<Rectangle> horizontalCollisions) {
getRef ().println ("ConnectionWidgetCollisionsCollector invoked - is widget valid: " + (connectionWidget == widget));
}
}));
scene.addChild (widget);
JFrame frame = showFrame (scene);
frame.setVisible(false);
frame.dispose ();
compareReferenceFiles ();
}
示例5: setUseBezierRouter
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
private void setUseBezierRouter(boolean value) {
Router router;
if (value) {
router = new PolylineRouterV2(new WidgetCollisionCollector() {
@Override
public void collectCollisions(List<Widget> collisions) {
collisions.addAll(getNodeWidgets());
}
});
} else {
router = RouterFactory.createDirectRouter();
}
for (CfgEdge e : this.getEdges()) {
EdgeWidget ew = (EdgeWidget) this.findWidget(e);
ew.setRouter(router);
}
this.validate();
getPreferences().putBoolean(PREFERENCE_ROUTER, value);
}
示例6: QBGraphScene
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
public QBGraphScene(QueryBuilderGraphFrame qbGF) {
qbGF._firstTableInserted = false;
mainLayer = new LayerWidget(this);
connectionLayer = new LayerWidget(this);
addChild(mainLayer);
addChild(connectionLayer);
router = RouterFactory.createOrthogonalSearchRouter(mainLayer, connectionLayer);
getActions().addAction(mouseHoverAction);
// getActions().addAction(ActionFactory.createZoomAction());
// ToDo: qbGF has been passed in only to support the menu; eventually, merge QBGF into this
getActions().addAction(ActionFactory.createPopupMenuAction(qbGF));
}
示例7: ArrowWidget
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
/**
* Create an arrow between @sourceAnchor and @targetAnchor. Use orthogonal
* router.
*
* @param scene Scene into which the arrow will be added.
* @param sourceAnchor Starting point of the arrow
* @param targetAnchor Ending point of arrow
*/
public ArrowWidget(ShedScene scene, Anchor sourceAnchor, Anchor targetAnchor) {
super(scene);
setSourceAnchor(sourceAnchor);
setTargetAnchor(targetAnchor);
setRouter(RouterFactory.createOrthogonalSearchRouter());
setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
}
示例8: attachEdgeWidget
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
protected Widget attachEdgeWidget(InputBlockEdge edge) {
BlockConnectionWidget w = new BlockConnectionWidget(this, edge);
switch (edge.getState()) {
case NEW:
w.setBold(true);
break;
case DELETED:
w.setDashed(true);
break;
}
w.setRouter(RouterFactory.createDirectRouter());
w.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
edgeLayer.addChild(w);
return w;
}
示例9: attachEdgeWidget
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
protected Widget attachEdgeWidget(InputBlockEdge edge) {
ConnectionWidget w = new BlockConnectionWidget(this, edge);
w.setRouter(RouterFactory.createDirectRouter());
w.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
edgeLayer.addChild(w);
return w;
}
示例10: LunaticDepScene
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
public LunaticDepScene(VMDColorScheme scheme) {
this.scheme = scheme;
setKeyEventProcessingType(EventProcessingType.FOCUSED_WIDGET_AND_ITS_PARENTS);
addChild(backgroundLayer);
addChild(mainLayer);
addChild(connectionLayer);
addChild(upperLayer);
orthoRouter = RouterFactory.createOrthogonalSearchRouter(mainLayer, connectionLayer);
getActions().addAction(ActionFactory.createZoomAction());
getActions().addAction(ActionFactory.createPanAction());
getActions().addAction(ActionFactory.createRectangularSelectAction(this, backgroundLayer));
}
示例11: SchemaScene
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
public SchemaScene()
{
mainLayer = new LayerWidget(this);
addChild(mainLayer);
connectionLayer = new LayerWidget(this);
addChild(connectionLayer);
router = RouterFactory.createOrthogonalSearchRouter(mainLayer, connectionLayer);
GraphLayout<SchemaClass, SchemaRelationship> graphLayout = GraphLayoutFactory.createOrthogonalGraphLayout(this, true);
SceneLayout sceneLayout = LayoutFactory.createSceneGraphLayout(this, graphLayout);
sceneLayout.invokeLayout();
}
示例12: AbstractModelerScene
import org.netbeans.api.visual.router.RouterFactory; //导入依赖的package包/类
public AbstractModelerScene() {
setKeyEventProcessingType(EventProcessingType.FOCUSED_WIDGET_AND_ITS_CHILDREN);
backgroundLayer = new LayerWidget(this);
mainLayer = new LayerWidget(this);
connectionLayer = new LayerWidget(this);
interractionLayer = new LayerWidget(this);
boundaryWidgetLayer = new LayerWidget(this);
labelLayer = new LayerWidget(this);
addChild(backgroundLayer);
addChild(mainLayer);
addChild(interractionLayer);
addChild(connectionLayer);
addChild(boundaryWidgetLayer);
addChild(labelLayer);
boundaryWidgetLayer.bringToFront();
connectionLayer.bringToFront();
labelLayer.bringToFront();
router = RouterFactory.createFreeRouter();
// router = RouterFactory.createOrthogonalSearchRouter(mainLayer);
satelliteView = this.createSatelliteView();
// idGenerator = new UltraSimpleIdGenerator();
setActiveTool(DesignerTools.SELECT);
// Zoom Action
// getActions ().addAction (ActionFactory.createZoomAction (1.05, true));
// getActions ().addAction (ActionFactory.createPanAction ());
//multi move rectangular selection of widgets
// getActions ().addAction (ActionFactory.createRectangularSelectAction (this, backgroundLayer));
// getPriorActions().addAction(new WidgetAction.Adapter () {
// @Override
// public State mousePressed(Widget widget, WidgetMouseEvent event) {
// getView().requestFocus();
// return State.REJECTED;
// }
// });
this.setContextPaletteManager(new SwingPaletteManager((IModelerScene) this));
}