@Test public void testCreateCommand() { executor.createCommand(layout, graph); verify(fakeList).get(0); verify(fakeList).get(1); verify(graph, times(2)).getNode("id"); }
CompositeCommand createCommand(final Layout layout, final Graph graph) { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); for (int i = 0; i < layout.getNodePositions().size(); i++) { final VertexPosition position = layout.getNodePositions().get(i); final Node node = graph.getNode(position.getId()); commandBuilder.addCommand(new UpdateElementPositionCommand(node, position.getUpperLeft())); } return commandBuilder.build(); }
UndoableLayoutExecutor implements LayoutExecutor { CompositeCommand createCommand(final Layout layout, final Graph graph) { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); for (int i = 0; i < layout.getNodePositions().size(); i++) { final VertexPosition position = layout.getNodePositions().get(i); final Node node = graph.getNode(position.getId()); commandBuilder.addCommand(new UpdateElementPositionCommand(node, position.getUpperLeft())); } return commandBuilder.build(); } }
UndoableLayoutExecutor implements LayoutExecutor { CompositeCommand createCommand(final Layout layout, final Graph graph) { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); for (int i = 0; i < layout.getNodePositions().size(); i++) { final VertexPosition position = layout.getNodePositions().get(i); final Node node = graph.getNode(position.getId()); commandBuilder.addCommand(new UpdateElementPositionCommand(node, position.getUpperLeft())); } return commandBuilder.build(); } UndoableLayoutExecutor(final AbstractCanvasHandler canvasHandler,
                                  final CanvasCommandManager<AbstractCanvasHandler> commandManager); }
UndoableLayoutExecutor implements LayoutExecutor { CompositeCommand createCommand(final Layout layout, final Graph graph) { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); for (int i = 0; i < layout.getNodePositions().size(); i++) { final VertexPosition position = layout.getNodePositions().get(i); final Node node = graph.getNode(position.getId()); commandBuilder.addCommand(new UpdateElementPositionCommand(node, position.getUpperLeft())); } return commandBuilder.build(); } UndoableLayoutExecutor(final AbstractCanvasHandler canvasHandler,
                                  final CanvasCommandManager<AbstractCanvasHandler> commandManager); @SuppressWarnings("Duplicates") @Override void applyLayout(final Layout layout, final Graph graph); AbstractCanvasHandler getCanvasHandler(); CanvasCommandManager<AbstractCanvasHandler> getCommandManager(); }
UndoableLayoutExecutor implements LayoutExecutor { CompositeCommand createCommand(final Layout layout, final Graph graph) { final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = new CompositeCommand.Builder<>(); for (int i = 0; i < layout.getNodePositions().size(); i++) { final VertexPosition position = layout.getNodePositions().get(i); final Node node = graph.getNode(position.getId()); commandBuilder.addCommand(new UpdateElementPositionCommand(node, position.getUpperLeft())); } return commandBuilder.build(); } UndoableLayoutExecutor(final AbstractCanvasHandler canvasHandler,
                                  final CanvasCommandManager<AbstractCanvasHandler> commandManager); @SuppressWarnings("Duplicates") @Override void applyLayout(final Layout layout, final Graph graph); AbstractCanvasHandler getCanvasHandler(); CanvasCommandManager<AbstractCanvasHandler> getCommandManager();  }