@Test public void TestPanningActionsTimeOnX() { XYAxis xAxis = plotTimeOnX.getPlotView().getXAxis(); XYAxis yAxis = plotTimeOnX.getPlotView().getYAxis(); double xStart = xAxis.getStart(); double xStop = xAxis.getEnd(); double yStart = yAxis.getStart(); double yStop = yAxis.getEnd(); panAndZoomManagerTimeOnX.panAction(PanDirection.PAN_HIGHER_X_AXIS); double newXStart = xAxis.getStart(); double newXStop = xAxis.getEnd(); double newYStart = yAxis.getStart(); double newYStop = yAxis.getEnd(); Assert.assertTrue(newXStart > xStart); Assert.assertTrue(newXStop > xStop); Assert.assertEquals(newYStart, yStart); Assert.assertEquals(newYStop, yStop); panAndZoomManagerTimeOnX.panAction(PanDirection.PAN_LOWER_X_AXIS); newXStart = xAxis.getStart(); newXStop = xAxis.getEnd(); newYStart = yAxis.getStart(); newYStop = yAxis.getEnd(); Assert.assertEquals(newXStart, xStart); Assert.assertEquals(newXStop, xStop); Assert.assertEquals(newYStart, yStart); Assert.assertEquals(newYStop, yStop); panAndZoomManagerTimeOnX.panAction(PanDirection.PAN_LOWER_X_AXIS); newXStart = xAxis.getStart(); newXStop = xAxis.getEnd(); newYStart = yAxis.getStart(); newYStop = yAxis.getEnd(); Assert.assertTrue(newXStart < xStart); Assert.assertTrue(newXStop < xStop); Assert.assertEquals(newYStart, yStart); Assert.assertEquals(newYStop, yStop); panAndZoomManagerTimeOnX.panAction(PanDirection.PAN_HIGHER_X_AXIS); newXStart = xAxis.getStart(); newXStop = xAxis.getEnd(); newYStart = yAxis.getStart(); newYStop = yAxis.getEnd(); Assert.assertEquals(newYStart, yStart); Assert.assertEquals(newYStop, yStop); Assert.assertEquals(newXStart, xStart); Assert.assertEquals(newXStop, xStop); panAndZoomManagerTimeOnX.panAction(PanDirection.PAN_HIGHER_Y_AXIS); newXStart = xAxis.getStart(); newXStop = xAxis.getEnd(); newYStart = yAxis.getStart(); newYStop = yAxis.getEnd(); Assert.assertTrue(newYStart > yStart); Assert.assertTrue(newYStop > yStop); Assert.assertEquals(newXStart, xStart); Assert.assertEquals(newXStop, xStop); panAndZoomManagerTimeOnX.panAction(PanDirection.PAN_LOWER_Y_AXIS); newXStart = xAxis.getStart(); newXStop = xAxis.getEnd(); newYStart = yAxis.getStart(); newYStop = yAxis.getEnd(); Assert.assertEquals(newYStart, yStart); Assert.assertEquals(newYStop, yStop); Assert.assertEquals(newXStart, xStart); Assert.assertEquals(newXStop, xStop); panAndZoomManagerTimeOnX.panAction(PanDirection.PAN_LOWER_Y_AXIS); newXStart = xAxis.getStart(); newXStop = xAxis.getEnd(); newYStart = yAxis.getStart(); newYStop = yAxis.getEnd(); Assert.assertTrue(newYStart < yStart); Assert.assertTrue(newYStop < yStop); Assert.assertEquals(newXStart, xStart); Assert.assertEquals(newXStop, xStop); }
public void panAction(PanDirection panningAction) { XYAxis xAxis = plot.getPlotView().getXAxis(); XYAxis yAxis = plot.getPlotView().getYAxis(); if (plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) { double nonTimeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); double timeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } } else { double nonTimeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); double timeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(nonTimeScalePanAmount); pinNonTime(); } } plot.getPlotAbstraction().updateResetButtons(); plot.refreshDisplay(); plot.clearAllDataFromPlot(); plot.getLimitManager().setModeUntranslated(false); plot.getPlotAbstraction().requestPlotData(plot.getCurrentTimeAxisMin(), plot.getCurrentTimeAxisMax()); }
PanAndZoomManager { public void panAction(PanDirection panningAction) { XYAxis xAxis = plot.getPlotView().getXAxis(); XYAxis yAxis = plot.getPlotView().getYAxis(); if (plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) { double nonTimeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); double timeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } } else { double nonTimeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); double timeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(nonTimeScalePanAmount); pinNonTime(); } } plot.getPlotAbstraction().updateResetButtons(); plot.refreshDisplay(); plot.clearAllDataFromPlot(); plot.getLimitManager().setModeUntranslated(false); plot.getPlotAbstraction().requestPlotData(plot.getCurrentTimeAxisMin(), plot.getCurrentTimeAxisMax()); } }
PanAndZoomManager { public void panAction(PanDirection panningAction) { XYAxis xAxis = plot.getPlotView().getXAxis(); XYAxis yAxis = plot.getPlotView().getYAxis(); if (plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) { double nonTimeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); double timeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } } else { double nonTimeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); double timeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(nonTimeScalePanAmount); pinNonTime(); } } plot.getPlotAbstraction().updateResetButtons(); plot.refreshDisplay(); plot.clearAllDataFromPlot(); plot.getLimitManager().setModeUntranslated(false); plot.getPlotAbstraction().requestPlotData(plot.getCurrentTimeAxisMin(), plot.getCurrentTimeAxisMax()); } PanAndZoomManager(PlotterPlot quinnCurtisPlot); }
PanAndZoomManager { public void panAction(PanDirection panningAction) { XYAxis xAxis = plot.getPlotView().getXAxis(); XYAxis yAxis = plot.getPlotView().getYAxis(); if (plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) { double nonTimeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); double timeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } } else { double nonTimeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); double timeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(nonTimeScalePanAmount); pinNonTime(); } } plot.getPlotAbstraction().updateResetButtons(); plot.refreshDisplay(); plot.clearAllDataFromPlot(); plot.getLimitManager().setModeUntranslated(false); plot.getPlotAbstraction().requestPlotData(plot.getCurrentTimeAxisMin(), plot.getCurrentTimeAxisMax()); } PanAndZoomManager(PlotterPlot quinnCurtisPlot); void enteredPanMode(); void exitedPanMode(); void enteredZoomMode(); void exitedZoomMode(); boolean isInZoomMode(); boolean isInPanMode(); void panAction(PanDirection panningAction); void zoomAction(ZoomDirection zoomAction); }
PanAndZoomManager { public void panAction(PanDirection panningAction) { XYAxis xAxis = plot.getPlotView().getXAxis(); XYAxis yAxis = plot.getPlotView().getYAxis(); if (plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) { double nonTimeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); double timeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } } else { double nonTimeScalePanAmount = xAxis.getEnd() - xAxis.getStart(); double timeScalePanAmount = yAxis.getEnd() - yAxis.getStart(); timeScalePanAmount = (timeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; nonTimeScalePanAmount= (nonTimeScalePanAmount/100) * PlotConstants.PANNING_PERCENTAGE; if (panningAction == PanDirection.PAN_HIGHER_Y_AXIS) { yAxis.shift(timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_Y_AXIS) { yAxis.shift(-timeScalePanAmount); pinTime(); plot.notifyObserversTimeChange(); } else if (panningAction == PanDirection.PAN_LOWER_X_AXIS) { xAxis.shift(-nonTimeScalePanAmount); pinNonTime(); } else if (panningAction == PanDirection.PAN_HIGHER_X_AXIS) { xAxis.shift(nonTimeScalePanAmount); pinNonTime(); } } plot.getPlotAbstraction().updateResetButtons(); plot.refreshDisplay(); plot.clearAllDataFromPlot(); plot.getLimitManager().setModeUntranslated(false); plot.getPlotAbstraction().requestPlotData(plot.getCurrentTimeAxisMin(), plot.getCurrentTimeAxisMax()); } PanAndZoomManager(PlotterPlot quinnCurtisPlot); void enteredPanMode(); void exitedPanMode(); void enteredZoomMode(); void exitedZoomMode(); boolean isInZoomMode(); boolean isInPanMode(); void panAction(PanDirection panningAction); void zoomAction(ZoomDirection zoomAction);  }