@Test public void testUpdateControlPoints() { tested = new UpdateControlPointPositionCommand(EDGE_UUID, newControlPoints); CommandResult<RuleViolation> result = tested.execute(graphCommandExecutionContext); assertFalse(CommandUtils.isError(result)); ArgumentCaptor<ControlPoint[]> pointsCaptor = ArgumentCaptor.forClass(ControlPoint[].class); verify(viewConnector, times(1)).setControlPoints(pointsCaptor.capture()); ControlPoint[] controlPoints = pointsCaptor.getValue(); assertNotNull(controlPoints); assertEquals(3, controlPoints.length); assertEquals(newControlPoint1, controlPoints[0]); assertEquals(newControlPoint2, controlPoints[1]); assertEquals(newControlPoint3, controlPoints[2]); }
@Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final HasControlPoints hasControlPoints = getEdgeControlPoints(context); oldControlPoints = hasControlPoints.getControlPoints(); hasControlPoints.setControlPoints(controlPoints); return SUCCESS; }
UpdateControlPointPositionCommand extends AbstractControlPointCommand { @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final HasControlPoints hasControlPoints = getEdgeControlPoints(context); oldControlPoints = hasControlPoints.getControlPoints(); hasControlPoints.setControlPoints(controlPoints); return SUCCESS; } }
UpdateControlPointPositionCommand extends AbstractControlPointCommand { @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final HasControlPoints hasControlPoints = getEdgeControlPoints(context); oldControlPoints = hasControlPoints.getControlPoints(); hasControlPoints.setControlPoints(controlPoints); return SUCCESS; } UpdateControlPointPositionCommand(final @MapsTo("edgeUUID") String edgeUUID,
                                             final @MapsTo("controlPoints") ControlPoint[] controlPoints); }
UpdateControlPointPositionCommand extends AbstractControlPointCommand { @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final HasControlPoints hasControlPoints = getEdgeControlPoints(context); oldControlPoints = hasControlPoints.getControlPoints(); hasControlPoints.setControlPoints(controlPoints); return SUCCESS; } UpdateControlPointPositionCommand(final @MapsTo("edgeUUID") String edgeUUID,
                                             final @MapsTo("controlPoints") ControlPoint[] controlPoints); @Override CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context); }
UpdateControlPointPositionCommand extends AbstractControlPointCommand { @Override public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) { final HasControlPoints hasControlPoints = getEdgeControlPoints(context); oldControlPoints = hasControlPoints.getControlPoints(); hasControlPoints.setControlPoints(controlPoints); return SUCCESS; } UpdateControlPointPositionCommand(final @MapsTo("edgeUUID") String edgeUUID,
                                             final @MapsTo("controlPoints") ControlPoint[] controlPoints); @Override CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context); @Override CommandResult<RuleViolation> undo(final GraphCommandExecutionContext context);  }