Examples of XYAxis


Examples of plotter.xy.XYAxis

    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

Examples of plotter.xy.XYAxis

      plot.getLimitManager().setModeUntranslated(false);
    }
  }

  public void zoomAction(ZoomDirection zoomAction) {
    XYAxis xAxis = plot.getPlotView().getXAxis();
    XYAxis yAxis = plot.getPlotView().getYAxis();
    if (plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) {
      double nonTimeScaleZoomAmount = yAxis.getEnd() - yAxis.getStart();
      double timeScaleZoomAmount = xAxis.getEnd() - xAxis.getStart();
     
      timeScaleZoomAmount = (timeScaleZoomAmount/100) * PlotConstants.ZOOMING_TIME_AXIS_PERCENTAGE;
      nonTimeScaleZoomAmount= (nonTimeScaleZoomAmount/100) * PlotConstants.ZOOMING_TIME_AXIS_PERCENTAGE;
     
      if (zoomAction == ZoomDirection.ZOOM_IN_HIGH_Y_AXIS) {
        yAxis.setEnd(yAxis.getEnd() - nonTimeScaleZoomAmount);
          markNonTimeZoomed();
      } else if (zoomAction == ZoomDirection.ZOOM_OUT_HIGH_Y_AXIS) {
        yAxis.setEnd(yAxis.getEnd() + nonTimeScaleZoomAmount);
          markNonTimeZoomed();
      } else if (zoomAction == ZoomDirection.ZOOM_IN_CENTER_Y_AXIS) {
        yAxis.setStart(yAxis.getStart() + nonTimeScaleZoomAmount);
        yAxis.setEnd(yAxis.getEnd() - nonTimeScaleZoomAmount);
          markNonTimeZoomed();
      } else if (zoomAction == ZoomDirection.ZOOM_OUT_CENTER_Y_AXIS) {
        yAxis.setStart(yAxis.getStart() - nonTimeScaleZoomAmount);
        yAxis.setEnd(yAxis.getEnd() + nonTimeScaleZoomAmount);
          markNonTimeZoomed();
      } else if (zoomAction == ZoomDirection.ZOOM_IN_LOW_Y_AXIS) {
        yAxis.setStart(yAxis.getStart() + nonTimeScaleZoomAmount);
          markNonTimeZoomed();
      } else if (zoomAction == ZoomDirection.ZOOM_OUT_LOW_Y_AXIS) {
        yAxis.setStart(yAxis.getStart() - nonTimeScaleZoomAmount);
          markNonTimeZoomed();
      } else if (zoomAction == ZoomDirection.ZOOM_IN_LEFT_X_AXIS) {
        xAxis.setStart(xAxis.getStart() + timeScaleZoomAmount);
          markTimeZoomed();
         plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_OUT_LEFT_X_AXIS) {
          xAxis.setStart(xAxis.getStart() - timeScaleZoomAmount);
          markTimeZoomed();
          plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_IN_CENTER_X_AXIS) {
        xAxis.setStart(xAxis.getStart() + timeScaleZoomAmount);
        xAxis.setEnd(xAxis.getEnd() - timeScaleZoomAmount);
          markTimeZoomed();
          plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_OUT_CENTER_X_AXIS) {
        xAxis.setStart(xAxis.getStart() - timeScaleZoomAmount);
        xAxis.setEnd(xAxis.getEnd() + timeScaleZoomAmount);
          markTimeZoomed();
          plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_IN_RIGHT_X_AXIS) {
        xAxis.setEnd(xAxis.getEnd() - timeScaleZoomAmount);
          markTimeZoomed();
          plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_OUT_RIGHT_X_AXIS) {
        xAxis.setEnd(xAxis.getEnd() + timeScaleZoomAmount);
          markTimeZoomed();
          plot.notifyObserversTimeChange();
      }
   
    } else {
      double nonTimeScaleZoomAmount = xAxis.getEnd() - xAxis.getStart();
      double timeScaleZoomAmount = yAxis.getEnd() - yAxis.getStart();
     
      timeScaleZoomAmount = (timeScaleZoomAmount/100) * PlotConstants.ZOOMING_TIME_AXIS_PERCENTAGE;
      nonTimeScaleZoomAmount = (nonTimeScaleZoomAmount/100) * PlotConstants.ZOOMING_TIME_AXIS_PERCENTAGE;
     
      if (zoomAction == ZoomDirection.ZOOM_IN_HIGH_Y_AXIS) {
          yAxis.setEnd(yAxis.getEnd() - timeScaleZoomAmount);
          markTimeZoomed();
          plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_OUT_HIGH_Y_AXIS) {
        yAxis.setEnd(yAxis.getEnd() + timeScaleZoomAmount);
          markTimeZoomed();
         plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_IN_CENTER_Y_AXIS) {
          yAxis.setStart(yAxis.getStart() + timeScaleZoomAmount);
          yAxis.setEnd(yAxis.getEnd() - timeScaleZoomAmount);
          markTimeZoomed();
          plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_OUT_CENTER_Y_AXIS) {
        yAxis.setStart(yAxis.getStart() - timeScaleZoomAmount);
        yAxis.setEnd(yAxis.getEnd() + timeScaleZoomAmount);
          markTimeZoomed();
          plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_IN_LOW_Y_AXIS) {
        yAxis.setStart(yAxis.getStart() + timeScaleZoomAmount);
          markTimeZoomed();
         plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_OUT_LOW_Y_AXIS) {
        yAxis.setStart(yAxis.getStart() - timeScaleZoomAmount);
          markTimeZoomed();
          plot.notifyObserversTimeChange();
      } else if (zoomAction == ZoomDirection.ZOOM_IN_LEFT_X_AXIS) {
        xAxis.setStart(xAxis.getStart() + nonTimeScaleZoomAmount);
          markNonTimeZoomed();
View Full Code Here

Examples of plotter.xy.XYAxis

 
 
 
  @Test
  public void TestZoomingActionsTimeX() {
    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.zoomAction(ZoomDirection.ZOOM_IN_HIGH_Y_AXIS);

    double newXStart = xAxis.getStart();
    double newXStop = xAxis.getEnd();
    double newYStart = yAxis.getStart();
    double newYStop = yAxis.getEnd();
   
    Assert.assertEquals(newYStart, yStart);
    Assert.assertTrue(newYStop < yStop);
    Assert.assertEquals(newXStart, xStart);
    Assert.assertEquals(newXStop, xStop);
   
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_OUT_HIGH_Y_AXIS);
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_OUT_HIGH_Y_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertEquals(newYStart, yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertEquals(newXStart, xStart);
    Assert.assertEquals(newXStop, xStop);
   
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_IN_CENTER_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.zoomAction(ZoomDirection.ZOOM_OUT_CENTER_Y_AXIS);
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_OUT_CENTER_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.zoomAction(ZoomDirection.ZOOM_IN_LOW_Y_AXIS);
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_IN_LOW_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.zoomAction(ZoomDirection.ZOOM_OUT_LOW_Y_AXIS);
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_OUT_LOW_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.zoomAction(ZoomDirection.ZOOM_IN_LEFT_X_AXIS);
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_IN_LEFT_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertEquals(newXStop, xStop);
   
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_OUT_LEFT_X_AXIS);
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_OUT_LEFT_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertEquals(newXStop, xStop);
     
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_IN_CENTER_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
      Assert.assertTrue(newXStart > xStart);
      Assert.assertTrue(newXStop < xStop);
      Assert.assertTrue(newYStart < yStart);
      Assert.assertTrue(newYStop > yStop);
   
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_OUT_CENTER_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertTrue(newXStop < xStop);
   
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_IN_RIGHT_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertTrue(newXStop < xStop);

   
    panAndZoomManagerTimeOnX.zoomAction(ZoomDirection.ZOOM_OUT_RIGHT_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertTrue(newXStop < xStop)
View Full Code Here

Examples of plotter.xy.XYAxis

    Assert.assertTrue(newXStop < xStop)
  }
 
  @Test
  public void TestZoomingActionsTimeY() {
    XYAxis xAxis = plotTimeOnY.getPlotView().getXAxis();
    XYAxis yAxis = plotTimeOnY.getPlotView().getYAxis();
   
    double xStart = xAxis.getStart();
    double xStop = xAxis.getEnd()
    double yStart = yAxis.getStart();
    double yStop = yAxis.getEnd();
   
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_IN_HIGH_Y_AXIS);

    double newXStart = xAxis.getStart();
    double newXStop = xAxis.getEnd();
    double newYStart = yAxis.getStart();
    double newYStop = yAxis.getEnd();
   
    Assert.assertEquals(newYStart, yStart);
    Assert.assertTrue(newYStop < yStop);
    Assert.assertEquals(newXStart, xStart);
    Assert.assertEquals(newXStop, xStop);
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_HIGH_Y_AXIS);
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_HIGH_Y_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertEquals(newYStart, yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertEquals(newXStart, xStart);
    Assert.assertEquals(newXStop, xStop);
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_IN_CENTER_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);
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_CENTER_Y_AXIS);
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_CENTER_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);
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_IN_LOW_Y_AXIS);
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_IN_LOW_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);
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_LOW_Y_AXIS);
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_LOW_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);
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_IN_LEFT_X_AXIS);
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_IN_LEFT_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertEquals(newXStop, xStop);
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_LEFT_X_AXIS);
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_LEFT_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertEquals(newXStop, xStop);
     
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_IN_CENTER_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
      Assert.assertTrue(newXStart > xStart);
      Assert.assertTrue(newXStop < xStop);
      Assert.assertTrue(newYStart < yStart);
      Assert.assertTrue(newYStop > yStop);
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_CENTER_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertTrue(newXStop < xStop);
   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_IN_RIGHT_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertTrue(newXStop < xStop);

   
    panAndZoomManagerTimeOnY.zoomAction(ZoomDirection.ZOOM_OUT_RIGHT_X_AXIS);
   
    newXStart = xAxis.getStart();
    newXStop = xAxis.getEnd();
    newYStart = yAxis.getStart();
    newYStop = yAxis.getEnd();
   
    Assert.assertTrue(newYStart < yStart);
    Assert.assertTrue(newYStop > yStop);
    Assert.assertTrue(newXStart > xStart);
    Assert.assertTrue(newXStop < xStop);
