@Test @SuppressWarnings("unchecked") public void testResize() { tested.init(canvasHandler); assertFalse(tested.isRegistered(element)); tested.register(element); verify(shapeView, times(1)).supports(eq(ViewEventType.RESIZE)); ArgumentCaptor<ResizeHandler> resizeHandlerArgumentCaptor = ArgumentCaptor.forClass(ResizeHandler.class); verify(shapeView, times(1)).addHandler(eq(ViewEventType.RESIZE), resizeHandlerArgumentCaptor.capture()); final CanvasCommand expectedCommand = mock(CanvasCommand.class); doAnswer(invocationOnMock -> expectedCommand).when(canvasCommandFactory).resize(eq(element), any(BoundingBox.class)); ResizeHandler resizeHandler = resizeHandlerArgumentCaptor.getValue(); double x = 121.45d; double y = 23.456d; double width = 100d; double height = 200d; ResizeEvent event = new ResizeEvent(x, y, x, y, width, height); resizeHandler.end(event); ArgumentCaptor<CanvasCommand> commandArgumentCaptor = ArgumentCaptor.forClass(CanvasCommand.class); verify(commandManager, times(1)).execute(eq(canvasHandler), commandArgumentCaptor.capture()); CanvasCommand command = commandArgumentCaptor.getValue(); assertNotNull(command); assertEquals(expectedCommand, command); }
@Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> resize(final Element element, final double width, final double height) { return doResize(element, width, height); }
ResizeControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ResizeControl<AbstractCanvasHandler, Element> { @Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> resize(final Element element, final double width, final double height) { return doResize(element, width, height); } }
ResizeControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ResizeControl<AbstractCanvasHandler, Element> { @Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> resize(final Element element, final double width, final double height) { return doResize(element, width, height); } protected  ResizeControlImpl(); @Inject  ResizeControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory); }
ResizeControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ResizeControl<AbstractCanvasHandler, Element> { @Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> resize(final Element element, final double width, final double height) { return doResize(element, width, height); } protected  ResizeControlImpl(); @Inject  ResizeControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory); @Override @SuppressWarnings("unchecked") void register(final Element element); @Override @SuppressWarnings("unchecked") CommandResult<CanvasViolation> resize(final Element element,
                                                 final double width,
                                                 final double height); @Override void setCommandManagerProvider(final RequiresCommandManager.CommandManagerProvider<AbstractCanvasHandler> provider); }
ResizeControlImpl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements ResizeControl<AbstractCanvasHandler, Element> { @Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> resize(final Element element, final double width, final double height) { return doResize(element, width, height); } protected  ResizeControlImpl(); @Inject  ResizeControlImpl(final CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory); @Override @SuppressWarnings("unchecked") void register(final Element element); @Override @SuppressWarnings("unchecked") CommandResult<CanvasViolation> resize(final Element element,
                                                 final double width,
                                                 final double height); @Override void setCommandManagerProvider(final RequiresCommandManager.CommandManagerProvider<AbstractCanvasHandler> provider);  }