@Test @SuppressWarnings("unchecked") public void testAddControlPoint() { final int index = 1; final ControlPoint controlPoint = ControlPoint.build(2, 2); CanvasCommand<AbstractCanvasHandler> addControlPointCommand = mock(CanvasCommand.class); doReturn(addControlPointCommand).when(canvasCommandFactory).addControlPoint(eq(edge), eq(controlPoint), eq(index)); tested.init(canvasHandler); tested.addControlPoint(edge, controlPoint, index); ArgumentCaptor<Command> commandArgumentCaptor = ArgumentCaptor.forClass(Command.class); verify(commandManager, times(1)).execute(eq(canvasHandler), commandArgumentCaptor.capture()); Command<AbstractCanvasHandler, CanvasViolation> command = commandArgumentCaptor.getValue(); assertEquals(addControlPointCommand, command); }
@Override public void addControlPoint(final Edge candidate, final ControlPoint controlPoint, final int index) { selectionEvent.fire(new CanvasSelectionEvent(canvasHandler, candidate.getUUID())); execute(canvasCommandFactory.addControlPoint(candidate, controlPoint, index)); }
ControlPointControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ControlPointControl<AbstractCanvasHandler> { @Override public void addControlPoint(final Edge candidate, final ControlPoint controlPoint, final int index) { selectionEvent.fire(new CanvasSelectionEvent(canvasHandler, candidate.getUUID())); execute(canvasCommandFactory.addControlPoint(candidate, controlPoint, index)); } }
ControlPointControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ControlPointControl<AbstractCanvasHandler> { @Override public void addControlPoint(final Edge candidate, final ControlPoint controlPoint, final int index) { selectionEvent.fire(new CanvasSelectionEvent(canvasHandler, candidate.getUUID())); execute(canvasCommandFactory.addControlPoint(candidate, controlPoint, index)); } @Inject  ControlPointControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory,
                                   final Event<CanvasSelectionEvent> selectionEvent); }
ControlPointControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ControlPointControl<AbstractCanvasHandler> { @Override public void addControlPoint(final Edge candidate, final ControlPoint controlPoint, final int index) { selectionEvent.fire(new CanvasSelectionEvent(canvasHandler, candidate.getUUID())); execute(canvasCommandFactory.addControlPoint(candidate, controlPoint, index)); } @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 addControlPoint(final Edge candidate, final ControlPoint controlPoint, final int index) { selectionEvent.fire(new CanvasSelectionEvent(canvasHandler, candidate.getUUID())); execute(canvasCommandFactory.addControlPoint(candidate, controlPoint, index)); } @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);  }