View Full Code Here

Examples of plotter.xy.XYAxis

    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setup();
    Timer timer = new Timer();

    final LinearXYAxis yAxis = (LinearXYAxis) frame.getYAxis();
    final XYAxis xAxis = frame.getXAxis();
    yAxis.setTickMarkCalculator(new TimeTickMarkCalculator());
    yAxis.setFormat(new DateNumberFormat(new SimpleDateFormat("yyyy-MM-dd\nHH:mm:ss.SSS")));
    yAxis.setPreferredSize(new Dimension(100, 50));
    xAxis.setStartMargin(100);

    final LinearXYPlotLine line = new LinearXYPlotLine(xAxis, yAxis, XYDimension.Y);
    line.setForeground(Color.white);
    final SimpleXYDataset d = new SimpleXYDataset(line);
    d.setMaxCapacity(1000);
    d.setXData(line.getXData());
    d.setYData(line.getYData());
    final XYMarkerLine marker = new XYMarkerLine(xAxis, 60);
    marker.setForeground(Color.yellow);
    XYPlotContents contents = frame.getContents();
    contents.add(marker);
    final XYMarkerLine marker2 = new XYMarkerLine(yAxis, .5);
    marker2.setForeground(Color.red);
    contents.add(marker2);
    frame.addPlotLine(line);

    yAxis.setStart(0);
    yAxis.setEnd(10);
    xAxis.setStart(-1.2);
    xAxis.setEnd(1.2);

    frame.getLocationDisplay().setFormat(new MessageFormat("<html><b>X:</b> {0} &nbsp; <b>Y:</b> {1,date,HH:mm:ss}</html>"));
    frame.getSlopeLineDisplay().setFormat(new MessageFormat("<html><b>&Delta;x:</b> {0}  <b>&Delta;y:</b> {1,date,HH:mm:ss}</html>"));

    timer.schedule(new TimerTask() {
View Full Code Here

Examples of plotter.xy.XYAxis

    if (canvas != null) {
      xyPlot.getContents().remove(canvas);
      Point2D startCoord = convertPointToLogicalCoord(mouseStartX, mouseStartY);
      Point2D endCoord = convertPointToLogicalCoord(mouseEndX, mouseEndY);
     
      XYAxis xAxis = xyPlot.getXAxis();
      if (endCoord.getX() > startCoord.getX()) {       
        xAxis.setStart(startCoord.getX());
        xAxis.setEnd(endCoord.getX());
      } else {
        xAxis.setStart(endCoord.getX());
        xAxis.setEnd(startCoord.getX());       
      }
     
      XYAxis  yAxis = xyPlot.getYAxis();
      if (endCoord.getY() > startCoord.getY()) {
        yAxis.setStart(startCoord.getY());
        yAxis.setEnd(endCoord.getY());
      } else {
        yAxis.setStart(endCoord.getY());
        yAxis.setEnd(startCoord.getY());       
      }
     
      plotLocalControlsManager.pinXYAxesAfterZoomedIn();
      marqueeRect = null;
      canvas = null;
View Full Code Here

Examples of plotter.xy.XYAxis

    }
  }
 
  private void realign (XYPlotComponents xyPlotComps, int yAxisWidth, int legendWidth, int fullWidth, int fullHeight) {
    XYPlot plot  = xyPlotComps.getPlot();
    XYAxis yAxis = xyPlotComps.getYAxis();
    LegendManager legend = xyPlotComps.getLegend();
       
    yAxis.setPreferredSize(new Dimension ( yAxisWidth,
      yAxis.getPreferredSize().height));     
   
    /* X Axis starts at left edge of Y Axis, so margin must equal Y Axis width */
    xyPlotComps.getXAxis().setStartMargin(yAxisWidth);
     
    legend.setPreferredSize(new Dimension(legendWidth,
View Full Code Here

Examples of plotter.xy.XYAxis

    panAndZoomManagerTimeOnX.exitedZoomMode();
  }
 
  @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);
View Full Code Here

Examples of plotter.xy.XYAxis

  }
 
 
  @Test
  public void TestPanningActionsTimeOnY() {
    XYAxis xAxis = plotTimeOnY.getPlotView().getXAxis();
    XYAxis yAxis = plotTimeOnY.getPlotView().getYAxis();

    double xStart = xAxis.getStart();
    double xStop = xAxis.getEnd();
   
    double yStart = yAxis.getStart();
    double yStop = yAxis.getEnd();
   
   
    panAndZoomManagerTimeOnY.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);
   
    panAndZoomManagerTimeOnY.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);
   
    panAndZoomManagerTimeOnY.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);
   
    panAndZoomManagerTimeOnY.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);
   
    panAndZoomManagerTimeOnY.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);
   
    panAndZoomManagerTimeOnY.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);
   
    panAndZoomManagerTimeOnY.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);
