@Test public void testFocus() { final CanvasHandler canvasHandler = mock(CanvasHandler.class); final Canvas canvas = mock(Canvas.class); final String uuid = "uuid"; final CanvasSelectionEvent canvasSelection = new CanvasSelectionEvent(canvasHandler, uuid); final CanvasFocusedShapeEvent canvasFocusedShape = new CanvasFocusedShapeEvent(canvasHandler, uuid); when(dmnGraphUtils.getCanvasHandler()).thenReturn(canvasHandler); doReturn(canvasSelection).when(canvasFocusUtils).makeCanvasSelectionEvent(canvasHandler, uuid); doReturn(canvasFocusedShape).when(canvasFocusUtils).makeCanvasFocusedShapeEvent(canvasHandler, uuid); doReturn(canvas).when(canvasHandler).getCanvas(); canvasFocusUtils.focus(uuid); verify(canvasSelectionEvent).fire(canvasSelection); verify(canvasFocusedSelectionEvent).fire(canvasFocusedShape); verify(canvas).focus(); }
public void focus(final String nodeUUID) { final CanvasHandler canvasHandler = dmnGraphUtils.getCanvasHandler(); canvasSelectionEvent.fire(makeCanvasSelectionEvent(canvasHandler, nodeUUID)); canvasFocusedSelectionEvent.fire(makeCanvasFocusedShapeEvent(canvasHandler, nodeUUID)); if (canvasHandler != null && canvasHandler.getCanvas() != null) { canvasHandler.getCanvas().focus(); } }
CanvasFocusUtils { public void focus(final String nodeUUID) { final CanvasHandler canvasHandler = dmnGraphUtils.getCanvasHandler(); canvasSelectionEvent.fire(makeCanvasSelectionEvent(canvasHandler, nodeUUID)); canvasFocusedSelectionEvent.fire(makeCanvasFocusedShapeEvent(canvasHandler, nodeUUID)); if (canvasHandler != null && canvasHandler.getCanvas() != null) { canvasHandler.getCanvas().focus(); } } }
CanvasFocusUtils { public void focus(final String nodeUUID) { final CanvasHandler canvasHandler = dmnGraphUtils.getCanvasHandler(); canvasSelectionEvent.fire(makeCanvasSelectionEvent(canvasHandler, nodeUUID)); canvasFocusedSelectionEvent.fire(makeCanvasFocusedShapeEvent(canvasHandler, nodeUUID)); if (canvasHandler != null && canvasHandler.getCanvas() != null) { canvasHandler.getCanvas().focus(); } } @Inject  CanvasFocusUtils(final DMNGraphUtils dmnGraphUtils,
                            final Event<CanvasFocusedShapeEvent> canvasFocusedSelectionEvent,
                            final Event<CanvasSelectionEvent> canvasSelectionEvent); }
CanvasFocusUtils { public void focus(final String nodeUUID) { final CanvasHandler canvasHandler = dmnGraphUtils.getCanvasHandler(); canvasSelectionEvent.fire(makeCanvasSelectionEvent(canvasHandler, nodeUUID)); canvasFocusedSelectionEvent.fire(makeCanvasFocusedShapeEvent(canvasHandler, nodeUUID)); if (canvasHandler != null && canvasHandler.getCanvas() != null) { canvasHandler.getCanvas().focus(); } } @Inject  CanvasFocusUtils(final DMNGraphUtils dmnGraphUtils,
                            final Event<CanvasFocusedShapeEvent> canvasFocusedSelectionEvent,
                            final Event<CanvasSelectionEvent> canvasSelectionEvent); void focus(final String nodeUUID); }
CanvasFocusUtils { public void focus(final String nodeUUID) { final CanvasHandler canvasHandler = dmnGraphUtils.getCanvasHandler(); canvasSelectionEvent.fire(makeCanvasSelectionEvent(canvasHandler, nodeUUID)); canvasFocusedSelectionEvent.fire(makeCanvasFocusedShapeEvent(canvasHandler, nodeUUID)); if (canvasHandler != null && canvasHandler.getCanvas() != null) { canvasHandler.getCanvas().focus(); } } @Inject  CanvasFocusUtils(final DMNGraphUtils dmnGraphUtils,
                            final Event<CanvasFocusedShapeEvent> canvasFocusedSelectionEvent,
                            final Event<CanvasSelectionEvent> canvasSelectionEvent); void focus(final String nodeUUID);  }