@Override public boolean isGridPinned() { return view.getGridLayerView().isGridPinned(); }
@Override public boolean isGridPinned() { return view.getGridLayerView().isGridPinned(); }
@Test public void isGridPinned() { presenter.isGridPinned(); verify(gridLayer, times(1)).isGridPinned(); }
private void doFindMovableGridWhenOverDragHandle(final boolean isPinned, final Runnable assertion) { state.setOperation(GridWidgetHandlersOperation.NONE); when(gridWidget.isVisible()).thenReturn(true); when(gridWidget.onDragHandle(any(INodeXYEvent.class))).thenReturn(true); when(layer.isGridPinned()).thenReturn(isPinned); when(layer.getGridWidgets()).thenReturn(new HashSet<GridWidget>() {{ add(gridWidget); }}); //This location is top-left of the GridWidget; not within a column move/resize or row move hot-spot when(event.getX()).thenReturn(100); when(event.getY()).thenReturn(100); handler.onNodeMouseMove(event); verify(handler, times(1)).findGridColumn(eq(event)); assertion.run(); }
private void doFindMovableGridWhenOverDragHandle(final boolean isPinned, final Runnable assertion) { state.setOperation(GridWidgetHandlersOperation.NONE); when(gridWidget.isVisible()).thenReturn(true); when(gridWidget.onDragHandle(any(INodeXYEvent.class))).thenReturn(true); when(layer.isGridPinned()).thenReturn(isPinned); when(layer.getGridWidgets()).thenReturn(new HashSet<GridWidget>() {{ add(gridWidget); }}); //This location is top-left of the GridWidget; not within a column move/resize or row move hot-spot when(event.getX()).thenReturn(100); when(event.getY()).thenReturn(100); handler.onNodeMouseMove(event); verify(handler, times(1)).findGridColumn(eq(event)); assertion.run(); }
@Test public void findMovableGridWhenNoColumnOrRowOperationIsDetectedAndGridIsPinned() { when(state.getOperation()).thenReturn(GridWidgetHandlersOperation.NONE); when(gridWidget.isVisible()).thenReturn(true); when(layer.getGridWidgets()).thenReturn(new HashSet<GridWidget>() {{ add(gridWidget); }}); when(layer.isGridPinned()).thenReturn(true); //This location is top-left of the GridWidget; not within a column move/resize or row move hot-spot when(event.getX()).thenReturn(100); when(event.getY()).thenReturn(100); handler.onNodeMouseMove(event); verify(handler, times(1)).findGridColumn(eq(event)); verify(state, never()).setActiveGridWidget(any(GridWidget.class)); verify(state, times(1)).setOperation(eq(GridWidgetHandlersOperation.NONE)); }
@Test public void findMovableGridWhenNoColumnOrRowOperationIsDetectedAndGridIsPinned() { when(state.getOperation()).thenReturn(GridWidgetHandlersOperation.NONE); when(gridWidget.isVisible()).thenReturn(true); when(layer.getGridWidgets()).thenReturn(new HashSet<GridWidget>() {{ add(gridWidget); }}); when(layer.isGridPinned()).thenReturn(true); //This location is top-left of the GridWidget; not within a column move/resize or row move hot-spot when(event.getX()).thenReturn(100); when(event.getY()).thenReturn(100); handler.onNodeMouseMove(event); verify(handler, times(1)).findGridColumn(eq(event)); verify(state, never()).setActiveGridWidget(any(GridWidget.class)); verify(state, times(1)).setOperation(eq(GridWidgetHandlersOperation.NONE)); }
@Test @SuppressWarnings("unchecked") public void onDecisionTableSelectedWhenInPinnedMode() { final GuidedDecisionTableView.Presenter dtPresenter1 = makeDecisionTable(); final GuidedDecisionTableView.Presenter dtPresenter2 = makeDecisionTable(); final DecisionTableSelectedEvent event = new DecisionTableSelectedEvent(dtPresenter1); when(gridLayer.isGridPinned()).thenReturn(true); when(presenter.isDecisionTableAvailable(eq(dtPresenter1))).thenReturn(true); when(presenter.getAvailableDecisionTables()).thenReturn(new HashSet<GuidedDecisionTableView.Presenter>() {{ add(dtPresenter1); add(dtPresenter2); }}); presenter.onDecisionTableSelected(event); verify(dtPresenter1, times(1)).initialiseAnalysis(); verify(view, times(1)).select(dtPresenter1.getView()); verify(gridLayer, times(1)).flipToGridWidget(eq(dtPresenter1.getView())); }
if (!layer.isGridPinned()) { if (gridWidget.onDragHandle(event)) { state.setActiveGridWidget(gridWidget); if (!layer.isGridPinned()) { if (state.getActiveGridWidget() == null) { state.setActiveGridWidget(gridWidget);
if (!layer.isGridPinned()) { if (gridWidget.onDragHandle(event)) { state.setActiveGridWidget(gridWidget); if (!layer.isGridPinned()) { if (state.getActiveGridWidget() == null) { state.setActiveGridWidget(gridWidget);