@Test public void testInformAltKeyState() { panAndZoomManager.enteredZoomMode = false; testLCM.informAltKeyState(true); Assert.assertTrue(panAndZoomManager.enteredZoomMode); Assert.assertTrue(testLCM.xAxisZoomButtonCenterPanel.isVisible()); Assert.assertTrue(testLCM.yAxisZoomButtonMiddlePanel.isVisible()); testLCM.informAltKeyState(false); Assert.assertFalse(panAndZoomManager.enteredZoomMode); Assert.assertFalse(testLCM.xAxisZoomButtonCenterPanel.isVisible()); Assert.assertFalse(testLCM.yAxisZoomButtonMiddlePanel.isVisible()); Mockito.when(mockPlot.isUserOperationsLocked()).thenReturn(true); testLCM.informAltKeyState(true); Assert.assertFalse(panAndZoomManager.enteredZoomMode); Assert.assertFalse(testLCM.xAxisZoomButtonCenterPanel.isVisible()); Assert.assertFalse(testLCM.yAxisZoomButtonMiddlePanel.isVisible()); Mockito.when(mockPlot.isUserOperationsLocked()).thenReturn(false); }
public void informAltKeyState(boolean state) { if(altPin == null) { altPin = plot.getPlotAbstraction().createPin(); } altPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showZoomControls(); plot.panAndZoomManager.enteredZoomMode(); } else if(!state && plot.panAndZoomManager.isInZoomMode()) { hideZoomControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedZoomMode(); } }
PlotLocalControlsManager implements ActionListener, AbstractPlotLocalControlsManager { public void informAltKeyState(boolean state) { if(altPin == null) { altPin = plot.getPlotAbstraction().createPin(); } altPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showZoomControls(); plot.panAndZoomManager.enteredZoomMode(); } else if(!state && plot.panAndZoomManager.isInZoomMode()) { hideZoomControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedZoomMode(); } } }
PlotLocalControlsManager implements ActionListener, AbstractPlotLocalControlsManager { public void informAltKeyState(boolean state) { if(altPin == null) { altPin = plot.getPlotAbstraction().createPin(); } altPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showZoomControls(); plot.panAndZoomManager.enteredZoomMode(); } else if(!state && plot.panAndZoomManager.isInZoomMode()) { hideZoomControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedZoomMode(); } } PlotLocalControlsManager(PlotterPlot thePlot); }
PlotLocalControlsManager implements ActionListener, AbstractPlotLocalControlsManager { public void informAltKeyState(boolean state) { if(altPin == null) { altPin = plot.getPlotAbstraction().createPin(); } altPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showZoomControls(); plot.panAndZoomManager.enteredZoomMode(); } else if(!state && plot.panAndZoomManager.isInZoomMode()) { hideZoomControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedZoomMode(); } } 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 informAltKeyState(boolean state) { if(altPin == null) { altPin = plot.getPlotAbstraction().createPin(); } altPin.setPinned(state); if (state && !plot.isUserOperationsLocked()) { plot.setUserOperationLockedState(true); showZoomControls(); plot.panAndZoomManager.enteredZoomMode(); } else if(!state && plot.panAndZoomManager.isInZoomMode()) { hideZoomControls(); plot.setUserOperationLockedState(false); plot.panAndZoomManager.exitedZoomMode(); } } 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);  }