@Test @SuppressWarnings("unchecked") public void testExecuteSuccess() { tested = new UpdateCanvasElementPositionCommand(candidate, Point2D.create(0d, 0d)); CommandResult<CanvasViolation> result = tested.execute(canvasHandler); assertNotEquals(CommandResult.Type.ERROR, result.getType()); verify(canvasHandler, times(1)).updateElementPosition(eq(candidate), any(MutationContext.class)); }
@Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final CommandResult<CanvasViolation> allowResult = allow(context); if (isError(allowResult)) { return allowResult; } context.updateElementPosition(element, MutationContext.STATIC); moveConnectorsToTop(context); return allowResult; }
UpdateCanvasElementPositionCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final CommandResult<CanvasViolation> allowResult = allow(context); if (isError(allowResult)) { return allowResult; } context.updateElementPosition(element, MutationContext.STATIC); moveConnectorsToTop(context); return allowResult; } }
UpdateCanvasElementPositionCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final CommandResult<CanvasViolation> allowResult = allow(context); if (isError(allowResult)) { return allowResult; } context.updateElementPosition(element, MutationContext.STATIC); moveConnectorsToTop(context); return allowResult; } UpdateCanvasElementPositionCommand(final Element<? extends View<?>> element,
                                              final Point2D location); }
UpdateCanvasElementPositionCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final CommandResult<CanvasViolation> allowResult = allow(context); if (isError(allowResult)) { return allowResult; } context.updateElementPosition(element, MutationContext.STATIC); moveConnectorsToTop(context); return allowResult; } UpdateCanvasElementPositionCommand(final Element<? extends View<?>> element,
                                              final Point2D location); @Override CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); Element<? extends View<?>> getElement(); Point2D getLocation(); @Override String toString(); }
UpdateCanvasElementPositionCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final CommandResult<CanvasViolation> allowResult = allow(context); if (isError(allowResult)) { return allowResult; } context.updateElementPosition(element, MutationContext.STATIC); moveConnectorsToTop(context); return allowResult; } UpdateCanvasElementPositionCommand(final Element<? extends View<?>> element,
                                              final Point2D location); @Override CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); Element<? extends View<?>> getElement(); Point2D getLocation(); @Override String toString();  }