本文整理汇总了Java中org.netbeans.api.visual.widget.ConnectionWidget.setRouter方法的典型用法代码示例。如果您正苦于以下问题:Java ConnectionWidget.setRouter方法的具体用法?Java ConnectionWidget.setRouter怎么用?Java ConnectionWidget.setRouter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.visual.widget.ConnectionWidget
的用法示例。
在下文中一共展示了ConnectionWidget.setRouter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCollisionsCollector
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的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 ();
}
示例2: testConnectionWidgetCollisionsCollector
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的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 ();
}
示例3: attachEdgeWidget
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的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;
}
示例4: attachEdgeWidget
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
@Override
protected Widget attachEdgeWidget(SchemaRelationship relationship)
{
ConnectionWidget connectionWidget = new SchemaRelationshipWidget(this, relationship);
connectionWidget.setRouter(router);
connectionLayer.addChild(connectionWidget);
return connectionWidget;
}
示例5: attachEdgeWidget
import org.netbeans.api.visual.widget.ConnectionWidget; //导入方法依赖的package包/类
@Override
protected Widget attachEdgeWidget(JRLibEdge edge) {
ConnectionWidget widget = new ConnectionWidget(this);
widget.setRouter(router);
connectionLayer.addChild(widget);
createConnectionActions(widget);
return widget;
}