Package org.eclipse.draw2d.graph

Examples of org.eclipse.draw2d.graph.DirectedGraphLayout


    private void execute() {
        editor.doSave(null);
        Map<Long, Node> mapping = new HashMap<Long, Node>();
        DirectedGraph graph = createDirectedGraph(mapping);
        DirectedGraphLayout layout = new DirectedGraphLayout();
        layout.visit(graph);
        for (Map.Entry<Long, Node> entry: mapping.entrySet()) {
            Node node = entry.getValue();
            DefaultElementWrapper elementWrapper = (DefaultElementWrapper)
                ((ProcessWrapper) ((GenericModelEditor) editor).getModel()).getElement(entry.getKey() + "");
            elementWrapper.setConstraint(new Rectangle(node.x, node.y, node.width, node.height));
View Full Code Here


    private void execute() {
        editor.doSave(null);
        Map<Long, Node> mapping = new HashMap<Long, Node>();
        DirectedGraph graph = createDirectedGraph(mapping);
        DirectedGraphLayout layout = new DirectedGraphLayout();
        layout.visit(graph);
        for (Map.Entry<Long, Node> entry: mapping.entrySet()) {
            Node node = entry.getValue();
            DefaultElementWrapper elementWrapper = (DefaultElementWrapper)
                ((ProcessWrapper) ((GenericModelEditor) editor).getModel()).getElement(entry.getKey() + "");
            elementWrapper.setConstraint(new Rectangle(node.x, node.y, node.width, node.height));
View Full Code Here

        partToNodesMap = new HashMap<AbstractGraphicalEditPart, Object>();
        graph = new DirectedGraph();
        addNodes(diagram);
        if (graph.nodes.size() > 0) {
            addEdges(diagram);
            new DirectedGraphLayout().visit(graph);
            applyResults(diagram);
        }
    }
View Full Code Here

      Node source = (Node) mapping.get(relationship.getSource());
      Node dest = (Node) mapping.get(relationship.getDestination());
      Edge edge = new Edge(relationship, source, dest);
      graph.edges.add(edge);
    }
    DirectedGraphLayout directedGraphLayout = new ExtendedDirectedGraphLayout();
    directedGraphLayout.visit(graph);

    for (Iterator iterator = graph.nodes.iterator(); iterator.hasNext();) {
      Node node = (Node) iterator.next();
      InternalNode internalNode = (InternalNode) node.data;
      internalNode.setInternalLocation(node.x, node.y);
View Full Code Here

    private void execute() {
        editor.doSave(null);
        Map<Long, Node> mapping = new HashMap<Long, Node>();
        DirectedGraph graph = createDirectedGraph(mapping);
        DirectedGraphLayout layout = new DirectedGraphLayout();
        layout.visit(graph);
        for (Map.Entry<Long, Node> entry: mapping.entrySet()) {
            Node node = entry.getValue();
            DefaultElementWrapper elementWrapper = (DefaultElementWrapper)
                ((ProcessWrapper) ((GenericModelEditor) editor).getModel()).getElement(entry.getKey() + "");
            elementWrapper.setConstraint(new Rectangle(node.x, node.y, node.width, node.height));
View Full Code Here

        partToNodesMap = new HashMap();
        graph = new DirectedGraph();
        addNodes(diagram);
        if (graph.nodes.size() > 0) {
            addEdges(diagram);
            new DirectedGraphLayout().visit(graph);
            applyResults(diagram);
        }
    }
View Full Code Here

    private void execute() {
        editor.doSave(null);
        Map<Long, Node> mapping = new HashMap<Long, Node>();
        DirectedGraph graph = createDirectedGraph(mapping);
        DirectedGraphLayout layout = new DirectedGraphLayout();
        layout.visit(graph);
        for (Map.Entry<Long, Node> entry: mapping.entrySet()) {
            Node node = entry.getValue();
            DefaultElementWrapper elementWrapper = (DefaultElementWrapper)
                ((ProcessWrapper) ((GenericModelEditor) editor).getModel()).getElement(entry.getKey() + "");
            elementWrapper.setConstraint(new Rectangle(node.x, node.y, node.width, node.height));
View Full Code Here

      Node source = (Node) mapping.get(relationship.getSource());
      Node dest = (Node) mapping.get(relationship.getDestination());
      Edge edge = new Edge(relationship, source, dest);
      graph.edges.add(edge);
    }
    DirectedGraphLayout directedGraphLayout = new DirectedGraphLayout();
    directedGraphLayout.visit(graph);

    for (Iterator iterator = graph.nodes.iterator(); iterator.hasNext();) {
      Node node = (Node) iterator.next();
      InternalNode internalNode = (InternalNode) node.data;
      // For horizontal layout transpose the x and y coordinates
View Full Code Here

      }
    }

    // Calculate position of all beans in graph
    try {
      new DirectedGraphLayout().visit(graph);

      // Re-invert edges inverted while breaking cycles; this only seems to be required on earlier GEF versions
      if (!SpringCoreUtils.isEclipseSameOrNewer(3, 6)) {
        for (int i = 0; i < graph.edges.size(); i++) {
          Edge e = graph.edges.getEdge(i);
View Full Code Here

      if (source != null && dest != null) {
        Edge edge = new Edge(relationship, source, dest);
        graph.edges.add(edge);
      }
    }
    DirectedGraphLayout directedGraphLayout = new DirectedGraphLayout();
    directedGraphLayout.visit(graph);

    for (Iterator iterator = graph.nodes.iterator(); iterator.hasNext();) {
      Node node = (Node) iterator.next();
      InternalNode internalNode = (InternalNode) node.data;
      // For horizontal layout transpose the x and y coordinates
View Full Code Here

TOP

Related Classes of org.eclipse.draw2d.graph.DirectedGraphLayout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.