GridView
Class TwoDPlotManager

java.lang.Object
  extended by GridView.TwoDPlotManager

public class TwoDPlotManager
extends java.lang.Object

TwoDPlotManager class provides a unified interface to manage multiple two D plots, the plots can be shown as tabs, or in a drop down box: that decision is made by the Viewer class (the top level GUI). TwoDPlotManager class provides methods to perform operations on current plot, to close plots, to add new plots and to perform plot specific operations. Some of those operations could create new plots (eg, performing a discrete FFT on a data set creates the Fourier transform in a new plot window).

Since:
1.0
See Also:
TwoDPlotter

Field Summary
private  int m_iCurrPlotIndex
          Index of current plot.
private  java.util.ArrayList<TwoDPlotter<java.lang.Float>> m_PlotList
           
 
Constructor Summary
TwoDPlotManager()
           
TwoDPlotManager(int numPlots)
           
 
Method Summary
 TwoDPlotter<java.lang.Float> AddPlot()
          Adds a plot to the end of list, and sets it to be the current plot.
 TwoDPlotter<java.lang.Float> AddPlot(int pos)
          Adds a plot at specified position in the list and sets it to be the current plot.
 void AddPlots(int numPlots)
           
 boolean DeleteCurrentPlot()
          Delete the current plot.
 boolean DeletePlot(int indx)
          Delete the plot with specified index.
 TwoDPlotter<java.lang.Float> GetCurrPlot()
           
 int GetCurrPlotIndex()
           
 int GetNumPlots()
           
 TwoDPlotter<java.lang.Float> GetPlot(int indx)
           
 boolean SetCurrPlot(int indx)
          Set current plot index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_PlotList

private java.util.ArrayList<TwoDPlotter<java.lang.Float>> m_PlotList

m_iCurrPlotIndex

private int m_iCurrPlotIndex
Index of current plot.

0 <= m_iCurrPlotIndex < m_PlotList.size()

For empty plot list, this is -1.

Constructor Detail

TwoDPlotManager

public TwoDPlotManager()

TwoDPlotManager

public TwoDPlotManager(int numPlots)
Method Detail

SetCurrPlot

public boolean SetCurrPlot(int indx)
Set current plot index.

Returns:
true if index set, false otherwise

GetCurrPlotIndex

public int GetCurrPlotIndex()

GetCurrPlot

public TwoDPlotter<java.lang.Float> GetCurrPlot()

GetPlot

public TwoDPlotter<java.lang.Float> GetPlot(int indx)

AddPlot

public TwoDPlotter<java.lang.Float> AddPlot()
Adds a plot to the end of list, and sets it to be the current plot.

Returns:
TwoDPlotter instance that was added

AddPlot

public TwoDPlotter<java.lang.Float> AddPlot(int pos)
Adds a plot at specified position in the list and sets it to be the current plot.

Parameters:
pos - Position in the plot list.
Returns:
TwoDPlotter instance that was added. This can be null is invalid pos is specified.

AddPlots

public void AddPlots(int numPlots)

DeletePlot

public boolean DeletePlot(int indx)
Delete the plot with specified index. The last plot is never deleted, so m_PlotList.size() >= 1. So m_iCurrPlotIndex >= 0 always.

Parameters:
indx - Index of plot to be deleted.
Returns:
true if plot was deleted, false otherwise

DeleteCurrentPlot

public boolean DeleteCurrentPlot()
Delete the current plot. The last plot is never deleted, so m_PlotList.size() >= 1. So m_iCurrPlotIndex >= 0 always.

Returns:
true if plot was deleted, false otherwise

GetNumPlots

public int GetNumPlots()