@Test @SuppressWarnings("unchecked") public void testExecute() { final CommandResult<CanvasViolation> result = tested.execute(canvasHandler); assertNotEquals(CommandResult.Type.ERROR, result.getType()); verify(edgeShape, times(1)).applyConnections(eq(edge), eq(sourceShapeView), eq(targetShapeView), any(MutationContext.class)); verify(canvasHandler, times(1)).notifyCanvasElementUpdated(eq(source)); verify(canvasHandler, times(1)).notifyCanvasElementUpdated(eq(target)); }
@Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final Node source = edge.getSourceNode(); final Node target = edge.getTargetNode(); ShapeUtils.applyConnections(edge, context, MutationContext.STATIC); if (null != source) { context.notifyCanvasElementUpdated(source); } if (null != target) { context.notifyCanvasElementUpdated(target); } return buildResult(); }
SetCanvasConnectionCommand extends AbstractCanvasCommand { @Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final Node source = edge.getSourceNode(); final Node target = edge.getTargetNode(); ShapeUtils.applyConnections(edge, context, MutationContext.STATIC); if (null != source) { context.notifyCanvasElementUpdated(source); } if (null != target) { context.notifyCanvasElementUpdated(target); } return buildResult(); } }
SetCanvasConnectionCommand extends AbstractCanvasCommand { @Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final Node source = edge.getSourceNode(); final Node target = edge.getTargetNode(); ShapeUtils.applyConnections(edge, context, MutationContext.STATIC); if (null != source) { context.notifyCanvasElementUpdated(source); } if (null != target) { context.notifyCanvasElementUpdated(target); } return buildResult(); } SetCanvasConnectionCommand(final Edge<? extends ViewConnector<?>, Node> edge); }
SetCanvasConnectionCommand extends AbstractCanvasCommand { @Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final Node source = edge.getSourceNode(); final Node target = edge.getTargetNode(); ShapeUtils.applyConnections(edge, context, MutationContext.STATIC); if (null != source) { context.notifyCanvasElementUpdated(source); } if (null != target) { context.notifyCanvasElementUpdated(target); } return buildResult(); } SetCanvasConnectionCommand(final Edge<? extends ViewConnector<?>, Node> edge); @Override @SuppressWarnings("unchecked") CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); Edge<? extends View<?>, Node> getEdge(); @Override String toString(); }
SetCanvasConnectionCommand extends AbstractCanvasCommand { @Override @SuppressWarnings("unchecked") public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) { final Node source = edge.getSourceNode(); final Node target = edge.getTargetNode(); ShapeUtils.applyConnections(edge, context, MutationContext.STATIC); if (null != source) { context.notifyCanvasElementUpdated(source); } if (null != target) { context.notifyCanvasElementUpdated(target); } return buildResult(); } SetCanvasConnectionCommand(final Edge<? extends ViewConnector<?>, Node> edge); @Override @SuppressWarnings("unchecked") CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context); @Override CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context); Edge<? extends View<?>, Node> getEdge(); @Override String toString();  }