org.primordion.xholon.io
Class ChartViewerJFreeChart

java.lang.Object
  extended byorg.primordion.xholon.io.AbstractChartViewer
      extended byorg.primordion.xholon.io.ChartViewerJFreeChart
All Implemented Interfaces:
IChartViewer

public class ChartViewerJFreeChart
extends AbstractChartViewer
implements IChartViewer

Captures data, and creates a chart using JFreeChart.

Data is captured in data structures at each time step, and the chart is prepared at the end of a run. JFreeChart is an open source project that can be freely downloaded from sourceforge.net/projects/jfreechart.

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

Field Summary
 
Fields inherited from interface org.primordion.xholon.io.IChartViewer
WRITE_AS_DOUBLE, WRITE_AS_FLOAT, WRITE_AS_INT, WRITE_AS_LONG, WRITE_AS_NULL, WRITE_AS_SHORT, WRITE_TIME_IN_HEADING
 
Constructor Summary
ChartViewerJFreeChart()
          default constructor
ChartViewerJFreeChart(IXholon chartRoot, int nameConcatLevels)
          constructor
 
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[] seriesName)
          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.
 
Methods inherited from class org.primordion.xholon.io.AbstractChartViewer
setXRange, setYFormat, setYRange
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.primordion.xholon.io.IChartViewer
setXRange, setYFormat, setYRange
 

Constructor Detail

ChartViewerJFreeChart

public ChartViewerJFreeChart()
default constructor


ChartViewerJFreeChart

public ChartViewerJFreeChart(IXholon chartRoot,
                             int nameConcatLevels)
constructor

Parameters:
chartRoot - JFreeChart node.
Method Detail

initialize

public void initialize(IXholon chartRoot,
                       int nameConcatLevels)
Initialize the chart viewer. Create datasets to store each type of data that's being captured for display in a chart.

Specified by:
initialize in interface IChartViewer
Parameters:
chartRoot - XYChart node.
nameConcatLevels - Number of composite levels to concatenate in deriving series name.

createXySeries

public void createXySeries(int seriesCount,
                           java.lang.String[] seriesName)
Description copied from interface: IChartViewer
Create one or more xy data series.

Specified by:
createXySeries in interface IChartViewer
Parameters:
seriesCount - Number of xy series.
seriesName - Name of each xy series.

capture

public void capture(double timeStep)
Description copied from interface: IChartViewer
Capture data at each timestep.

Specified by:
capture in interface IChartViewer
Specified by:
capture in class AbstractChartViewer

capture

public void capture(int numTimeSeries,
                    double xVal,
                    double[] yVal)
Description copied from interface: IChartViewer
Capture specified data at each time interval.

Specified by:
capture in interface IChartViewer
Specified by:
capture in class AbstractChartViewer

chart

public void chart()
Description copied from interface: IChartViewer
Produce a chart from the captured data.

Specified by:
chart in interface IChartViewer
Specified by:
chart in class AbstractChartViewer

chart

public void chart(boolean showLegend)
Description copied from interface: IChartViewer
Produce a chart from the captured data.

Specified by:
chart in interface IChartViewer
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.

remove

public void remove()
Description copied from interface: IChartViewer
Remove the chart from the screen.

Specified by:
remove in interface IChartViewer
Specified by:
remove in class AbstractChartViewer