Package com.evelopers.unimod.glayout.fast.extensions

Examples of com.evelopers.unimod.glayout.fast.extensions.VertexExt


      if (obj instanceof mxCell) {
        mxCell cell = (mxCell) obj;
        SimpleVertex sv = new SimpleVertex();
        int width = (int) Math.round(cell.getGeometry().getWidth());
        int height = (int) Math.round(cell.getGeometry().getHeight());
        VertexExt ve = new VertexExt(cell.getGeometry().getPoint(), width, height);
        sv.setVertexext(ve);
        sv.setProperty("id", cell.getId());
        sg.addVertex(sv);
        vertexes.put(cell, sv);
      }
    }
    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);
          }
        }
               
      }
    }
 
View Full Code Here


        int x = searchX(element);
        moveAll(sg.getVertices(),
                x,
                w);

        VertexExt ve = new VertexExt(new Point(x, y),
                                     w,
                                     h);
        element.setVertexext(ve);
    }
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

        Collections.sort(l,
                         new EdgeXComparator(element));

        int index         = l.size() / 2;
        SimpleEdge median = (SimpleEdge) l.get(index);
        VertexExt ve      = median.getAnother(element)
                                  .getVertexext();
        int x = ((int) ve.getLeftTop()
                         .getX() + ve.getWidth());

        return x;
    }
View Full Code Here

            }
        }

        int w        = (tw < Constant.getMINVW()) ? Constant.getMINVW() : tw;
        int h        = th;
        VertexExt ve = new VertexExt(new Point(0, 0),
                                     w,
                                     h);
        element.setVertexext(ve);
        currY += h;
    }
View Full Code Here

            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.fast.extensions.VertexExt

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.