Package plotter.xy

Examples of plotter.xy.CompressingXYDataset$MinMaxChangeListener


   
    PlotDataManager dataManager = new PlotDataManager(plot);
    setMemberVariable("plotDataManager", dataManager);
    dataManager.addDataSet("TestData", Color.black);
    PlotDataSeries dataSeries = dataManager.getDataSeries().get("TestData");
    CompressingXYDataset dataSet = dataSeries.getData();
    dataSet.setCompressionScale(1);
    addToDataSet(setting, dataSet, 0, 100);
    addToDataSet(setting, dataSet, 5, 101);
    plot.newPointPlotted(100,0);
    plot.newPointPlotted(101,5);
 
    // test the case where the new point is less than the current data maximum, no change should occur
    addToDataSet(setting, dataSet, 4, 101.5);
    plot.newPointPlotted(new Double(101.5).longValue(), 4);
    Assert.assertEquals(nonTime.getStart(),initialStart);
    Assert.assertEquals(nonTime.getEnd(), 5.0);
   
    // test the case where the new point is less than the current axis, no change should occur
    // 2/26/12 Change in axis now occurs because non-Time axis responds to new max 6 in auto-adjust and semi-fixed mode.
    addToDataSet(setting, dataSet, 6, 102);
    plot.newPointPlotted(102, 6);
    Assert.assertEquals(nonTime.getStart(),initialStart);
    Assert.assertEquals(nonTime.getEnd(), 6.0);
   
    // test the case where the new point is greater than the current axis, the axis should increase (or decrease)
    // this should include the padding
    double newMax = 15;
    addToDataSet(setting, dataSet, newMax, 103);
    plot.newPointPlotted(103, newMax);
    Assert.assertEquals(nonTime.getStart(),initialStart);
    Assert.assertEquals(nonTime.getEnd(), newMax);
   
    // test the case where the axis has now been collapsed back to the settings value
    // if a new value comes in that is below the max value but above the current state of the axis, the axis should
    // increase to the maximum value
    nonTime.setEnd(initialEnd);
    double twelve = 12;
    addToDataSet(setting, dataSet, twelve, 104);
    plot.newPointPlotted(104, twelve);
    Assert.assertEquals(nonTime.getStart(),initialStart);
    Assert.assertEquals(nonTime.getEnd(), newMax);
   
    // test where the max value has been truncated off the time line
    // The axis should contract down to 12.0, because newMax has been truncated off
    addToDataSet(setting, dataSet, 10, 105);
    plot.newPointPlotted(105, 10);
    addToDataSet(setting, dataSet, 10, 106);
    plot.newPointPlotted(106, 10);
    addToDataSet(setting, dataSet, 10, 107);
    plot.newPointPlotted(107, 10);
    dataSet.setTruncationOffset(0);
    dataSet.setTruncationPoint(104);
    addToDataSet(setting, dataSet, 10, 108);
    plot.newPointPlotted(108, 10);

    Assert.assertEquals(nonTime.getStart(),initialStart);
    Assert.assertEquals(nonTime.getEnd(), 12.0);
View Full Code Here

TOP

Related Classes of plotter.xy.CompressingXYDataset$MinMaxChangeListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.