View Full Code Here

Examples of plotter.xy.XYAxis

    .plotSettings(settings)
    .build()

    PlotterPlot qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis yAxis = qcPlot.getPlotView().getYAxis();
    yAxis.setStart(10.0);
    yAxis.setEnd(99.0);
   
    qcPlot.resetNonTimeAxisToOriginalValues();

    Assert.assertEquals(plotNonTimeMin,  yAxis.getStart());
    Assert.assertEquals(plotNonTimeMax,  yAxis.getEnd());

    settings = new PlotSettings();
    settings.setMinTime(plotStartTime.getTimeInMillis());
    settings.setMaxTime(plotEndTime.getTimeInMillis());
    settings.setMinNonTime(plotNonTimeMin);
    settings.setMaxNonTime(plotNonTimeMax);
    settings.setAxisOrientationSetting(AxisOrientationSetting.X_AXIS_AS_TIME);
    settings.setYAxisMaximumLocation(YAxisMaximumLocationSetting.MAXIMUM_AT_BOTTOM);
   
    testPlot = new PlotView.Builder(PlotterPlot.class)
    .plotSettings(settings)
    .build()

        qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
        yAxis = qcPlot.getPlotView().getYAxis();
   
    yAxis.setStart(10.0);
    yAxis.setEnd(99.0);
   
    qcPlot.resetNonTimeAxisToOriginalValues();

    Assert.assertEquals(plotNonTimeMin,  yAxis.getEnd());
    Assert.assertEquals(plotNonTimeMax,  yAxis.getStart());
   
    settings = new PlotSettings();
    settings.setMinTime(plotStartTime.getTimeInMillis());
    settings.setMaxTime(plotEndTime.getTimeInMillis());
    settings.setMinNonTime(plotNonTimeMin);
    settings.setMaxNonTime(plotNonTimeMax);
    settings.setAxisOrientationSetting(AxisOrientationSetting.Y_AXIS_AS_TIME);
    settings.setXAxisMaximumLocation(XAxisMaximumLocationSetting.MAXIMUM_AT_RIGHT);
   
    testPlot = new PlotView.Builder(PlotterPlot.class)
    .plotSettings(settings)
    .build()

        qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    XYAxis xAxis = qcPlot.getPlotView().getXAxis();
    xAxis.setStart(10.0);
    xAxis.setEnd(99.0);
   
    qcPlot.resetNonTimeAxisToOriginalValues();
   
    Assert.assertEquals(plotNonTimeMin,  xAxis.getStart());
    Assert.assertEquals(plotNonTimeMax,  xAxis.getEnd());
   
    settings = new PlotSettings();
    settings.setMinTime(plotStartTime.getTimeInMillis());
    settings.setMaxTime(plotEndTime.getTimeInMillis());
    settings.setMinNonTime(plotNonTimeMin);
    settings.setMaxNonTime(plotNonTimeMax);
    settings.setAxisOrientationSetting(AxisOrientationSetting.Y_AXIS_AS_TIME);
    settings.setXAxisMaximumLocation(XAxisMaximumLocationSetting.MAXIMUM_AT_LEFT);
   
    testPlot = new PlotView.Builder(PlotterPlot.class)
    .plotSettings(settings)
    .build()

        qcPlot = (PlotterPlot) testPlot.returnPlottingPackage();
   
    xAxis = qcPlot.getPlotView().getXAxis();
    xAxis.setStart(10.0);
    xAxis.setEnd(99.0);
   
    qcPlot.resetNonTimeAxisToOriginalValues();
   
    Assert.assertEquals(plotNonTimeMin,  xAxis.getEnd());
    Assert.assertEquals(plotNonTimeMax,  xAxis.getStart())
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.