Examples of SimpleEdge


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

    private SimpleEdge getAnotherEdge(SimpleVertex sv, SimpleEdge se) {
        ListIterator li = sv.getEdgesRelative(f)
                            .listIterator();

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

            if (!e.equals(se)) {
                return e;
            }
        }

        return null;
View Full Code Here

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

    protected void orientOnChain(GContainer ac, SimpleVertex source, SimpleVertex target,
                                 Object tocheck, Object key) {
        SimpleVertex curr = source;

        // another edge
        SimpleEdge curre = null;

        while (curr != target) {
            // curr is changing
            List edges      = curr.getEdgesRelative(ac);
            ListIterator li = edges.listIterator();

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

                if (element != curre) {
                    if ((tocheck == null) || (element.getProperty(tocheck) == null)) {
                        if (element.getTarget() == curr) {
                            element.reverse();
                        }
                    }

                    if (tocheck != null) {
                        element.setProperty(tocheck, key);
                    }

                    curr      = element.getAnother(curr);
                    curre     = element;

                    break;
                }
            }
View Full Code Here

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

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

        while (li2.hasNext()) {
            SimpleEdge element = (SimpleEdge) li2.next();
            element.setVisX(asd.getCorrespondingVertex(element.getLeft()).getTopnum());
            element.setVisYB(element.getOrig().getTopnum());
            element.setVisYT(element.getDest().getTopnum());
        }
    }
View Full Code Here

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

    private void convertBendpoints() {
        SimpleEdge[] edges = (SimpleEdge[]) sg.getEdges()
                                              .toArray(new SimpleEdge[0]);

        for (int i = 0; i < edges.length; i++) {
            SimpleEdge edge = edges[i];

            // will update faces
            GraphsContainer vgc =
                new GraphsContainer(sg,
                                    edge.getLeft(),
                                    edge.getRight());
            BendPoint[] bps =
                (BendPoint[]) edge.getBendPoints()
                                  .toArray(new BendPoint[0]);
            SimpleVertex currsource = edge.getSource();

            for (int j = 0; j < bps.length; j++) {
                SimpleVertex v = new SimpleVertex();
                v.setProperty(FICTIVE_KEY, edge);

                // to set the bendpoints order
                v.setProperty(FICTIVENUMBER_KEY,
                              new Integer(j));
                v.setOrthX(bps[j].getOrthX());
                v.setOrthY(bps[j].getOrthY());
                vgc.addVertex(v);

                SimpleEdge e = new SimpleEdge(currsource, v);
                e.setProperty(FICTIVE_KEY, FICTIVE_VALUE);

                /* thre is really no need to set left and right properties
                 * 'cause the HashMap link is to edge, and
                 * we are going to work only with it.
                 */
                vgc.addEdge(e);
                currsource = v;
            }

            if (bps.length > 0) {
                SimpleEdge e = new SimpleEdge(currsource,
                                              edge.getTarget());
                e.setProperty(FICTIVE_KEY, FICTIVE_VALUE);
                vgc.addEdge(e);
                vgc.removeEdge(edge);
            }
        }
    }
