@Test public void testSingleSelectionFromGroupSelection() { final SelectionManager.SelectedItems selectedItems = mock(SelectionManager.SelectedItems.class); final LienzoMultipleSelectionControl.CursoredSelectionShapeProvider ssp = mock(LienzoMultipleSelectionControl.CursoredSelectionShapeProvider.class); tested = new LienzoMultipleSelectionControl<>(selectionControl, canvasSelectionEvent, clearSelectionEvent, ssp); tested.init(canvasHandler); when(selectionManager.getSelectedItems()).thenReturn(selectedItems); when(selectionManager.getSelectedItems().isSelectionGroup()).thenReturn(true); tested.onCanvasSelection(new CanvasSelectionEvent(canvasHandler, Arrays.asList(ELEMENT_UUID))); verify(selectionControl, never()).clearSelection(); verify(selectionManager, times(1)).clearSelection(); }
void onCanvasSelection(final @Observes CanvasSelectionEvent event) { checkNotNull("event", event); if (Objects.equals(getCanvasHandler(), event.getCanvasHandler())) { if (event.getIdentifiers().size() == 1) { onClearSelection(); } selectionShapeProvider.moveShapeToTop(); } }
LienzoMultipleSelectionControl extends AbstractSelectionControl<H> { void onCanvasSelection(final @Observes CanvasSelectionEvent event) { checkNotNull("event", event); if (Objects.equals(getCanvasHandler(), event.getCanvasHandler())) { if (event.getIdentifiers().size() == 1) { onClearSelection(); } selectionShapeProvider.moveShapeToTop(); } } }
LienzoMultipleSelectionControl extends AbstractSelectionControl<H> { void onCanvasSelection(final @Observes CanvasSelectionEvent event) { checkNotNull("event", event); if (Objects.equals(getCanvasHandler(), event.getCanvasHandler())) { if (event.getIdentifiers().size() == 1) { onClearSelection(); } selectionShapeProvider.moveShapeToTop(); } } @Inject  LienzoMultipleSelectionControl(final Event<CanvasSelectionEvent> canvasSelectionEvent,
                                          final Event<CanvasClearSelectionEvent> clearSelectionEvent);   LienzoMultipleSelectionControl(final MapSelectionControl<H> selectionControl,
                                   final Event<CanvasSelectionEvent> canvasSelectionEvent,
                                   final Event<CanvasClearSelectionEvent> clearSelectionEvent,
                                   final CursoredSelectionShapeProvider selectionShapeProvider); }
LienzoMultipleSelectionControl extends AbstractSelectionControl<H> { void onCanvasSelection(final @Observes CanvasSelectionEvent event) { checkNotNull("event", event); if (Objects.equals(getCanvasHandler(), event.getCanvasHandler())) { if (event.getIdentifiers().size() == 1) { onClearSelection(); } selectionShapeProvider.moveShapeToTop(); } } @Inject  LienzoMultipleSelectionControl(final Event<CanvasSelectionEvent> canvasSelectionEvent,
                                          final Event<CanvasClearSelectionEvent> clearSelectionEvent);   LienzoMultipleSelectionControl(final MapSelectionControl<H> selectionControl,
                                   final Event<CanvasSelectionEvent> canvasSelectionEvent,
                                   final Event<CanvasClearSelectionEvent> clearSelectionEvent,
                                   final CursoredSelectionShapeProvider selectionShapeProvider);  }
LienzoMultipleSelectionControl extends AbstractSelectionControl<H> { void onCanvasSelection(final @Observes CanvasSelectionEvent event) { checkNotNull("event", event); if (Objects.equals(getCanvasHandler(), event.getCanvasHandler())) { if (event.getIdentifiers().size() == 1) { onClearSelection(); } selectionShapeProvider.moveShapeToTop(); } } @Inject  LienzoMultipleSelectionControl(final Event<CanvasSelectionEvent> canvasSelectionEvent,
                                          final Event<CanvasClearSelectionEvent> clearSelectionEvent);   LienzoMultipleSelectionControl(final MapSelectionControl<H> selectionControl,
                                   final Event<CanvasSelectionEvent> canvasSelectionEvent,
                                   final Event<CanvasClearSelectionEvent> clearSelectionEvent,
                                   final CursoredSelectionShapeProvider selectionShapeProvider);   }