@Test public void testAnimationHandler() { final AnimationHandle handle = tested.run(); handle.run(); verify(decoratorAnimationHandle, times(1)).run(); handle.stop(); verify(decoratorAnimationHandle, times(1)).stop(); handle.isRunning(); verify(decoratorAnimationHandle, times(1)).isRunning(); }
@Override public AnimationHandle run() { final List<IAnimationHandle> handles = new LinkedList<>(); getDecorators().forEach(dec -> handles.add(animate(dec))); return new AnimationHandle() { @Override public AnimationHandle run() { handles.forEach(IAnimationHandle::run); return this; } @Override public AnimationHandle stop() { handles.forEach(IAnimationHandle::stop); return this; } @Override public boolean isRunning() { for (IAnimationHandle h : handles) { if (h.isRunning()) { return true; } } return false; } }; }
ShapeViewDecoratorAnimation extends AbstractAnimation<LienzoShapeView<?>> { @Override public AnimationHandle run() { final List<IAnimationHandle> handles = new LinkedList<>(); getDecorators().forEach(dec -> handles.add(animate(dec))); return new AnimationHandle() { @Override public AnimationHandle run() { handles.forEach(IAnimationHandle::run); return this; } @Override public AnimationHandle stop() { handles.forEach(IAnimationHandle::stop); return this; } @Override public boolean isRunning() { for (IAnimationHandle h : handles) { if (h.isRunning()) { return true; } } return false; } }; } }
ShapeViewDecoratorAnimation extends AbstractAnimation<LienzoShapeView<?>> { @Override public AnimationHandle run() { final List<IAnimationHandle> handles = new LinkedList<>(); getDecorators().forEach(dec -> handles.add(animate(dec))); return new AnimationHandle() { @Override public AnimationHandle run() { handles.forEach(IAnimationHandle::run); return this; } @Override public AnimationHandle stop() { handles.forEach(IAnimationHandle::stop); return this; } @Override public boolean isRunning() { for (IAnimationHandle h : handles) { if (h.isRunning()) { return true; } } return false; } }; } ShapeViewDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                final String fillColor,
                                final double fillAlpha);   ShapeViewDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                final String strokeColor,
                                final double strokeWidth,
                                final double strokeAlpha); }
ShapeViewDecoratorAnimation extends AbstractAnimation<LienzoShapeView<?>> { @Override public AnimationHandle run() { final List<IAnimationHandle> handles = new LinkedList<>(); getDecorators().forEach(dec -> handles.add(animate(dec))); return new AnimationHandle() { @Override public AnimationHandle run() { handles.forEach(IAnimationHandle::run); return this; } @Override public AnimationHandle stop() { handles.forEach(IAnimationHandle::stop); return this; } @Override public boolean isRunning() { for (IAnimationHandle h : handles) { if (h.isRunning()) { return true; } } return false; } }; } ShapeViewDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                final String fillColor,
                                final double fillAlpha);   ShapeViewDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                final String strokeColor,
                                final double strokeWidth,
                                final double strokeAlpha); static ShapeViewDecoratorAnimation newStrokeDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                                                          final String strokeColor,
                                                                          final double strokeWidth,
                                                                          final double strokeAlpha); static ShapeViewDecoratorAnimation newFillDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                                                        final String fillColor,
                                                                        final double fillAlpha); @Override LienzoShapeView<?> getSource(); @Override AnimationHandle run(); Supplier<LienzoShapeView<?>> getShapeView(); String getColor(); double getStrokeWidth(); double getAlpha(); }
ShapeViewDecoratorAnimation extends AbstractAnimation<LienzoShapeView<?>> { @Override public AnimationHandle run() { final List<IAnimationHandle> handles = new LinkedList<>(); getDecorators().forEach(dec -> handles.add(animate(dec))); return new AnimationHandle() { @Override public AnimationHandle run() { handles.forEach(IAnimationHandle::run); return this; } @Override public AnimationHandle stop() { handles.forEach(IAnimationHandle::stop); return this; } @Override public boolean isRunning() { for (IAnimationHandle h : handles) { if (h.isRunning()) { return true; } } return false; } }; } ShapeViewDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                final String fillColor,
                                final double fillAlpha);   ShapeViewDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                final String strokeColor,
                                final double strokeWidth,
                                final double strokeAlpha); static ShapeViewDecoratorAnimation newStrokeDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                                                          final String strokeColor,
                                                                          final double strokeWidth,
                                                                          final double strokeAlpha); static ShapeViewDecoratorAnimation newFillDecoratorAnimation(final Supplier<LienzoShapeView<?>> shapeView,
                                                                        final String fillColor,
                                                                        final double fillAlpha); @Override LienzoShapeView<?> getSource(); @Override AnimationHandle run(); Supplier<LienzoShapeView<?>> getShapeView(); String getColor(); double getStrokeWidth(); double getAlpha();  }