当前位置: 首页>>代码示例>>Java>>正文


Java ConnectionWidget.setRouter方法代码示例

本文整理汇总了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 ();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:ConnectionWidgetCollisionsCollectorTest.java

示例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 ();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:ConnectionWidgetCollisionsCollectorTest.java

示例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;
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:8,代码来源:ControlFlowScene.java

示例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;

}
 
开发者ID:terraframe,项目名称:Runway-SDK,代码行数:10,代码来源:SchemaScene.java

示例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;
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:9,代码来源:JRLibScene.java


注:本文中的org.netbeans.api.visual.widget.ConnectionWidget.setRouter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。