@Test public void testInformCtlKeyState() { panAndZoomManager.enteredPanMode = false; testLCM.informCtlKeyState(true); Assert.assertTrue(panAndZoomManager.enteredPanMode); Assert.assertTrue(testLCM.xAxisPanButtonPanel.isVisible()); Assert.assertTrue(testLCM.yAxisPanButtonPanel.isVisible()); testLCM.informCtlKeyState(false); Assert.assertFalse(panAndZoomManager.enteredPanMode); Assert.assertFalse(testLCM.xAxisPanButtonPanel.isVisible()); Assert.assertFalse(testLCM.yAxisPanButtonPanel.isVisible()); Mockito.when(mockPlot.isUserOperationsLocked()).thenReturn(true); testLCM.informCtlKeyState(true); Assert.assertFalse(panAndZoomManager.enteredPanMode); Assert.assertFalse(testLCM.xAxisPanButtonPanel.isVisible()); Assert.assertFalse(testLCM.yAxisPanButtonPanel.isVisible()); Mockito.when(mockPlot.isUserOperationsLocked()).thenReturn(false); }
public void informCtlKeyState(boolean state) { if(ctrlPin == null) { ctrlPin = plot.getPlotAbstraction().createPin(); } ctrlPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showPanControls(); plot.panAndZoomManager.enteredPanMode(); } else if(!state && plot.panAndZoomManager.isInPanMode()) { hidePanControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedPanMode(); } }
PlotLocalControlsManager implements ActionListener, AbstractPlotLocalControlsManager { public void informCtlKeyState(boolean state) { if(ctrlPin == null) { ctrlPin = plot.getPlotAbstraction().createPin(); } ctrlPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showPanControls(); plot.panAndZoomManager.enteredPanMode(); } else if(!state && plot.panAndZoomManager.isInPanMode()) { hidePanControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedPanMode(); } } }
PlotLocalControlsManager implements ActionListener, AbstractPlotLocalControlsManager { public void informCtlKeyState(boolean state) { if(ctrlPin == null) { ctrlPin = plot.getPlotAbstraction().createPin(); } ctrlPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showPanControls(); plot.panAndZoomManager.enteredPanMode(); } else if(!state && plot.panAndZoomManager.isInPanMode()) { hidePanControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedPanMode(); } } PlotLocalControlsManager(PlotterPlot thePlot); }
PlotLocalControlsManager implements ActionListener, AbstractPlotLocalControlsManager { public void informCtlKeyState(boolean state) { if(ctrlPin == null) { ctrlPin = plot.getPlotAbstraction().createPin(); } ctrlPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showPanControls(); plot.panAndZoomManager.enteredPanMode(); } else if(!state && plot.panAndZoomManager.isInPanMode()) { hidePanControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedPanMode(); } } PlotLocalControlsManager(PlotterPlot thePlot); void setupLocalControlManager(); int getYAxisLocalControlWidth(); int getXAxisLocalControlHeight(); void informShiftKeyState(boolean state); void informAltKeyState(boolean state); void informCtlKeyState(boolean state); @Override void actionPerformed(ActionEvent e); void updatePinButton(); void pinXYAxesAfterZoomedIn(); @Override void informKeyState(int key, boolean pressed); @Override void informMouseHover(boolean inPlotArea); }
PlotLocalControlsManager implements ActionListener, AbstractPlotLocalControlsManager { public void informCtlKeyState(boolean state) { if(ctrlPin == null) { ctrlPin = plot.getPlotAbstraction().createPin(); } ctrlPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showPanControls(); plot.panAndZoomManager.enteredPanMode(); } else if(!state && plot.panAndZoomManager.isInPanMode()) { hidePanControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedPanMode(); } } PlotLocalControlsManager(PlotterPlot thePlot); void setupLocalControlManager(); int getYAxisLocalControlWidth(); int getXAxisLocalControlHeight(); void informShiftKeyState(boolean state); void informAltKeyState(boolean state); void informCtlKeyState(boolean state); @Override void actionPerformed(ActionEvent e); void updatePinButton(); void pinXYAxesAfterZoomedIn(); @Override void informKeyState(int key, boolean pressed); @Override void informMouseHover(boolean inPlotArea);  }