Package com.evelopers.unimod.glayout.graph

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


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

        while (lie.hasNext()) {
            SimpleEdge edge = (SimpleEdge) lie.next();
            GraphHelper.checkAndReverse(edge, stn);
        }
    }
View Full Code Here


        res.add(e);

        SimpleVertex curr = e.getTarget();

        while (curr != f.getDest()) {
            SimpleEdge tmp = (SimpleEdge) curr.getEdgesRelativeOutgoing(f)
                                              .get(0);
            res.add(tmp);
            curr = tmp.getTarget();
        }

        return res;
    }
View Full Code Here

    private static Chain getTowardsPathUnOri(Face f, SimpleEdge e, SimpleVertex source,
                                             SimpleVertex target) {
        Chain res = new Chain(f.getGraph());
        res.addEdge(e);

        SimpleEdge curre = e;
        res.addVertex(source);

        SimpleVertex curr = e.getAnother(source);
        res.addVertex(curr);

        while (curr != target) {
            SimpleEdge tmp;

            if (curr.getEdgesRelative(f)
                        .get(0) == curre) {
                tmp = (SimpleEdge) curr.getEdgesRelative(f)
                                       .get(1);
            } else {
                tmp = (SimpleEdge) curr.getEdgesRelative(f)
                                       .get(0);
            }

            res.addEdge(tmp);
            curr = tmp.getAnother(curr);
            res.addVertex(curr);
            curre = tmp;
        }

        return res;
View Full Code Here

            ListIterator li2     = element.getEdgesRelative(f)
                                          .listIterator();
            int count = 0;

            while (li2.hasNext()) {
                SimpleEdge ed = (SimpleEdge) li2.next();

                if (ed.getSource() == element) {
                    count++;
                } else {
                    count--;
                }
            }
View Full Code Here

    public static SimpleEdge getFirstVerticalEdge(SimpleVertex v, SimpleGraph sg) {
        ListIterator li = v.getEdgesRelative(sg)
                           .listIterator();

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

            if (edge.isVertical()) {
                return edge;
            }
        }

        return null;
View Full Code Here

        List edges      = new ArrayList();
        ListIterator li = sg.getEdges()
                            .listIterator();

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

            if ((vertical) && (edge.getSource()
                                       .getOrthX() == corner.getOrthX())
                    && (edge.isVertical())) {
                edges.add(edge);
            }

            if ((!vertical) && (edge.getSource()
                                        .getOrthY() == corner.getOrthY())
                    && (edge.isHorizontal())) {
                edges.add(edge);
            }
        }

        Collections.sort(edges,
View Full Code Here

      }
    }
    for (Object obj : graph.getChildEdges(parent)) {
      if (obj instanceof mxCell) {
        mxCell cell = (mxCell) obj;
        SimpleEdge se = new SimpleEdge(vertexes.get(cell.getSource()), vertexes.get(cell.getTarget()));
        se.setProperty("id", cell.getId());
        sg.addEdge(se);
      }
    }
    MultiLayerLayouter.layout(sg);
   
        mxCell someCell = ((mxCell)vertexes.keySet().toArray()[0]);
        double xscale = someCell.getGeometry().getWidth() / (vertexes.get(someCell).getVertexext().getWidth() - .5);
        double yscale = someCell.getGeometry().getHeight() / (vertexes.get(someCell).getVertexext().getHeight() - .5);
    for (Object obj : sg.getVertices()) {
      if (obj instanceof SimpleVertex) {
        SimpleVertex sv = (SimpleVertex) obj;
       
        for (mxCell vertex: vertexes.keySet()) {
          if (vertex.getId().equals(sv.getProperty("id"))) {
            VertexExt ve =  sv.getVertexext();
            mxGeometry vertexGeometry = vertex.getGeometry();
            super.setVertexLocation(vertex, ve.getLeftTop().getX()*xscale, ve.getLeftTop().getY()*yscale);
          }
        }
               
      }
    }
    for (Object obj : sg.getEdges()) {
      if (obj instanceof SimpleEdge) {
        SimpleEdge se = (SimpleEdge) obj;
        for (Object e : graph.getChildEdges(parent)) {
          if (e instanceof mxCell) {
            mxCell edge = (mxCell) e;
            if (edge.getId().equals(se.getProperty("id"))) {
              List<mxPoint> jgraphpoints = new ArrayList<mxPoint>();
              jgraphpoints.add(new mxPoint(edge.getSource().getGeometry().getCenterX(),
                  edge.getTarget().getGeometry().getCenterY()));
              super.setEdgePoints(edge, jgraphpoints);
              super.setOrthogonalEdge(edge, true);
View Full Code Here

        public EdgeComparator(boolean vertical) {
            this.vertical = vertical;
        }

        public int compare(Object o1, Object o2) {
            SimpleEdge e1 = (SimpleEdge) o1;
            SimpleEdge e2 = (SimpleEdge) o2;

            if (vertical) {
                // bottom first
                if (GeometricHelper.getTopVetrtex(e1)
                                       .getOrthY() < GeometricHelper.getTopVetrtex(e2)
View Full Code Here

//        SimpleEdge eres = null;
        ListIterator li = sg.getEdges()
                            .listIterator();

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

            if (fitsIndependently(corner,
                                      xpreferred,
                                      edge.getSource(),
                                      res)) {
                res = edge.getSource();
            }
        }

        return res;
    }
View Full Code Here

        IOrthItem res   = new BendPoint(x, y);
        ListIterator li = sg.getEdges()
                            .listIterator();

        while (li.hasNext()) {
            SimpleEdge edge = (SimpleEdge) li.next();
            fitsAbstractly(corner,
                           edge.getSource(),
                           res);
        }

        return res;
    }
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.