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


Java RouterFactory类代码示例

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

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

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

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

示例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);
}
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:21,代码来源:CfgScene.java

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

示例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);
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:17,代码来源:ArrowWidget.java

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

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

示例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));
}
 
开发者ID:donatellosantoro,项目名称:Llunatic,代码行数:13,代码来源:LunaticDepScene.java

示例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();
}
 
开发者ID:terraframe,项目名称:Runway-SDK,代码行数:12,代码来源:SchemaScene.java

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

    }
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:44,代码来源:AbstractModelerScene.java


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