Package gov.nasa.arc.mct.fastplot.view

Examples of gov.nasa.arc.mct.fastplot.view.Axis


    plot.clearAllDataFromPlot();
    plot.getPlotAbstraction().requestPlotData(plot.getCurrentTimeAxisMin(), plot.getCurrentTimeAxisMax());
  }
 
  private void resetNonTimeAxis() {
    Axis axis = plot.getNonTimeAxis();
    plot.getNonTimeAxisUserPin().setPinned(false);
    axis.setZoomed(false);
    plot.resetNonTimeAxisToOriginalValues();
    plot.setNonTimeMinFixed(plot.isNonTimeMinFixedByPlotSettings());
    plot.setNonTimeMaxFixed(plot.isNonTimeMaxFixedByPlotSettings());
    plot.getLimitManager().setModeUntranslated(true);
    refreshPlotValues();
View Full Code Here


    }
  }
 

  public void updateButtons() {
    Axis timeAxis = plot.getPlotAbstraction().getTimeAxis();
    Axis nonTimeAxis = plot.getNonTimeAxis();
    Axis xAxis;
    Axis yAxis;
    if(plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) {
      xAxis = timeAxis;
      yAxis = nonTimeAxis;
    } else {
      xAxis = nonTimeAxis;
      yAxis = timeAxis;
    }

    List<AbstractPlottingPackage> plots = plot.getPlotAbstraction().getSubPlots();
    // Only show the top right reset button on the top plot.
    if(plots.get(0) == plot) {
      // This was changed to fix MCT-2613: [Plot] Top right corner button appears briefly in jump and scrunch modes, between the time that the plot line hits the end of the time axis and when the jump
      // The problem was that the jump occurs based on the maximum time plotted, which due to compression, is not the same as the current MCT time.
      // As an easy fix, the button is always hidden when the time axis is not pinned.
      // Assuming that data should never appear off the right of a jump plot, this works well enough.
      // If that assumption breaks, the code should be modified to check against the maximum plotted time instead of the current MCT time.
      long now = plot.getPlotAbstraction().getCurrentMCTTime();
      if(!timeAxis.isPinned()) {
        plot.localControlsManager.setJumpToCurrentTimeButtonVisible(false);
      } else if(plot.getMaxTime() < now || plot.getMinTime() > now) {
        plot.localControlsManager.setJumpToCurrentTimeButtonAlarm(true);
      } else {
        plot.localControlsManager.setJumpToCurrentTimeButtonAlarm(false);
      }
    } else {
      plot.localControlsManager.setJumpToCurrentTimeButtonVisible(false);
    }
    // Only show the time axis reset button on the bottom plot.
    boolean enableX = true;
    boolean enableY = true;
    if(plots.get(plots.size() - 1) != plot) {
      if(plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) {
        enableX = false;
      } else {
        enableY = false;
      }
    }

    plot.localControlsManager.setXAxisCornerResetButtonVisible(enableX && !xAxis.isInDefaultState());
    plot.localControlsManager.setYAxisCornerResetButtonVisible(enableY && !yAxis.isInDefaultState());
    plot.localControlsManager.setXAndYAxisCornerResetButtonVisible(!xAxis.isInDefaultState() && !yAxis.isInDefaultState());
  }
