コード例 #1
0
 public void layout() {
   List children = getSortChildren();
   for (int i = 0; i < children.size(); i++) {
     ComponentPart ep = (ComponentPart) children.get(i);
     Rectangle layout = GraphLayoutManager.layout(ep);
     layout = newChildLocation(ep, layout);
     applyToFigure(ep, layout);
   }
   diagram.applyToModel();
 }
コード例 #2
0
 private List getSortChildren() {
   List children = diagram.getChildren();
   // List sortChildren = new ArrayList(children);
   //
   // Collections.sort(sortChildren, new Comparator() {
   //
   // public int compare(Object o1, Object o2) {
   // ComponentPart ep1 = (ComponentPart) o1;
   // ComponentPart ep2 = (ComponentPart) o2;
   // Rectangle bound1 = ep1.getFigure().getBounds();
   // Rectangle bound2 = ep2.getFigure().getBounds();
   // Rectangle bounds1M = ep1.getComponent().getBounds();
   // Rectangle bounds2M = ep2.getComponent().getBounds();
   // Rectangle epl1 = bound1.isEmpty() ? bounds1M : bound1;
   // Rectangle epl2 = bound2.isEmpty() ? bounds2M : bound2;
   // return epl1.y - epl2.y;
   // }
   //
   // });
   return children;
 }
コード例 #3
0
 public ScreenGraphLayout(ContainerPart diagram) {
   this.diagram = diagram;
   last = diagram.getFigure().getBounds().getCopy().setSize(0, 0);
   PADDING.left = last.x + 16;
 }