@Test public void testExecute() { CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext); ArgumentCaptor<Bounds> bounds = ArgumentCaptor.forClass(Bounds.class); verify(content, times(1)).setBounds(bounds.capture()); assertEquals(CommandResult.Type.INFO, result.getType()); Bounds b = bounds.getValue(); assertEquals(UUID, tested.getUuid()); assertEquals(LOCATION, tested.getLocation()); assertEquals(PREVIOUS_LOCATION, tested.getPreviousLocation()); assertEquals(PREVIOUS_LOCATION.getY(), tested.getPreviousLocation().getY() , 0d); assertEquals(Double.valueOf(LOCATION.getX() + W), b.getLowerRight().getX()); assertEquals(Double.valueOf(LOCATION.getY() + H), b.getLowerRight().getY()); }
@Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { return execute(context, bounds -> node.getContent().setBounds(bounds)); }
UpdateElementPositionCommand extends AbstractGraphCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { return execute(context, bounds -> node.getContent().setBounds(bounds)); } }
UpdateElementPositionCommand extends AbstractGraphCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { return execute(context, bounds -> node.getContent().setBounds(bounds)); } UpdateElementPositionCommand(final @MapsTo("uuid") String uuid,
                                        final @MapsTo("location") Point2D location,
                                        final @MapsTo("previousLocation") Point2D previousLocation);  UpdateElementPositionCommand(final Node<? extends View<?>, Edge> node,
                                        final Point2D location); }
UpdateElementPositionCommand extends AbstractGraphCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { return execute(context, bounds -> node.getContent().setBounds(bounds)); } UpdateElementPositionCommand(final @MapsTo("uuid") String uuid,
                                        final @MapsTo("location") Point2D location,
                                        final @MapsTo("previousLocation") Point2D previousLocation);  UpdateElementPositionCommand(final Node<? extends View<?>, Edge> node,
                                        final Point2D location); Point2D getLocation(); Point2D getPreviousLocation(); Node<?, Edge> getNode(); String getUuid(); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); static Bounds computeCandidateBounds(final Element<? extends View<?>> element,
                                                final Point2D location); @Override String toString(); }
UpdateElementPositionCommand extends AbstractGraphCommand { @Override @SuppressWarnings("unchecked") public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { return execute(context, bounds -> node.getContent().setBounds(bounds)); } UpdateElementPositionCommand(final @MapsTo("uuid") String uuid,
                                        final @MapsTo("location") Point2D location,
                                        final @MapsTo("previousLocation") Point2D previousLocation);  UpdateElementPositionCommand(final Node<? extends View<?>, Edge> node,
                                        final Point2D location); Point2D getLocation(); Point2D getPreviousLocation(); Node<?, Edge> getNode(); String getUuid(); @Override @SuppressWarnings("unchecked") CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); static Bounds computeCandidateBounds(final Element<? extends View<?>> element,
                                                final Point2D location); @Override String toString();  }