@Test @SuppressWarnings("unchecked") public void testExecuteDockedNode() { ArgumentCaptor<Bounds> boundsArgumentCaptor = ArgumentCaptor.forClass(Bounds.class); this.tested = new UpdateElementPositionCommand(dockedNode, new Point2D(600d, 600d)); final CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext); verify((View) dockedNode.getContent(), times(1)).setBounds(boundsArgumentCaptor.capture()); assertEquals(CommandResult.Type.INFO, result.getType()); Bounds bounds = boundsArgumentCaptor.getValue(); assertEquals(bounds.getUpperLeft(), Bound.create(600d, 600d)); assertEquals(bounds.getLowerRight(), Bound.create(650d, 650d)); }
@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();  }