PlotTimeSyncLine implements MouseListener, MouseMotionListener { void removeTimeSyncLine() { if (timeSyncLinePlot != null) { plot.setUserOperationLockedState(false); XYPlotContents contents = plot.getPlotView().getContents(); contents.remove(timeSyncLinePlot); contents.repaint(); timeSyncLinePlot = null; syncTime = null; } } PlotTimeSyncLine(PlotterPlot thePlot); boolean inTimeSyncMode(); void informShiftKeyState(boolean state); @Override void mouseClicked(MouseEvent e); @Override void mouseEntered(MouseEvent e); @Override void mouseExited(MouseEvent e); @Override void mousePressed(MouseEvent e); @Override void mouseReleased(MouseEvent e); @Override void mouseDragged(MouseEvent e); @Override void mouseMoved(MouseEvent e);  }
@Test public void testProgramaticRequestsEstablishSyncLine() { PlotView testPlot = new PlotView.Builder(PlotterPlot.class).build(); testPlot.setManifestation(mockPlotViewManifestation); testPlot.addDataSet("Foo"); testPlot.addData("Foo", System.currentTimeMillis(), 10); Assert.assertFalse(testPlot.isTimeSyncLineVisible()); testPlot.showTimeSyncLine(new GregorianCalendar()); Assert.assertTrue(testPlot.isTimeSyncLineVisible()); testPlot.removeTimeSyncLine(); Assert.assertFalse(testPlot.isTimeSyncLineVisible()); PlotSettings settings = new PlotSettings(); settings.setAxisOrientationSetting(AxisOrientationSetting.Y_AXIS_AS_TIME); testPlot = new PlotView.Builder(PlotterPlot.class).plotSettings(settings).build(); testPlot.setManifestation(mockPlotViewManifestation); testPlot.addDataSet("Foo"); testPlot.addData("Foo", System.currentTimeMillis(), 10); Assert.assertFalse(testPlot.isTimeSyncLineVisible()); testPlot.showTimeSyncLine(new GregorianCalendar()); Assert.assertTrue(testPlot.isTimeSyncLineVisible()); testPlot.removeTimeSyncLine(); Assert.assertFalse(testPlot.isTimeSyncLineVisible()); }