Java 类org.eclipse.draw2d.graph.DirectedGraph 实例源码

项目:JAADAS    文件:CFGNodeEditPart.java   
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);
}
项目:JAADAS    文件:CFGNodeEditPart.java   
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);
    }
}
项目:JAADAS    文件:CFGNodeEditPart.java   
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);
    }

}
项目:PDFReporter-Studio    文件:ClusterEdgeCreator.java   
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;
    }
}
项目:PDFReporter-Studio    文件:DummyEdgeCreator.java   
/**
 * @param graph
 */
private void init(DirectedGraph graph) {
    this.graph = graph;
    this.nodeList = graph.nodes;
    this.edgeList = graph.edges;
    edgesAdded = new ArrayList<Edge>();
}
项目:PDFReporter-Studio    文件:DirectedGraphLayoutVisitor.java   
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);
    }
}
项目:jive    文件:ContourGraphFactory.java   
public HierarchicalLayout()
{
  this.contourToNode = TypeTools.newHashMap();
  this.graph = new DirectedGraph();
  this.nodeColors = TypeTools.newHashMap();
  this.nodeToPosition = TypeTools.newHashMap();
  this.staticNodes = TypeTools.newHashMap();
}
项目:jive    文件:ContourGraphFactory.java   
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();
}
项目:d-case_editor    文件:DcaseDirectedGraphLayout.java   
/**
 * 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);
    }
}
项目:PDFReporter-Studio    文件:DummyEdgeCreator.java   
/**
 * @param clean
 *          next time
 */
public void visit(DirectedGraph g) {
    cleanNextTime = true;
    init(g);
    setDummyEdges();
}
项目:d-case_editor    文件:DcaseDirectedGraph.java   
/**
 * Creates the DcaseDirectGraph and initializes it.
 * 
 * @param graph the direct graph.
 */
public DcaseDirectedGraph(DirectedGraph graph) {
    this.graph = graph;
    map.clear();
    baseNodeList.clear();
}
项目:PDFReporter-Studio    文件:NodeJoiningDirectedGraphLayout.java   
public void visit(DirectedGraph graph) {

        new DummyEdgeCreator().visit(graph);
        new ClusterEdgeCreator().visit(graph);

        super.visit(graph);
    }