@Test public void testAction() { final MouseClickEvent event = mock(MouseClickEvent.class); ToolboxAction<AbstractCanvasHandler> cascade = tested.onMouseClick(canvasHandler, E_UUID, event); assertEquals(tested, cascade); verify(commandFactory, times(1)).morphNode(eq(element), eq(morphDefinition), eq(MORPH_TARGET_ID), eq(SSID_UUID)); verify(sessionCommandManager, times(1)).execute(eq(canvasHandler), eq(morphNodeCommand)); final ArgumentCaptor<CanvasSelectionEvent> eventArgumentCaptor = ArgumentCaptor.forClass(CanvasSelectionEvent.class); verify(canvasElementSelectedEvent, times(1)).fire(eventArgumentCaptor.capture()); final CanvasSelectionEvent eCaptured = eventArgumentCaptor.getValue(); assertEquals(E_UUID, eCaptured.getIdentifiers().iterator().next()); }
@Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId(); final Node<View<?>, Edge> sourceNode = (Node<View<?>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid).asNode(); clearSelectionEventEvent.fire(new CanvasClearSelectionEvent(canvasHandler)); final CommandResult<CanvasViolation> result = sessionCommandManager.execute(canvasHandler, commandFactory.morphNode(sourceNode, morphDefinition, targetDefinitionId, ssid)); if (CommandUtils.isError(result)) { LOGGER.log(Level.SEVERE, result.toString()); } else { CanvasLayoutUtils.fireElementSelectedEvent(selectionEvent, canvasHandler, uuid); } return this; }
MorphNodeToolboxAction extends AbstractToolboxAction { @Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId(); final Node<View<?>, Edge> sourceNode = (Node<View<?>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid).asNode(); clearSelectionEventEvent.fire(new CanvasClearSelectionEvent(canvasHandler)); final CommandResult<CanvasViolation> result = sessionCommandManager.execute(canvasHandler, commandFactory.morphNode(sourceNode, morphDefinition, targetDefinitionId, ssid)); if (CommandUtils.isError(result)) { LOGGER.log(Level.SEVERE, result.toString()); } else { CanvasLayoutUtils.fireElementSelectedEvent(selectionEvent, canvasHandler, uuid); } return this; } }
MorphNodeToolboxAction extends AbstractToolboxAction { @Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId(); final Node<View<?>, Edge> sourceNode = (Node<View<?>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid).asNode(); clearSelectionEventEvent.fire(new CanvasClearSelectionEvent(canvasHandler)); final CommandResult<CanvasViolation> result = sessionCommandManager.execute(canvasHandler, commandFactory.morphNode(sourceNode, morphDefinition, targetDefinitionId, ssid)); if (CommandUtils.isError(result)) { LOGGER.log(Level.SEVERE, result.toString()); } else { CanvasLayoutUtils.fireElementSelectedEvent(selectionEvent, canvasHandler, uuid); } return this; } @Inject  MorphNodeToolboxAction(final DefinitionUtils definitionUtils,
                                  final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                  final CanvasCommandFactory<AbstractCanvasHandler> commandFactory,
                                  final ClientTranslationService translationService,
                                  final Event<CanvasSelectionEvent> selectionEvent,
                                  final Event<CanvasClearSelectionEvent> clearSelectionEventEvent); }
MorphNodeToolboxAction extends AbstractToolboxAction { @Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId(); final Node<View<?>, Edge> sourceNode = (Node<View<?>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid).asNode(); clearSelectionEventEvent.fire(new CanvasClearSelectionEvent(canvasHandler)); final CommandResult<CanvasViolation> result = sessionCommandManager.execute(canvasHandler, commandFactory.morphNode(sourceNode, morphDefinition, targetDefinitionId, ssid)); if (CommandUtils.isError(result)) { LOGGER.log(Level.SEVERE, result.toString()); } else { CanvasLayoutUtils.fireElementSelectedEvent(selectionEvent, canvasHandler, uuid); } return this; } @Inject  MorphNodeToolboxAction(final DefinitionUtils definitionUtils,
                                  final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                  final CanvasCommandFactory<AbstractCanvasHandler> commandFactory,
                                  final ClientTranslationService translationService,
                                  final Event<CanvasSelectionEvent> selectionEvent,
                                  final Event<CanvasClearSelectionEvent> clearSelectionEventEvent); MorphNodeToolboxAction setMorphDefinition(final MorphDefinition morphDefinition); MorphNodeToolboxAction setTargetDefinitionId(final String targetDefinitionId); @Override @SuppressWarnings("unchecked") ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler,
                                                             final String uuid,
                                                             final MouseClickEvent event); @PreDestroy void destroy(); @Override int hashCode(); @Override boolean equals(final Object o); }
MorphNodeToolboxAction extends AbstractToolboxAction { @Override @SuppressWarnings("unchecked") public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler, final String uuid, final MouseClickEvent event) { final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId(); final Node<View<?>, Edge> sourceNode = (Node<View<?>, Edge>) CanvasLayoutUtils.getElement(canvasHandler, uuid).asNode(); clearSelectionEventEvent.fire(new CanvasClearSelectionEvent(canvasHandler)); final CommandResult<CanvasViolation> result = sessionCommandManager.execute(canvasHandler, commandFactory.morphNode(sourceNode, morphDefinition, targetDefinitionId, ssid)); if (CommandUtils.isError(result)) { LOGGER.log(Level.SEVERE, result.toString()); } else { CanvasLayoutUtils.fireElementSelectedEvent(selectionEvent, canvasHandler, uuid); } return this; } @Inject  MorphNodeToolboxAction(final DefinitionUtils definitionUtils,
                                  final SessionCommandManager<AbstractCanvasHandler> sessionCommandManager,
                                  final CanvasCommandFactory<AbstractCanvasHandler> commandFactory,
                                  final ClientTranslationService translationService,
                                  final Event<CanvasSelectionEvent> selectionEvent,
                                  final Event<CanvasClearSelectionEvent> clearSelectionEventEvent); MorphNodeToolboxAction setMorphDefinition(final MorphDefinition morphDefinition); MorphNodeToolboxAction setTargetDefinitionId(final String targetDefinitionId); @Override @SuppressWarnings("unchecked") ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler,
                                                             final String uuid,
                                                             final MouseClickEvent event); @PreDestroy void destroy(); @Override int hashCode(); @Override boolean equals(final Object o);  }