Package com.evelopers.unimod.glayout.graph.containers

Examples of com.evelopers.unimod.glayout.graph.containers.Face


    public boolean validate() {
        ListIterator li = gd.getFaces()
                            .listIterator();

        while (li.hasNext()) {
            Face face = (Face) li.next();

            if (FaceHelper.getInstance(gd, sg)
                              .isCycle(face)) {
                return false;
            }
View Full Code Here


    private void countFacesLROD() {
        ListIterator li = gd.getFaces()
                            .listIterator();

        while (li.hasNext()) {
            Face element = (Face) li.next();
            element.getOdcontainer()
                   .setLeft(element);
            element.getOdcontainer()
                   .setRight(element);
            element.getOdcontainer()
                   .setOrig(InvestigatorHelper.countOrig(element));
            element.getOdcontainer()
                   .setDest(InvestigatorHelper.countDest(element));
        }
    }
View Full Code Here

            workingedges.addLast(element);
        }

        while (workingedges.size() > 0) {
            SimpleEdge working = (SimpleEdge) workingedges.removeFirst();
            Face eface         = InvestigatorHelper.getFaceForEdge(gd, working, this);

            if (eface != null) {
                eface.setProperty(this, TEMP_VALUE);

                List[] paths = InvestigatorHelper.twoPaths(eface);

                if (paths.length == 1) {
                    InvestigatorHelper.setRightForList(paths[0],
View Full Code Here

        ListIterator li = gd.getFaces()
                            .listIterator();
        int count = 0;

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

            if ((element.getVertices()
                            .indexOf(sv) != -1) && (element.getDest() != sv)
                    && (element.getOrig() != sv)) {
                res[count] = element;
                count++;
            }
        }
View Full Code Here

        ListIterator lif = gd.getFaces()
                             .listIterator();

        while (lif.hasNext()) {
            Face element    = (Face) lif.next();
            SimpleVertex sv = new SimpleVertex();
            associated.addVertex(sv);
            element.setProperty(this, sv);
        }

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

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

            if (!((element.getSource() == gd.getSource())
                    && (element.getTarget() == gd.getTarget()))) {
                SimpleVertex src = element.getLeft()
                                          .getVertexProperty(this);
                SimpleVertex dst = element.getRight()
                                          .getVertexProperty(this);
                SimpleEdge se = new SimpleEdge(src, dst);
                associated.addEdge(se);
            }
        }
View Full Code Here

        ListIterator lif = gd.getFaces()
                             .listIterator();

        while (lif.hasNext()) {
            Face element    = (Face) lif.next();
            SimpleVertex sv = new SimpleVertex();
            associated.addVertex(sv);
            element.setProperty(this, sv);
        }

        ListIterator lip = paths.listIterator();

        while (lip.hasNext()) {
            Path path       = (Path) lip.next();
            SimpleVertex sv = new SimpleVertex();
            associated.addVertex(sv);
            path.setProperty(this, sv);
        }

        lip = paths.listIterator();

        while (lip.hasNext()) {
            Path path        = (Path) lip.next();
            ListIterator lic = path.getEdges()
                                   .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

     */
    private BigVertex(SimpleGraph sg, GraphData gd, SimpleVertex v) {
        vertices = new ArrayList();

        // new inner face
        Face f = new Face(sg);

        // to match old edges with fictivae vertices
        HashMap hm       = new HashMap();
        ListIterator lie = v.getEdges()
                            .listIterator();

        while (lie.hasNext()) {
            SimpleEdge edge = (SimpleEdge) lie.next();
            SimpleVertex sv = new SimpleVertex();
            hm.put(edge, sv);
            sv.setProperty(BIGVERTEX_KEY, this);
            sg.addVertex(sv);
            f.addVertex(sv);
            vertices.add(sv);
        }

        // faces incident to vertex
        List faces = FaceHelper.getInstance(gd, sg)
                               .getFacesForVertex(v);
        ListIterator lif = faces.listIterator();

        while (lif.hasNext()) {
            Face face           = (Face) lif.next();
            SimpleEdge[] fedges =
                FaceHelper.getInstance(gd, sg)
                          .getVEdgesForFace(face, v);
            SimpleVertex from = (SimpleVertex) hm.get(fedges[0]);
            SimpleVertex to   = (SimpleVertex) hm.get(fedges[1]);
            SimpleEdge se     = new SimpleEdge(from, to);
            se.setProperty(BIGVERTEX_KEY, this);
            sg.addEdge(se);
            f.addEdge(se);
            face.addEdge(se);
            face.addVertex(from);
            face.addVertex(to);
            face.removeVertex(v);
        }

        SimpleEdge[] edges = (SimpleEdge[]) v.getEdges()
                                             .toArray(new SimpleEdge[0]);

View Full Code Here

    public static Face getFaceForEdge(GraphData gd, SimpleEdge e, Object key) {
        ListIterator li = gd.getFaces()
                            .listIterator();

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

            if ((element.getEdges()
                            .indexOf(e) != -1) && (element.getProperty(key) == null)) {
                return element;
            }
        }

        return null;
View Full Code Here

     */
    protected void initFace(Face outer) {
        // right face is small
        Face[] outerfaces = new Face[2];
        outerfaces[0]     = (Face) outer.instanceCopy();
        outerfaces[1]     = new Face(outer.getGraph());

        SimpleVertex src  = (SimpleVertex) outer.getVertices()
                                                .get(0);
        for1              = (SimpleEdge) src.getEdgesRelative(outer)
                                            .get(0);
View Full Code Here

            workingedges.addLast(edge);
        }

        while (workingedges.size() > 0) {
            SimpleEdge working = (SimpleEdge) workingedges.removeFirst();
            Face eface         = InvestigatorHelper.getFaceForEdge(gd, working, this);

            if (eface != null) {
                eface.setProperty(this, TEMP_VALUE);

                Chain[] paths;

                if (eface == gd.getOuterRight()) {
                    paths =
View Full Code Here

TOP

Related Classes of com.evelopers.unimod.glayout.graph.containers.Face

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.