Package plotter.xy

Examples of plotter.xy.XYAxis


    .build();
    testPlot.setManifestation(mockPlotViewManifestation);
   
    PlotterPlot qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis xAxis = qcPlot.getPlotView().getXAxis();
    XYAxis yAxis = qcPlot.getPlotView().getYAxis();
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
    testPlot.addDataSet("DataSet1");
    testPlot.addData("DataSet1", time.getTimeInMillis(), 1);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
    time.add(Calendar.MINUTE, 1);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 11);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
   
    time.add(Calendar.MINUTE, 20);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 50);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
  }
View Full Code Here


    .build();
    testPlot.setManifestation(mockPlotViewManifestation);
   
    PlotterPlot qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis xAxis = qcPlot.getPlotView().getXAxis();
    XYAxis yAxis = qcPlot.getPlotView().getYAxis();
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
    testPlot.addDataSet("DataSet1");
    testPlot.addData("DataSet1", time.getTimeInMillis(), 1);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
    time.add(Calendar.MINUTE, 1);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 11);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
   
    time.add(Calendar.MINUTE, 20);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 50);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
  }
View Full Code Here

    .build();
    testPlot.setManifestation(mockPlotViewManifestation);
   
    PlotterPlot qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis xAxis = qcPlot.getPlotView().getXAxis();
    XYAxis yAxis = qcPlot.getPlotView().getYAxis();
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
    testPlot.addDataSet("DataSet1");
    testPlot.addData("DataSet1", time.getTimeInMillis(), 1);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
    time.add(Calendar.MINUTE, 1);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 11);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
   
    time.add(Calendar.MINUTE, 20);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 50);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
  }
View Full Code Here

    .build();
    testPlot.setManifestation(mockPlotViewManifestation);
   
    PlotterPlot qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis xAxis = qcPlot.getPlotView().getXAxis();
    XYAxis yAxis = qcPlot.getPlotView().getYAxis();
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
    testPlot.addDataSet("DataSet1");
    testPlot.addData("DataSet1", time.getTimeInMillis(), 1);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
    time.add(Calendar.MINUTE, 1);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 11);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
   
    time.add(Calendar.MINUTE, 20);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 50);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
  }
View Full Code Here

    .build();
    testPlot.setManifestation(mockPlotViewManifestation);
   
    PlotterPlot qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis xAxis = qcPlot.getPlotView().getXAxis();
    XYAxis yAxis = qcPlot.getPlotView().getYAxis();
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
    testPlot.addDataSet("DataSet1");
    testPlot.addData("DataSet1", time.getTimeInMillis(), 1);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
    time.add(Calendar.MINUTE, 1);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 11);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
   
    time.add(Calendar.MINUTE, 20);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 50);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
  }
View Full Code Here

    .build();
    testPlot.setManifestation(mockPlotViewManifestation);
   
    PlotterPlot qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis xAxis = qcPlot.getPlotView().getXAxis();
    XYAxis yAxis = qcPlot.getPlotView().getYAxis();
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
    testPlot.addDataSet("DataSet1");
    testPlot.addData("DataSet1", time.getTimeInMillis(), 1);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
    time.add(Calendar.MINUTE, 1);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 11);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
   
   
    time.add(Calendar.MINUTE, 20);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 50);
   
    Assert.assertTrue(yAxis.getStart() > yAxis.getEnd());
    Assert.assertTrue(xAxis.getStart() > xAxis.getEnd());
  }
View Full Code Here

    .build();
    testPlot.setManifestation(mockPlotViewManifestation);
   
    PlotterPlot qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis xAxis = qcPlot.getPlotView().getXAxis();
    XYAxis yAxis = qcPlot.getPlotView().getYAxis();
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
    testPlot.addDataSet("DataSet1");
    testPlot.addData("DataSet1", time.getTimeInMillis(), 1);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
    time.add(Calendar.MINUTE, 1);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 11);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
   
    time.add(Calendar.MINUTE, 20);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 50);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
  }
View Full Code Here

    .build();
    testPlot.setManifestation(mockPlotViewManifestation);
   
    PlotterPlot qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis xAxis = qcPlot.getPlotView().getXAxis();
    XYAxis yAxis = qcPlot.getPlotView().getYAxis();
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
    testPlot.addDataSet("DataSet1");
    testPlot.addData("DataSet1", time.getTimeInMillis(), 1);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
    time.add(Calendar.MINUTE, 1);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 11);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
   
   
    time.add(Calendar.MINUTE, 20);
    testPlot.addData("DataSet1", time.getTimeInMillis(), 50);
   
    Assert.assertFalse(yAxis.getStart() > yAxis.getEnd());
    Assert.assertFalse(xAxis.getStart() > xAxis.getEnd());
  }
View Full Code Here

      legendManager.setVisible(true);
    }

    boolean visible = legendManager.isVisible();
    if(wasVisible != visible) {
      XYAxis yAxis = plotView.getYAxis();
      SpringLayout layout = (SpringLayout) plotView.getLayout();
      if (getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) {
        if(visible) {
          layout.putConstraint(SpringLayout.WEST, yAxis, 0, SpringLayout.EAST, legendManager);
        } else {
          layout.putConstraint(SpringLayout.WEST, yAxis, 0, SpringLayout.WEST, plotView);
        }
      } else {
        /* Make room for axis labels, but only if they're non-empty */
        if (yAxis.getComponentCount() > 0) {
          layout.putConstraint(SpringLayout.WEST, yAxis, 2, SpringLayout.EAST, legendManager);
        } else {
          /* Otherwise, push up against the plot contents */
          layout.putConstraint(SpringLayout.WEST, legendManager, 5, SpringLayout.WEST, plotView);
          layout.putConstraint(SpringLayout.WEST, yAxis, 2, SpringLayout.EAST, legendManager);
View Full Code Here

    return inPanMode;
  }

 
  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();
View Full Code Here

TOP

Related Classes of plotter.xy.XYAxis

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.