View Full Code Here

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

        IOrthItem corner = GeometricHelper.getAbstractCorner(sg, c);
        List edges       =
            CompactionHelper.getInstance()
                            .getEdgesSorted(sg, vertical, corner);
        ListIterator li = edges.listIterator();
        SimpleEdge prev = (SimpleEdge) li.next();

        while (li.hasNext()) {
            SimpleEdge next = (SimpleEdge) li.next();
            boolean add     = false;
            SimpleVertex v1 = null;
            SimpleVertex v2 = null;

            if (vertical) {
                if (GeometricHelper.getBottomVetrtex(prev)
                                       .getOrthY() < GeometricHelper.getTopVetrtex(next)
                                                                        .getOrthY()) {
                    v1      = GeometricHelper.getBottomVetrtex(prev);
                    v2      = GeometricHelper.getTopVetrtex(next);
                    add     = true;
                }
            } else {
                if (GeometricHelper.getRightVetrtex(prev)
                                       .getOrthX() < GeometricHelper.getLeftVetrtex(next)
                                                                        .getOrthX()) {
                    v1      = GeometricHelper.getRightVetrtex(prev);
                    v2      = GeometricHelper.getLeftVetrtex(next);
                    add     = true;
                }
            }

            if (add) {
                SimpleEdge e = new SimpleEdge(v1, v2);
                e.setProperty(FICTIVE_KEY, FICTIVE_VALUE);

                GraphsContainer vgc = proceedBridge(prev.getAnother(v1),
                                                    v1,
                                                    v2);
                vgc.addEdge(e);
View Full Code Here

Examples of edu.ucla.sspace.graph.SimpleEdge

            if (arr.length < 2) {
                throw new IOException("Missing vertex on line " + lineNo);
            }
            int v1 = vertexIndexer.index(arr[0]);
            int v2 = vertexIndexer.index(arr[1]);
            g.add(new SimpleEdge(v1, v2));
            if (lineNo % 100000 == 0)
                verbose(LOGGER, "Read %d lines from %s", lineNo, f);
        }
        verbose(LOGGER, "Read undirected graph with %d vertices and %d edges",
                g.order(), g.size());
View Full Code Here

Examples of edu.ucla.sspace.graph.SimpleEdge

                throw new IOException("Missing edge weight on line " + lineNo);
            int v1 = vertexIndexer.index(arr[0]);
            int v2 = vertexIndexer.index(arr[1]);
            double weight = Double.parseDouble(arr[2]);
            if (weight >= minWeight)
                g.add(new SimpleEdge(v1, v2));

            if (lineNo % 100000 == 0)
                veryVerbose(LOGGER, "Read %d lines from %s", lineNo, f);
        }
        verbose(LOGGER, "Read directed graph with %d vertices and %d edges",
View Full Code Here

Examples of org.jamesii.core.util.graph.SimpleEdge

  public void setUp() {
    setUpBasicTree(simpleTree);
    setUpBasicTree(similarSimpleTree);

    nonSimilarSimpleTree1.setTreeRoot(0);
    nonSimilarSimpleTree1.addEdge(new SimpleEdge(1, 0));
    nonSimilarSimpleTree1.addEdge(new SimpleEdge(2, 1));

    nonSimilarSimpleTree2.setTreeRoot(0);
    nonSimilarSimpleTree2.addVertex(2);
    nonSimilarSimpleTree2.addEdge(new SimpleEdge(2, 0));
    nonSimilarSimpleTree2.addVertex(3);
    nonSimilarSimpleTree2.addEdge(new SimpleEdge(3, 0));
  }
View Full Code Here

Examples of org.jamesii.core.util.graph.SimpleEdge

   * @param tree
   *          the new up basic tree
   */
  protected void setUpBasicTree(SimpleTree tree) {
    tree.setTreeRoot(0);
    tree.addEdge(new SimpleEdge(1, 0));
    tree.addEdge(new SimpleEdge(2, 0));
  }
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.SimpleEdge

        Vertex a = new IntersectionVertex(g, "a", 5, 5);
        Vertex b = new IntersectionVertex(g, "b", 6, 5);
        Vertex c = new IntersectionVertex(g, "c", 7, 5);
        Vertex d = new IntersectionVertex(g, "d", 8, 5);
        // vary weights so edges are not considered equal
        Edge ab = new SimpleEdge(a, b, 1, 1);
        Edge bc1 = new SimpleEdge(b, c, 1, 1);
        Edge bc2 = new SimpleEdge(b, c, 2, 2);
        Edge bc3 = new SimpleEdge(b, c, 3, 3);
        Edge cd1 = new SimpleEdge(c, d, 1, 1);
        Edge cd2 = new SimpleEdge(c, d, 2, 2);
        Edge cd3 = new SimpleEdge(c, d, 3, 3);
        OverlayGraph og = new OverlayGraph(g);
        assertEquals(g.countVertices(), og.countVertices());
        assertEquals(g.countEdges(), og.countEdges());
        for (Vertex v : g.getVertices()) {
            for (Edge e : v.getOutgoing()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.