org.eclipse.draw2d.graph.Node Java Examples

The following examples show how to use org.eclipse.draw2d.graph.Node. 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: CFGNodeEditPart.java    From JAADAS with GNU General Public License v3.0 5 votes vote down vote up
public void contributeNodesToGraph(DirectedGraph graph, HashMap map){
	Node node = new Node(this);
	node.width = getFigure().getBounds().width;//getNode().getWidth();
	int height = 22;
	if (((CFGNode)getModel()).getBefore() != null){
		height += ((CFGNode)getModel()).getBefore().getChildren().size() * 22;
	}
	if (((CFGNode)getModel()).getAfter() != null){
		height += ((CFGNode)getModel()).getAfter().getChildren().size() * 22;
	}
	node.height = height;//getFigure().getBounds().height;
	graph.nodes.add(node);
	map.put(this, node);
}
 
Example #2
Source File: CFGNodeEditPart.java    From JAADAS with GNU General Public License v3.0 5 votes vote down vote up
public void applyGraphResults(DirectedGraph graph, HashMap map){
	Node node = (Node)map.get(this);
	((CFGNodeFigure)getFigure()).setBounds(new Rectangle(node.x, node.y, node.width, node.height));//getFigure().getBounds().height));//getFigure().getBounds().height));
	List outgoing = getSourceConnections();
	for (int i = 0; i < outgoing.size(); i++){
		CFGEdgeEditPart edge = (CFGEdgeEditPart)outgoing.get(i);
		edge.applyGraphResults(graph, map);
	}

}