org.primordion.xholon.io
Interface IChartViewer

All Known Implementing Classes:
AbstractChartViewer, ChartViewerGnuplot, ChartViewerJFreeChart

public interface IChartViewer

This interface should be implemented by concrete classes that capture data and display the data in a chart.

Since:
0.3 (Created on April 24, 2006)
Author:
Ken Webb

Field Summary
static int WRITE_AS_DOUBLE
           
static int WRITE_AS_FLOAT
           
static int WRITE_AS_INT
           
static int WRITE_AS_LONG
           
static int WRITE_AS_NULL
           
static int WRITE_AS_SHORT
           
static int WRITE_TIME_IN_HEADING
           
 
Method Summary
 void capture(double timeStep)
          Capture data at each timestep.
 void capture(int numTimeSeries, double xVal, double[] yVal)
          Capture specified data at each time interval.
 void chart()
          Produce a chart from the captured data.
 void chart(boolean showLegend)
          Produce a chart from the captured data.
 void createXySeries(int seriesCount, java.lang.String[] xySeriesName)
          Create one or more xy data series.
 void initialize(IXholon chartRoot, int nameConcatLevels)
          Initialize the chart viewer.
 void remove()
          Remove the chart from the screen.
 void setXRange(double min, double max)
          Set the X range of the chart.
 void setYFormat(java.lang.String yFormat)
          Set the format of the y axis of the chart.
 void setYRange(double min, double max)
          Set the Y range of the chart.
 

Field Detail

WRITE_TIME_IN_HEADING

public static final int WRITE_TIME_IN_HEADING
See Also:
Constant Field Values

WRITE_AS_NULL

public static final int WRITE_AS_NULL
See Also:
Constant Field Values

WRITE_AS_INT

public static final int WRITE_AS_INT
See Also:
Constant Field Values

WRITE_AS_LONG

public static final int WRITE_AS_LONG
See Also:
Constant Field Values

WRITE_AS_SHORT

public static final int WRITE_AS_SHORT
See Also:
Constant Field Values

WRITE_AS_FLOAT

public static final int WRITE_AS_FLOAT
See Also:
Constant Field Values

WRITE_AS_DOUBLE

public static final int WRITE_AS_DOUBLE
See Also:
Constant Field Values
Method Detail

initialize

public void initialize(IXholon chartRoot,
                       int nameConcatLevels)
Initialize the chart viewer.

Parameters:
chartRoot - XYChart node.
nameConcatLevels - Number of composite levels to concatenate in deriving series name.

capture

public void capture(double timeStep)
Capture data at each timestep.

Parameters:
timeStep - Time step, or other time interval.

capture

public void capture(int numTimeSeries,
                    double xVal,
                    double[] yVal)
Capture specified data at each time interval.

Parameters:
numTimeSeries - Number of time series indices.
xVal - X Value.
yVal - Y Values.

chart

public void chart()
Produce a chart from the captured data.


chart

public void chart(boolean showLegend)
Produce a chart from the captured data.

Parameters:
showLegend - Whether or not to show the legend. The legend shows the name and color of all data series. If there are a lot of different series, then the legend can get too big.

createXySeries

public void createXySeries(int seriesCount,
                           java.lang.String[] xySeriesName)
Create one or more xy data series.

Parameters:
seriesCount - Number of xy series.
xySeriesName - Name of each xy series.

setXRange

public void setXRange(double min,
                      double max)
Set the X range of the chart.

Parameters:
min - Minimum cutoff value to show in the chart.
max - Maximum cutoff value to show in the chart.

setYRange

public void setYRange(double min,
                      double max)
Set the Y range of the chart.

Parameters:
min - Minimum cutoff value to show in the chart.
max - Maximum cutoff value to show in the chart.

setYFormat

public void setYFormat(java.lang.String yFormat)
Set the format of the y axis of the chart. This is specific to gnuplot.

Parameters:
yFormat - A format string (ex: "%.4f" or "%.0f")

remove

public void remove()
Remove the chart from the screen.