@Test public void testReset() { tested.setView(viewSupplier); tested.reset(); assertEquals(ShapeState.NONE, tested.getShapeState()); verify(view, times(1)).setFillColor(eq(FILL)); verify(view, times(1)).setFillAlpha(eq(FILL_ALPHA)); verify(view, times(1)).setStrokeColor(eq(STROKE)); verify(view, times(1)).setStrokeAlpha(eq(STROKE_ALPHA)); verify(view, times(1)).setStrokeWidth(eq(STROKE_WIDTH)); }
@Override public ShapeState reset() { final ShapeState result = this.state; newDefaultStateApplier() .accept(getShapeView(), stateHolder.copy()); this.state = ShapeState.NONE; return result; }
ShapeStateAttributeHandler implements ShapeStateHandler { @Override public ShapeState reset() { final ShapeState result = this.state; newDefaultStateApplier() .accept(getShapeView(), stateHolder.copy()); this.state = ShapeState.NONE; return result; } }
ShapeStateAttributeHandler implements ShapeStateHandler { @Override public ShapeState reset() { final ShapeState result = this.state; newDefaultStateApplier() .accept(getShapeView(), stateHolder.copy()); this.state = ShapeState.NONE; return result; } ShapeStateAttributeHandler();  ShapeStateAttributeHandler(final BiConsumer<V, ShapeStateAttributes> stateAttributesApplier); }
ShapeStateAttributeHandler implements ShapeStateHandler { @Override public ShapeState reset() { final ShapeState result = this.state; newDefaultStateApplier() .accept(getShapeView(), stateHolder.copy()); this.state = ShapeState.NONE; return result; } ShapeStateAttributeHandler();  ShapeStateAttributeHandler(final BiConsumer<V, ShapeStateAttributes> stateAttributesApplier); static BiConsumer<V, ShapeStateAttributes> newDefaultStateApplier(); ShapeStateAttributeHandler<V> useAttributes(final Function<ShapeState, ShapeStateAttributes> stateAttributesProvider); ShapeStateAttributeHandler<V> setView(final Supplier<V> viewSupplier); @Override ShapeStateAttributeHandler<V> shapeAttributesChanged(); @Override void applyState(final ShapeState shapeState); @Override ShapeState reset(); @Override ShapeState getShapeState(); V getShapeView(); }
ShapeStateAttributeHandler implements ShapeStateHandler { @Override public ShapeState reset() { final ShapeState result = this.state; newDefaultStateApplier() .accept(getShapeView(), stateHolder.copy()); this.state = ShapeState.NONE; return result; } ShapeStateAttributeHandler();  ShapeStateAttributeHandler(final BiConsumer<V, ShapeStateAttributes> stateAttributesApplier); static BiConsumer<V, ShapeStateAttributes> newDefaultStateApplier(); ShapeStateAttributeHandler<V> useAttributes(final Function<ShapeState, ShapeStateAttributes> stateAttributesProvider); ShapeStateAttributeHandler<V> setView(final Supplier<V> viewSupplier); @Override ShapeStateAttributeHandler<V> shapeAttributesChanged(); @Override void applyState(final ShapeState shapeState); @Override ShapeState reset(); @Override ShapeState getShapeState(); V getShapeView();  }