Package com.evelopers.unimod.glayout.graph

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


     * st == -1 -> source
     * st == 1 -> target
     * st == 2 -> ST
     */
    private void buildEdgeComplex(SimpleEdge edge, int st) {
        SimpleVertex esource = edge.getSource();
        SimpleVertex etarget = edge.getTarget();
        BendPoint[] bparr    = new BendPoint[4];

        // made to move paths for ST edges
        BendPoint start = new BendPoint(esource.getOrthX(),
                                        esource.getOrthY());
        BendPoint finish = new BendPoint(etarget.getOrthX(),
                                         etarget.getOrthY());
        bparr[0]     = new BendPoint(esource.getOrthX(),
                                     esource.getOrthY());
        bparr[1] = SimpleOrthogonalizer.getIntersectionBendPoint(esource, edge);

        if ((st == -1) || (st == 2)) {
            bparr[0].setOrthY(bparr[0].getOrthY() - 1);
            bparr[1].setOrthY(bparr[1].getOrthY() - 1);
        }

        bparr[2]     = SimpleOrthogonalizer.getIntersectionBendPoint(etarget, edge);
        bparr[3]     = new BendPoint(etarget.getOrthX(),
                                     etarget.getOrthY());

        if ((st == 1) || (st == 2)) {
            bparr[2].setOrthY(bparr[2].getOrthY() + 1);
            bparr[3].setOrthY(bparr[3].getOrthY() + 1);
        }
View Full Code Here


    private void buildNonSTVertices() {
        ListIterator liv = sg.getVertices()
                             .listIterator();

        while (liv.hasNext()) {
            SimpleVertex vertex = (SimpleVertex) liv.next();

            if ((!vertex.equals(gd.getSource())) && (!vertex.equals(gd.getTarget()))) {
                vertex.setOrthY(vertex.getVisY());

                Path path       = (Path) vertex.getProperty(VisibilityFactory.PATH_KEY);
                SimpleEdge edge = (SimpleEdge) path.getEdges()
                                                   .get(0);
                vertex.setOrthX(edge.getVisX());
            }
        }

        sg.removePropertyAsc(VisibilityFactory.PATH_KEY);
    }
View Full Code Here

            constructV();
            constructE();
        } else if (sg.getVertices()
                         .size() == 1) {
            SimpleVertex theOnly = (SimpleVertex) sg.getVertices()
                                                    .get(0);
            makeVertex(theOnly);
            makeVEdges(theOnly);
        }
    }
View Full Code Here

        }

        ListIterator listn = stn.listIterator();

        while (listn.hasNext()) {
            SimpleVertex element = (SimpleVertex) listn.next();
            makeVertex(element);
        }

        int minus = findXMinus();
View Full Code Here

    private void constructE() {
        LinkedList stn     = (LinkedList) sg.getProperty(STN_KEY);
        ListIterator listn = stn.listIterator();

        while (listn.hasNext()) {
            SimpleVertex element = (SimpleVertex) listn.next();
            makeVEdges(element);
        }
    }
View Full Code Here

        int minx        = Integer.MAX_VALUE;
        ListIterator li = sg.getVertices()
                            .listIterator();

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

            if (element.getVertexext()
                           .getLeftTop()
                           .getX() < minx) {
                minx = (int) element.getVertexext()
                                    .getLeftTop()
                                    .getX();
            }
        }
View Full Code Here

        int maxx        = Integer.MIN_VALUE;
        ListIterator li = sg.getVertices()
                            .listIterator();

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

            if ((element.getVertexext()
                            .getLeftTop()
                            .getX() + element.getVertexext()
                                                 .getWidth()) > maxx) {
                maxx =
                    (int) element.getVertexext()
                                 .getLeftTop()
                                 .getX() + element.getVertexext()
                                                  .getWidth();
            }
        }

        return maxx;
View Full Code Here

        ListIterator li = l.listIterator();

        while (li.hasNext()) {
            SimpleEdge edge = (SimpleEdge) li.next();
            SimpleVertex v1 = edge.getAnother(element);

            SimpleGraph inner = (SimpleGraph) element.getProperty(Constant.LAYER_KEY);
            boolean inside    = false;

            if (inner != null) {
                List innerv = (List) inner.getProperty(AltMultiLayerBuilder.LOWERV_KEY);
                List innerc = inner.getVertices();

                if (innerv != null) {
                    if (innerv.contains(v1)) {
                        inside = true;
                    }
                }

                if (innerc.contains(v1)) {
                    inside = true;
                }
            }

            double dist =
                v1.getVertexext()
                  .getLeftTop()
                  .getX() - element.getVertexext()
                                   .getLeftTop()
                                   .getX();
            EdgeExt ee    = new EdgeExt();
            Anchor src    = null;
            Anchor target = null;

            if (dist < 0) {
                // v1 is src, v1.x < target.x
                src = v1.getVertexext()
                        .getTopRightmost();

                if (!inside) {
                    target = element.getVertexext()
                                    .getLeftUpmost();
                } else {
                    target = element.getVertexext()
                                    .getLeftLowmost();
                }
            } else {
                src = v1.getVertexext()
                        .getTopLeftmost();

                if (!inside) {
                    target = element.getVertexext()
                                    .getRightUpmost();
View Full Code Here

     */
    private void moveAll(List l, int x, int w) {
        ListIterator li = l.listIterator();

        while (li.hasNext()) {
            SimpleVertex element = (SimpleVertex) li.next();
            VertexExt ve         = element.getVertexext();

            if (ve != null) {
                if (ve.getLeftTop()
                          .getX() >= x) {
                    ve.move(new Point(w + 1, 0));

                    if (element.getProperty(Constant.LAYER_KEY) != null) {
                        SimpleGraph elg =
                            (SimpleGraph) element.getProperty(Constant.LAYER_KEY);
                        moveSG(elg, w + 1, 0);
                    }
                }
            }
        }
View Full Code Here

    private static void moveSG(SimpleGraph sg, int x, int y) {
        ListIterator li = sg.getVertices()
                            .listIterator();

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

            if (element.getProperty(Constant.LAYER_KEY) != null) {
                SimpleGraph elg = (SimpleGraph) element.getProperty(Constant.LAYER_KEY);
                moveSG(elg, x, y);
            }

            VertexExt ve = element.getVertexext();

            if (ve != null) {
                ve.move(new Point(x, y));
            }
        }
View Full Code Here

TOP

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

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.