protected ItemPositionMap makeCircularLayout( IBoundedItem currentItem, List<IBoundedItem> neighbours) { Coord2d center = currentItem.getAbsolutePosition(); CircleLayoutTable layout = new CircleLayoutTable(neighbours, center, false, 200); layout.goAlgo(); return layout.getPositions(); }
protected ItemPositionMap makeRectangleLayout( IBoundedItem currentItem, List<IBoundedItem> neighbours) { Coord2d center = currentItem.getAbsolutePosition(); RectangleLayoutTable layout = new RectangleLayoutTable(neighbours, center, 4000, 4000); layout.goAlgo(); return layout.getPositions(); }
@Override public void bring(IBoundedItem item) { setup(item); // center view to item IView view = display.getView(); ViewPointAnimation va = new ViewPointAnimation( view, Pt.cloneAsCoord2d(view.getCenter()), item.getAbsolutePosition(), 300); // Rectangle2D layoutBounds = // model.getRectangleBounds().cloneAsRectangle2D(); // System.out.println(view.getLayoutScale(layoutBounds)); // animate transition PositionMapTransition t = new PositionMapTransition(); IAnimation anim = t.transition(originalPositionMap, circularPositionMap, DURATION / 2); animator.push(anim); animator.push(va); }