@Test public void testStunnerControlPointsAcceptorMove() { ControlPointControl control = mock(ControlPointControl.class); ControlPointControlImpl.StunnerControlPointsAcceptor acceptor = createStunnerControlPointsAcceptor(control); Point2DArray locationArray = new Point2DArray(new com.ait.lienzo.client.core.types.Point2D(0, 0), new com.ait.lienzo.client.core.types.Point2D(5, 5), new com.ait.lienzo.client.core.types.Point2D(10, 10)); final boolean moveResult = acceptor.move(connector, locationArray); assertTrue(moveResult); ArgumentCaptor<ControlPoint[]> controlPointsExpected = ArgumentCaptor.forClass(ControlPoint[].class); verify(control, times(1)).updateControlPoints(eq(edge), controlPointsExpected.capture()); ControlPoint[] cps = controlPointsExpected.getValue(); assertNotNull(cps); assertEquals(1, cps.length); assertEquals(ControlPoint.build(5, 5), cps[0]); }
@Override public void updateControlPoints(final Edge candidate, final ControlPoint[] controlPoints) { execute(canvasCommandFactory.updateControlPointPosition(candidate, controlPoints)); }
ControlPointControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ControlPointControl<AbstractCanvasHandler> { @Override public void updateControlPoints(final Edge candidate, final ControlPoint[] controlPoints) { execute(canvasCommandFactory.updateControlPointPosition(candidate, controlPoints)); } }
ControlPointControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ControlPointControl<AbstractCanvasHandler> { @Override public void updateControlPoints(final Edge candidate, final ControlPoint[] controlPoints) { execute(canvasCommandFactory.updateControlPointPosition(candidate, controlPoints)); } @Inject  ControlPointControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                   final Event<CanvasSelectionEvent> selectionEvent); }
ControlPointControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ControlPointControl<AbstractCanvasHandler> { @Override public void updateControlPoints(final Edge candidate, final ControlPoint[] controlPoints) { execute(canvasCommandFactory.updateControlPointPosition(candidate, controlPoints)); } @Inject  ControlPointControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                   final Event<CanvasSelectionEvent> selectionEvent); @Override void register(final Element element); @Override void addControlPoint(final Edge candidate,
                                final ControlPoint controlPoint,
                                final int index); @Override void updateControlPoints(final Edge candidate,
                                    final ControlPoint[] controlPoints); @Override void deleteControlPoint(final Edge candidate,
                                   final int index); @Override void setCommandManagerProvider(final CommandManagerProvider<AbstractCanvasHandler> provider); }
ControlPointControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ControlPointControl<AbstractCanvasHandler> { @Override public void updateControlPoints(final Edge candidate, final ControlPoint[] controlPoints) { execute(canvasCommandFactory.updateControlPointPosition(candidate, controlPoints)); } @Inject  ControlPointControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                   final Event<CanvasSelectionEvent> selectionEvent); @Override void register(final Element element); @Override void addControlPoint(final Edge candidate,
                                final ControlPoint controlPoint,
                                final int index); @Override void updateControlPoints(final Edge candidate,
                                    final ControlPoint[] controlPoints); @Override void deleteControlPoint(final Edge candidate,
                                   final int index); @Override void setCommandManagerProvider(final CommandManagerProvider<AbstractCanvasHandler> provider);  }