本文整理汇总了Java中org.eclipse.draw2d.graph.DirectedGraph类的典型用法代码示例。如果您正苦于以下问题:Java DirectedGraph类的具体用法?Java DirectedGraph怎么用?Java DirectedGraph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DirectedGraph类属于org.eclipse.draw2d.graph包,在下文中一共展示了DirectedGraph类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contributeNodesToGraph
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
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);
}
示例2: contributeEdgesToGraph
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void contributeEdgesToGraph(DirectedGraph graph, HashMap map) {
List outgoing = getSourceConnections();
for (int i = 0; i < outgoing.size(); i++){
CFGEdgeEditPart edge = (CFGEdgeEditPart)outgoing.get(i);
edge.contributeToGraph(graph, map);
}
}
示例3: applyGraphResults
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
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);
}
}
示例4: visit
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void visit(DirectedGraph graph) {
try {
this.graph = graph;
this.nodeList = graph.nodes;
this.edgeList = graph.edges;
// iterate through all of the nodes in the node list
for (Iterator iter = nodeList.iterator(); iter.hasNext();) {
Node node = (Node) iter.next();
// check whether we have already come across this node
if (!encountered.contains(node)) {
// create a new cluster for this node
currentCluster = new Cluster();
clusters.add(currentCluster);
encountered.add(node);
currentCluster.set.add(node);
// System.out.println("Adding to NEW cluster: " + node + ", cluster: "
// + currentCluster);
// recursively add any other nodes reachable from it
int depth = INITIAL_RECURSION_DEPTH;
recursivelyAddToCluster(node, depth);
} else {
// System.out.println("Already encountered: " + node);
}
}
coalesceRemainingClusters();
// System.out.println("");
joinClusters();
} catch (RuntimeException e) {
e.printStackTrace();
throw e;
}
}
示例5: init
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
/**
* @param graph
*/
private void init(DirectedGraph graph) {
this.graph = graph;
this.nodeList = graph.nodes;
this.edgeList = graph.edges;
edgesAdded = new ArrayList<Edge>();
}
示例6: layoutDiagram
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void layoutDiagram(AbstractGraphicalEditPart diagram) {
partToNodesMap = new HashMap<AbstractGraphicalEditPart, Object>();
graph = new DirectedGraph();
graph.setDirection(PositionConstants.EAST);
addNodes(diagram);
Rectangle r = diagram.getFigure().getBounds();
if (r.x < -1000 || r.y < -1000)
return;
if (graph.nodes.size() > 0) {
addEdges(diagram);
new NodeJoiningDirectedGraphLayout().visit(graph);
applyChildrenResults(diagram);
}
}
示例7: HierarchicalLayout
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public HierarchicalLayout()
{
this.contourToNode = TypeTools.newHashMap();
this.graph = new DirectedGraph();
this.nodeColors = TypeTools.newHashMap();
this.nodeToPosition = TypeTools.newHashMap();
this.staticNodes = TypeTools.newHashMap();
}
示例8: TabularLayout
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public TabularLayout()
{
this.contourToNode = TypeTools.newHashMap();
this.graph = new DirectedGraph();
this.nodeCells = TypeTools.newHashMap();
this.nodeColors = TypeTools.newHashMap();
this.nodeColumns = TypeTools.newHashMap();
this.nodeLayers = TypeTools.newHashMap();
this.nodeSections = TypeTools.newHashMap();
}
示例9: visit
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
/**
* Lays out the given graph.
*
* @param graph the graph to layout.
* @see org.eclipse.draw2d.graph#visit(DirectedGraph)
*/
@Override
public void visit(DirectedGraph graph) {
super.visit(graph);
DcaseDirectedGraph ddg = new DcaseDirectedGraph(graph);
for (int i = 0; i < steps.size(); i++) {
DcaseGraphVisitor visitor = (DcaseGraphVisitor) steps.get(i);
visitor.visit(ddg);
}
}
示例10: visit
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
/**
* @param clean
* next time
*/
public void visit(DirectedGraph g) {
cleanNextTime = true;
init(g);
setDummyEdges();
}
示例11: DcaseDirectedGraph
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
/**
* Creates the DcaseDirectGraph and initializes it.
*
* @param graph the direct graph.
*/
public DcaseDirectedGraph(DirectedGraph graph) {
this.graph = graph;
map.clear();
baseNodeList.clear();
}
示例12: visit
import org.eclipse.draw2d.graph.DirectedGraph; //导入依赖的package包/类
public void visit(DirectedGraph graph) {
new DummyEdgeCreator().visit(graph);
new ClusterEdgeCreator().visit(graph);
super.visit(graph);
}