Java Code Examples for org.netbeans.api.visual.widget.ConnectionWidget#setRouter()

The following examples show how to use org.netbeans.api.visual.widget.ConnectionWidget#setRouter() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ConnectionWidgetCollisionsCollectorTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
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 ();
}
 
Example 2
Source File: ConnectionWidgetCollisionsCollectorTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
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 ();
}
 
Example 3
Source File: ControlFlowScene.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 4
Source File: ControlFlowScene.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 5
Source File: ControlFlowScene.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 6
Source File: ControlFlowScene.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 7
Source File: ControlFlowScene.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 8
Source File: ControlFlowScene.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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;
}
 
Example 9
Source File: ControlFlowScene.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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;
}