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

The following examples show how to use org.netbeans.api.visual.widget.ConnectionWidget#setTargetAnchorShape() . 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: 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 2
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 3
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 4
Source File: Utils.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Widget attachEdgeWidget(String edge) {
    ConnectionWidget connection = new ConnectionWidget(this);
    connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
    connection.setEndPointShape(PointShape.SQUARE_FILLED_BIG);
    connection.getActions().addAction(createObjectHoverAction());
    connection.getActions().addAction(createSelectAction());
    connection.getActions().addAction(reconnectAction);
    connectionLayer.addChild(connection);
    return connection;
}
 
Example 5
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 6
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 7
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 8
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;
}
 
Example 9
Source File: AbegoTreeLayoutForNetbeansDemo.java    From treelayout with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
protected Widget attachEdgeWidget(String e) {
	ConnectionWidget connectionWidget = new ConnectionWidget(this);
	connectionWidget.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
	connectionLayer.addChild(connectionWidget);
	return connectionWidget;
}
 
Example 10
Source File: ActionFactory.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public ConnectionWidget createConnectionWidget (Scene scene) {
    ConnectionWidget widget = new ConnectionWidget (scene);
    widget.setTargetAnchorShape (AnchorShape.TRIANGLE_FILLED);
    return widget;
}
 
Example 11
Source File: QueryBuilderGraphFrame.java    From netbeans with Apache License 2.0 4 votes vote down vote up
void insertGraphEdge(QBNodeComponent node1, QBNodeComponent node2,
		 String fullTableName1, String fullTableName2,
		 String tableSpec1, String tableSpec2,
		 String colName1, String colName2,
		 String[] fk, String joinType)
   {
System.out.println("Entering insertGraphEdge, tableSpec1: " + tableSpec1 + "  tableSpec2: " + tableSpec2);

       // Create the node object for the edge (for the Property Sheet)
       AbstractNode an;
       if (colName1==null) {
           // We are adding the edge interactively, based on the FK
           // Use the columns specified in the FK
           if (fullTableName1.equalsIgnoreCase(fk[0]))
               an = createPropertyNode(tableSpec1, fk[1], tableSpec2, fk[3], joinType, _queryBuilder); // NOI18N
           else
               an = createPropertyNode(tableSpec2, fk[1], tableSpec1, fk[3], joinType, _queryBuilder); // NOI18N
       } else {
           // Adding an edge from the model, based on join condition
           an = createPropertyNode(tableSpec1, colName1, tableSpec2, colName2, joinType, _queryBuilder); // NOI18N
       }

// Now, add an edge to the graph scene, containing the AbstractNode
Widget widget = _scene.addEdge(an);
_scene.setEdgeSource (an, node1);
_scene.setEdgeTarget (an, node2);

ConnectionWidget connWidget = (ConnectionWidget)widget;

// widget.getActions().addAction(ActionFactory.createSelectAction(new ObjectSelectProvider()));
connWidget.getActions().addAction(_scene.createSelectAction());

       AnchorShape triangle = AnchorShapeFactory.createTriangleAnchorShape(18, true, false, 17);
       connWidget.setStroke (new BasicStroke (1.5f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_ROUND));
       // If we have an FK, draw the appropriate arrowhead, otherwise don't do anything
       if (fk!=null) {
           if (fk[0].equalsIgnoreCase(fullTableName1)) {
	// ((ConnectionWidget)widget).setTargetAnchorShape (AnchorShape.TRIANGLE_FILLED);
	connWidget.setTargetAnchorShape (triangle);
           } else {
	connWidget.setSourceAnchorShape (triangle);
           }
       }
       
       // Mark the edge as activated (updates property sheet)
       _queryBuilder.setActivatedNodes(new Node[] {an});
       
_scene.validate();
   }
 
Example 12
Source File: ModelGraphScene.java    From opensim-gui with Apache License 2.0 4 votes vote down vote up
protected Widget attachEdgeWidget (String edge) {
    ConnectionWidget connection = new ConnectionWidget (this);
    connection.setTargetAnchorShape (AnchorShape.TRIANGLE_FILLED);
    connectionLayer.addChild (connection);
    return connection;
}