@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Reposition nodes. First we store the WiresBaseTreeNode together with its current position and target position transformations.clear(); for (Map.Entry<WiresBaseShape, Point2D> e : layout.entrySet()) { final Point2D origin = e.getKey().getLocation(); final Point2D destination = e.getValue(); transformations.put(e.getKey(), new Pair<Point2D, Point2D>(origin, destination)); } WiresLayoutUtilities.resizeViewPort(canvasBounds, canvasLayer.getViewport()); }
@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Reposition nodes. First we store the WiresBaseTreeNode together with its current position and target position transformations.clear(); for (Map.Entry<WiresBaseShape, Point2D> e : layout.entrySet()) { final Point2D origin = e.getKey().getLocation(); final Point2D destination = e.getValue(); transformations.put(e.getKey(), new Pair<Point2D, Point2D>(origin, destination)); } WiresLayoutUtilities.resizeViewPort(canvasBounds, canvasLayer.getViewport()); }
@Override public void onNodeDragStart(final NodeDragStartEvent nodeDragStartEvent) { dragStartLocations.clear(); for (WiresBaseShape shape : children) { dragStartLocations.add(new Pair<WiresBaseShape, Point2D>(shape, new Point2D(shape.getLocation().getX(), shape.getLocation().getY()))); } } });
@Override public void onNodeDragStart(final NodeDragStartEvent nodeDragStartEvent) { dragStartLocations.clear(); for (WiresBaseShape shape : children) { dragStartLocations.add(new Pair<WiresBaseShape, Point2D>(shape, new Point2D(shape.getLocation().getX(), shape.getLocation().getY()))); } } });
@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Store required transformations: Control, Current location, Target location transformations.clear(); for (int index = 0; index < controls.size(); index++) { final Group ctrl = controls.get(index); final Point2D origin = ctrl.getLocation(); origin.minus(WiresBaseShape.this.getLocation()); final Point2D target = new Point2D(0, 0); transformations.put(ctrl, new Pair<Point2D, Point2D>(origin, target)); } }
@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Store required transformations: Control, Current location, Target location transformations.clear(); for (int index = 0; index < controls.size(); index++) { final Group ctrl = controls.get(index); final Point2D origin = ctrl.getLocation(); origin.minus(WiresBaseShape.this.getLocation()); final Point2D target = new Point2D(0, 0); transformations.put(ctrl, new Pair<Point2D, Point2D>(origin, target)); } }
@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Reposition nodes. First we store the WiresBaseTreeNode together with its current position and target position transformations.clear(); for (Map.Entry<WiresBaseShape, Point2D> e : layout.entrySet()) { final Point2D origin = e.getKey().getLocation(); final Point2D destination = new Point2D(e.getValue().getX(), e.getValue().getY()); transformations.put(e.getKey(), new Pair<Point2D, Point2D>(origin, destination)); } WiresLayoutUtilities.resizeViewPort(canvasBounds, canvasLayer.getViewport()); }
@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Reposition nodes. First we store the WiresBaseTreeNode together with its current position and target position transformations.clear(); for (Map.Entry<WiresBaseShape, Point2D> e : layout.entrySet()) { final Point2D origin = e.getKey().getLocation(); final Point2D destination = new Point2D(e.getValue().getX(), e.getValue().getY()); transformations.put(e.getKey(), new Pair<Point2D, Point2D>(origin, destination)); } WiresLayoutUtilities.resizeViewPort(canvasBounds, canvasLayer.getViewport()); }
protected void updateChildrenLocations(final double deltaX, final double deltaY) { if (children == null) { return; } final Point2D delta = new Point2D(deltaX, deltaY); for (WiresBaseShape shape : children) { shape.setLocation(shape.getLocation().add(delta)); } }
@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Mark all descendants as collapsed, which affects the layout information descendants = getDescendants(WiresBaseTreeNode.this); for (WiresBaseTreeNode descendant : descendants) { descendant.collapsed++; } //Get new layout information layout = layoutManager.getLayoutInformation(getTreeRoot()); canvasBounds = WiresLayoutUtilities.alignLayoutInCanvas(layout); //Store required transformations: Shape, Current location, Target location transformations.clear(); for (Map.Entry<WiresBaseShape, Point2D> e : layout.entrySet()) { final Point2D origin = e.getKey().getLocation(); final Point2D destination = e.getValue(); transformations.put(e.getKey(), new Pair<Point2D, Point2D>(origin, destination)); } //Allow subclasses to change their appearance onCollapseStart(); }
private void updateControlLocations() { if (controls == null) { return; } if (!isControlsVisible) { return; } for (Group ctrl : controls) { final Point2D target = getControlTarget(ctrl).add(WiresBaseShape.this.getLocation()); ctrl.setLocation(target); } }
private void updateControlLocations() { if (controls == null) { return; } if (!isControlsVisible) { return; } for (Group ctrl : controls) { final Point2D target = getControlTarget(ctrl).add(WiresBaseShape.this.getLocation()); ctrl.setLocation(target); } }
protected void updateChildrenLocations(final double deltaX, final double deltaY) { if (children == null) { return; } final Point2D delta = new Point2D(deltaX, deltaY); for (WiresBaseShape shape : children) { shape.setLocation(shape.getLocation().add(delta)); } }
@Override public void onStart(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { //Mark all descendants as collapsed, which affects the layout information descendants = getDescendants(WiresBaseTreeNode.this); for (WiresBaseTreeNode descendant : descendants) { descendant.collapsed++; } //Get new layout information layout = layoutManager.getLayoutInformation(getTreeRoot()); canvasBounds = WiresLayoutUtilities.alignLayoutInCanvas(layout); //Store required transformations: Shape, Current location, Target location transformations.clear(); for (Map.Entry<WiresBaseShape, Point2D> e : layout.entrySet()) { final Point2D origin = e.getKey().getLocation(); final Point2D destination = e.getValue(); transformations.put(e.getKey(), new Pair<Point2D, Point2D>(origin, destination)); } //Allow subclasses to change their appearance onCollapseStart(); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { final double pct = tweener.apply(iAnimation.getPercent() > 1.0 ? 1.0 : iAnimation.getPercent()); //Move each Control along the line between its origin and the target destination for (Map.Entry<Group, Pair<Point2D, Point2D>> e : transformations.entrySet()) { final Point2D origin = e.getValue().getK1(); final Point2D target = e.getValue().getK2(); final double dx = (target.getX() - origin.getX()) * pct; final double dy = (target.getY() - origin.getY()) * pct; e.getKey().setLocation(new Point2D(origin.getX() + dx, origin.getY() + dy).add(WiresBaseShape.this.getLocation())); } for (Group ctrl : controls) { ctrl.setAlpha(1.0 - iAnimation.getPercent()); } //Without this call Lienzo doesn't update the Canvas for sub-classes of WiresBaseTreeNode WiresBaseShape.this.getLayer().batch(); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { final double pct = tweener.apply(iAnimation.getPercent() > 1.0 ? 1.0 : iAnimation.getPercent()); //Move each Control along the line between its origin and the target destination for (Map.Entry<Group, Pair<Point2D, Point2D>> e : transformations.entrySet()) { final Point2D origin = e.getValue().getK1(); final Point2D target = e.getValue().getK2(); final double dx = (target.getX() - origin.getX()) * pct; final double dy = (target.getY() - origin.getY()) * pct; e.getKey().setLocation(new Point2D(origin.getX() + dx, origin.getY() + dy).add(WiresBaseShape.this.getLocation())); } for (Group ctrl : controls) { ctrl.setAlpha(iAnimation.getPercent()); } //Without this call Lienzo doesn't update the Canvas for sub-classes of WiresBaseTreeNode WiresBaseShape.this.getLayer().batch(); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { final double pct = tweener.apply(iAnimation.getPercent() > 1.0 ? 1.0 : iAnimation.getPercent()); //Move each Control along the line between its origin and the target destination for (Map.Entry<Group, Pair<Point2D, Point2D>> e : transformations.entrySet()) { final Point2D origin = e.getValue().getK1(); final Point2D target = e.getValue().getK2(); final double dx = (target.getX() - origin.getX()) * pct; final double dy = (target.getY() - origin.getY()) * pct; e.getKey().setLocation(new Point2D(origin.getX() + dx, origin.getY() + dy).add(WiresBaseShape.this.getLocation())); } for (Group ctrl : controls) { ctrl.setAlpha(1.0 - iAnimation.getPercent()); } //Without this call Lienzo doesn't update the Canvas for sub-classes of WiresBaseTreeNode WiresBaseShape.this.getLayer().batch(); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { final double pct = tweener.apply(iAnimation.getPercent() > 1.0 ? 1.0 : iAnimation.getPercent()); //Move each Control along the line between its origin and the target destination for (Map.Entry<Group, Pair<Point2D, Point2D>> e : transformations.entrySet()) { final Point2D origin = e.getValue().getK1(); final Point2D target = e.getValue().getK2(); final double dx = (target.getX() - origin.getX()) * pct; final double dy = (target.getY() - origin.getY()) * pct; e.getKey().setLocation(new Point2D(origin.getX() + dx, origin.getY() + dy).add(WiresBaseShape.this.getLocation())); } for (Group ctrl : controls) { ctrl.setAlpha(iAnimation.getPercent()); } //Without this call Lienzo doesn't update the Canvas for sub-classes of WiresBaseTreeNode WiresBaseShape.this.getLayer().batch(); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { final double pct = tweener.apply(iAnimation.getPercent() > 1.0 ? 1.0 : iAnimation.getPercent()); //Move each Control along the line between its origin and the target destination for (Map.Entry<Group, Pair<Point2D, Point2D>> e : transformations.entrySet()) { final Point2D origin = e.getValue().getK1(); final Point2D target = e.getValue().getK2(); final double dx = (target.getX() - origin.getX()) * pct; final double dy = (target.getY() - origin.getY()) * pct; e.getKey().setLocation(new Point2D(origin.getX() + dx, origin.getY() + dy).add(WiresBaseShape.this.getLocation())); } for (Group ctrl : controlsToAdd) { ctrl.setAlpha(pct); } for (Group ctrl : controlsToRemove) { ctrl.setAlpha(1.0 - pct); } //Without this call Lienzo doesn't update the Canvas for sub-classes of WiresBaseTreeNode WiresBaseShape.this.getLayer().batch(); }
@Override public void onFrame(final IAnimation iAnimation, final IAnimationHandle iAnimationHandle) { final double pct = tweener.apply(iAnimation.getPercent() > 1.0 ? 1.0 : iAnimation.getPercent()); //Move each Control along the line between its origin and the target destination for (Map.Entry<Group, Pair<Point2D, Point2D>> e : transformations.entrySet()) { final Point2D origin = e.getValue().getK1(); final Point2D target = e.getValue().getK2(); final double dx = (target.getX() - origin.getX()) * pct; final double dy = (target.getY() - origin.getY()) * pct; e.getKey().setLocation(new Point2D(origin.getX() + dx, origin.getY() + dy).add(WiresBaseShape.this.getLocation())); } for (Group ctrl : controlsToAdd) { ctrl.setAlpha(pct); } for (Group ctrl : controlsToRemove) { ctrl.setAlpha(1.0 - pct); } //Without this call Lienzo doesn't update the Canvas for sub-classes of WiresBaseTreeNode WiresBaseShape.this.getLayer().batch(); }