PlotDataManager implements AbstractPlotDataManager { public void informResizeEvent() { Rectangle bounds = plot.getPlotView().getContents().getBounds(); int currentSize = (int) ( (plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) ? bounds.getWidth() : bounds.getHeight() ) ; if (currentSize != previousTimeAxisDimensionSize) { resizeTimmer.restart(); } previousTimeAxisDimensionSize = currentSize; } PlotDataManager(PlotterPlot thePlot); @Override void addDataSet(String dataSetName, Color plottingColor); @Override void addData(String feed, SortedMap<Long, Double> points); void resizeAndReloadPlotBuffer(); @Override void informUpdateCacheDataStreamStarted(); void informResizeEvent(); @Override PlotDataSeries getNamedDataSeries(String name); void setDataSeries(Map<String, PlotDataSeries> dataSeries); Map<String, PlotDataSeries> getDataSeries(); void setPlot(PlotterPlot plot); AbstractPlottingPackage getPlot();  }
@Test public void testInformResizeEvent() { PlotAbstraction plot = new PlotView.Builder(PlotterPlot.class). build(); PlotterPlot testPlot = (PlotterPlot) plot.returnPlottingPackage(); TestPlotDataManagerImplementation dm = new TestPlotDataManagerImplementation(testPlot); testPlot.setPlotDataManager(dm); dm.resizeAndReloadCalled = false; dm.informResizeEvent(); try { Thread.sleep(PlotConstants.RESIZE_TIMER + 2000); } catch (Exception e) { } Assert.assertTrue(dm.resizeAndReloadCalled); }