@Test(expected = IllegalArgumentException.class) public void testIndexForbiddenDuringExecute() { tested = new DeleteCanvasControlPointCommand(edge, 3); tested.execute(canvasHandler); }
@Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { allow(context); consumeControlPoints(context, candidate, view -> { this.deletedControlPoint = view.getManageableControlPoints()[index]; view.deleteControlPoint(index); }); return buildResult(); }
DeleteCanvasControlPointCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { allow(context); consumeControlPoints(context, candidate, view -> { this.deletedControlPoint = view.getManageableControlPoints()[index]; view.deleteControlPoint(index); }); return buildResult(); } }
DeleteCanvasControlPointCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { allow(context); consumeControlPoints(context, candidate, view -> { this.deletedControlPoint = view.getManageableControlPoints()[index]; view.deleteControlPoint(index); }); return buildResult(); } DeleteCanvasControlPointCommand(final Edge candidate,
                                           final int index); }
DeleteCanvasControlPointCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { allow(context); consumeControlPoints(context, candidate, view -> { this.deletedControlPoint = view.getManageableControlPoints()[index]; view.deleteControlPoint(index); }); return buildResult(); } DeleteCanvasControlPointCommand(final Edge candidate,
                                           final int index); @Override CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); @Override String toString(); }
DeleteCanvasControlPointCommand extends AbstractCanvasCommand { @Override public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { allow(context); consumeControlPoints(context, candidate, view -> { this.deletedControlPoint = view.getManageableControlPoints()[index]; view.deleteControlPoint(index); }); return buildResult(); } DeleteCanvasControlPointCommand(final Edge candidate,
                                           final int index); @Override CommandResult<CanvasViolation> allow(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); @Override String toString();  }