View Full Code Here

 
  @BeforeMethod
  public void setup() {
    MockitoAnnotations.initMocks(this);
    Mockito.when(plotView.getCurrentMCTTime()).thenReturn(new GregorianCalendar().getTimeInMillis());
      Mockito.when(plotView.getTimeAxis()).thenReturn(new Axis());
      Mockito.when(plotView.getSubPlots()).thenReturn(plots);
    final PinSupport pins = new PinSupport();
    Mockito.when(plotView.createPin()).thenAnswer(new Answer<Pinnable>() {
      @Override
      public Pinnable answer(InvocationOnMock invocation) throws Throwable {
View Full Code Here

    PlotterPlot plotPackage  = (PlotterPlot) testPlot.returnPlottingPackage();

    plotPackage.setPlotAbstraction(plotView);
    PlotDataManager plotDataManager = (PlotDataManager) plotPackage.getPlotDataManager();
    plotDataManager.setupPlotBufferMinAndMaxTimes();
    Mockito.when(plotView.getTimeAxis()).thenReturn(new Axis());

    plotDataManager.addDataSet("dataset", Color.white);
    plotDataManager.addData("dataset", new TreeMap<Long,Double>(Collections.singletonMap(maxTime.getTimeInMillis() + 1, 1.0)));
  }
View Full Code Here

    plotPackage.setPlotAbstraction(plotView);
    PlotDataManager plotDataManager = (PlotDataManager) plotPackage.getPlotDataManager();
    plotDataManager.setupPlotBufferMinAndMaxTimes();

    Mockito.when(plotView.getTimeAxis()).thenReturn(new Axis());
    Mockito.when(plotView.getPlotLineDraw()).thenReturn(PlotConstants.DEFAULT_PLOT_LINE_DRAW);
    Axis timeAxis = plotPackage.getPlotAbstraction().getTimeAxis();
    Assert.assertNotNull(timeAxis);
    timeAxis.createPin().setPinned(true);

    plotDataManager.addDataSet("dataset", Color.white);
    plotDataManager.addData("dataset", new TreeMap<Long,Double>(Collections.singletonMap(maxTime.getTimeInMillis() + 1, 1.0)));
  }
View Full Code Here

    plotPackage.setPlotAbstraction(plotView);
    PlotDataManager plotDataManager = (PlotDataManager) plotPackage.getPlotDataManager();
    plotDataManager.setupPlotBufferMinAndMaxTimes();

    Mockito.when(plotView.getTimeAxis()).thenReturn(new Axis());
    Axis timeAxis = plotPackage.getPlotAbstraction().getTimeAxis();
    Assert.assertNotNull(timeAxis);
    timeAxis.createPin().setPinned(true);

    plotDataManager.addDataSet("dataset", Color.white);
    plotDataManager.addData("dataset", new TreeMap<Long,Double>(Collections.singletonMap((minTime.getTimeInMillis() + maxTime.getTimeInMillis()) / 2, 1.0)));
  }
View Full Code Here

    plotPackage.setPlotAbstraction(plotView);
    PlotDataManager plotDataManager = (PlotDataManager) plotPackage.getPlotDataManager();
    plotDataManager.setupPlotBufferMinAndMaxTimes();

    Mockito.when(plotView.getTimeAxis()).thenReturn(new Axis());

    plotDataManager.addDataSet("dataset", Color.white);
    PlotDataSeries series = plotDataManager.getDataSeries().get("dataset");
    series.dataset.setCompressionScale(1);
    long time1 = (minTime.getTimeInMillis() + maxTime.getTimeInMillis()) / 2;
View Full Code Here

  public void setup() {
    MockitoAnnotations.initMocks(this);
    PinSupport pins = new PinSupport();
   
    Mockito.when(plotAbstraction.getCurrentMCTTime()).thenReturn(new GregorianCalendar().getTimeInMillis());
    Mockito.when(plotAbstraction.getTimeAxis()).thenReturn(new Axis());
    Mockito.when(plotAbstraction.getTimeAxisUserPin()).thenReturn(pins.createPin());
    Mockito.when(plotAbstraction.getPlotLineDraw()).thenReturn(new PlotLineDrawingFlags(true,false));

    PlotSettings settings = new PlotSettings();
    settings.setAxisOrientationSetting(AxisOrientationSetting.X_AXIS_AS_TIME);
View Full Code Here

//    mockPlot.yAxisSetting = YAxisMaximumLocationSetting.MAXIMUM_AT_TOP;
//    mockPlot.timeAxisSubsequentSetting = TimeAxisSubsequentBoundsSetting.JUMP;
//    mockPlot.nonTimeAxisMinSubsequentSetting = NonTimeAxisSubsequentBoundsSetting.AUTO;
//    mockPlot.nonTimeAxisMaxSubsequentSetting = NonTimeAxisSubsequentBoundsSetting.AUTO;

    Mockito.when(mockPlotAbstraction.getTimeAxis()).thenReturn(new Axis());
    Mockito.when(mockPlot.getPlotComponent()).thenReturn(new JPanel());
    final TimeXYAxis[] axis=new TimeXYAxis[1];
    Mockito.doAnswer(new Answer<Object>() {
      @Override
      public Object answer(InvocationOnMock invocation) throws Throwable {
View Full Code Here

    localControlsManager = new TestLocalControlsManager(plot);
    localControlsManager.setupLocalControlManager();
    plot.localControlsManager = localControlsManager;
    plot.dataCursor = dataCursor;
    plot.setPlotAbstraction(plotAbstraction);
    Mockito.when(plotAbstraction.getTimeAxis()).thenReturn(new Axis());
  }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.fastplot.view.Axis

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.