Package com.evelopers.unimod.glayout.graph

Examples of com.evelopers.unimod.glayout.graph.SimpleEdge


    private void createEdges() {
        ListIterator li = sg.getEdges()
                            .listIterator();

        while (li.hasNext()) {
            SimpleEdge edge1 = (SimpleEdge) li.next();
            SimpleVertex src = null;
            SimpleVertex dst = null;
            boolean todo     = false;

            if (hor) {
                if (edge1.isHorizontal()) {
                    src      = GeometricHelper.getMinHorizontal(edge1);
                    dst      = edge1.getAnother(src);
                    todo     = true;
                }
            } else {
                if (edge1.isVertical()) {
                    src      = GeometricHelper.getMinVertical(edge1);
                    dst      = edge1.getAnother(src);
                    todo     = true;
                }
            }

            if (todo) {
                SimpleVertex mainsrc = src.getVertexProperty(NGRAPH_KEY);
                SimpleVertex maindst = dst.getVertexProperty(NGRAPH_KEY);
                SimpleEdge newedge   = new SimpleEdge(mainsrc, maindst);
                ngraph.addEdge(newedge);
            }
        }
    }
View Full Code Here


                                   .listIterator();
            List lfaces = new ArrayList();
            List rfaces = new ArrayList();

            while (lic.hasNext()) {
                SimpleEdge edge = (SimpleEdge) lic.next();

                if (lfaces.indexOf(edge.getLeft()) == -1) {
                    lfaces.add(edge.getLeft());
                }

                if (rfaces.indexOf(edge.getRight()) == -1) {
                    rfaces.add(edge.getRight());
                }
            }

            Iterator itl = lfaces.iterator();

            while (itl.hasNext()) {
                Face lface       = (Face) itl.next();
                SimpleVertex src = lface.getVertexProperty(this);
                SimpleVertex dst = path.getVertexProperty(this);
                SimpleEdge se    = new SimpleEdge(src, dst);
                associated.addEdge(se);
            }

            Iterator itr = rfaces.iterator();

            while (itr.hasNext()) {
                Face rface       = (Face) itr.next();
                SimpleVertex src = path.getVertexProperty(this);
                SimpleVertex dst = rface.getVertexProperty(this);
                SimpleEdge se    = new SimpleEdge(src, dst);
                associated.addEdge(se);
            }
        }
    }
View Full Code Here

        ListIterator lie = sg.getEdges()
                             .listIterator();

        while (lie.hasNext()) {
            SimpleEdge edge = (SimpleEdge) lie.next();
            GraphHelper.checkAndReverse(edge, st_list);
        }

        ListIterator li = st_list.listIterator();
        int i           = 0;
View Full Code Here

        ListIterator li = v.getEdges()
                           .listIterator();

        while (li.hasNext()) {
            SimpleEdge e   = (SimpleEdge) li.next();
            SimpleVertex w = e.getAnother(v);

            if (((Integer) dfsnum.get(w)).intValue() == 0) {
                tree_in.put(w, e);
                st_dfs(w, count, dfsnum, lownum, tree_in, low_out);
View Full Code Here

    }

    private void findpath(SimpleVertex w, HashMap used_node, HashMap used_edge,
                          HashMap pred_edge, LinkedList path) {
        while (!((Boolean) used_node.get(w)).booleanValue()) {
            SimpleEdge x = (SimpleEdge) pred_edge.get(w);
            path.addLast(w);
            used_node.put(w,
                          new Boolean(true));
            used_edge.put(x,
                          new Boolean(true));
            w = x.getAnother(w);
        }
    }
View Full Code Here

            ListIterator lie = top.getEdges()
                                  .listIterator();

            while (lie.hasNext()) {
                SimpleEdge e = (SimpleEdge) lie.next();

                if (((Boolean) used_edge.get(e)).booleanValue()) {
                    continue;
                }

                used_edge.put(e,
                              new Boolean(true));

                SimpleVertex w = e.getAnother(v);
                LinkedList p   = new LinkedList();

                if (tree_in.get(w) == e) {
                    findpath(w, used_node, used_edge, low_out, p);
                } else {
View Full Code Here

            Path path        = (Path) lip.next();
            ListIterator lie = path.getEdges()
                                   .listIterator();

            while (lie.hasNext()) {
                SimpleEdge edge = (SimpleEdge) lie.next();
                edge.setProperty(this, this);
            }
        }

        // adds one-edge paths
        ListIterator lie = sg.getEdges()
                             .listIterator();

        while (lie.hasNext()) {
            SimpleEdge edge = (SimpleEdge) lie.next();

            if (edge.getProperty(this) == null) {
                Path p = new Path(sg);
                p.addVertex(edge.getSource());
                p.addVertex(edge.getTarget());
                p.addEdge(edge);
                paths.add(p);
            }
        }
View Full Code Here

        ListIterator li = sg.getVertices()
                            .listIterator();

        while (li.hasNext()) {
            SimpleVertex element = (SimpleVertex) li.next();
            SimpleEdge e1        = null;
            SimpleEdge e2        = null;

            if ((!element.equals(gd.getSource())) && (!element.equals(gd.getTarget()))) {
                if (element.getEdgesIncoming()
                               .size() == 2) {
                    e1     = getEdgeForFace(element.getLeft(),
                                            element.getEdgesIncoming());
                    e2 = getEdgeForFace(element.getRight(),
                                        element.getEdgesOutgoing());
                } else {
                    e1     = GraphHelper.getInstance()
                                        .getMedianEdge13(element,
                                                         element.getEdgesIncoming());
                    e2 = GraphHelper.getInstance()
                                    .getMedianEdge13(element,
                                                     element.getEdgesOutgoing());
                }

                Path p = new Path(sg);
                p.addVertex(element);
                p.addVertex(e1.getAnother(element));
                p.addVertex(e2.getAnother(element));
                p.addEdge(e1);
                p.addEdge(e2);
                element.setProperty(VisibilityFactory.PATH_KEY, p);

                // property to be removed
View Full Code Here

     */
    private SimpleEdge getEdgeForFace(Face f, List edges) {
        ListIterator li = edges.listIterator();

        while (li.hasNext()) {
            SimpleEdge element = (SimpleEdge) li.next();

            if (f.getEdges()
                     .indexOf(element) != -1) {
                return element;
            }
View Full Code Here

                                   .listIterator();
            double tn = asd.getCorrespondingVertex(path)
                           .getTopnum();

            while (lie.hasNext()) {
                SimpleEdge edge = (SimpleEdge) lie.next();
                edge.setVisX(tn);

                // adding 0.5 to compensate
                edge.setVisYB(edge.getOrig().getTopnum() + 0.5);
                edge.setVisYT(edge.getDest().getTopnum() + 0.5);
            }

            liv = path.getVertices()
                      .listIterator();
View Full Code Here

TOP

Related Classes of com.evelopers.unimod.glayout.graph.SimpleEdge

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.