org.primordion.xholon.io
Class HistogramViewerGnuplot

java.lang.Object
  extended byorg.primordion.xholon.io.AbstractHistogramViewer
      extended byorg.primordion.xholon.io.HistogramViewerGnuplot
All Implemented Interfaces:
IHistogramViewer

public class HistogramViewerGnuplot
extends AbstractHistogramViewer
implements IHistogramViewer

Captures data, and creates a histogram using gnuplot.

The file is in comma delimited .csv format, and can therefore be processed by various applications, including Microsoft Excel, and gnuplot. In addition to writing out the data, this class also produces a gnuplot script file that will generate a .png file from the data. You can download gnuplot free from www.gnuplot.info. On a Windows computer, if you double-click the .csv file, it will be directly loaded into Excel as a spreadsheet, from which you can easily generate a chart. Data and script files are written by default to the statistics directory.

Since:
0.6 (Created on May 3, 2007)
Author:
Ken Webb

Constructor Summary
HistogramViewerGnuplot()
          default constructor
HistogramViewerGnuplot(IXholon histRootModel, IXholon histRootView, IXholonClass xhClass, int numBins, int nameConcatLevels, java.lang.String pathName, java.lang.String typeOfData, int writeType)
          constructor
 
Method Summary
 void chart(double[] values)
          Produce a histogram chart.
 void initialize(IXholon histRootModel, IXholon histRootView, IXholonClass xhClass, int numBins, int nameConcatLevels)
          This method may not be useful for the Gnuplot concrete class.
 void initialize(IXholon histRootModel, IXholon histRootView, IXholonClass xhClass, int numBins, int nameConcatLevels, java.lang.String pathName, java.lang.String typeOfData, int writeType)
          Initialize the histogram viewer.
 void remove()
          Remove the chart from the screen.
 
Methods inherited from class org.primordion.xholon.io.AbstractHistogramViewer
chart, setXRange, 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.IHistogramViewer
chart, setXRange, setYRange
 

Constructor Detail

HistogramViewerGnuplot

public HistogramViewerGnuplot()
default constructor


HistogramViewerGnuplot

public HistogramViewerGnuplot(IXholon histRootModel,
                              IXholon histRootView,
                              IXholonClass xhClass,
                              int numBins,
                              int nameConcatLevels,
                              java.lang.String pathName,
                              java.lang.String typeOfData,
                              int writeType)
constructor

Parameters:
histRootModel - The root node of a Xholon subtree in the model, that will be traversed looking for instances of the xholon class.
histRootView - Root node in the view. This is the "HistogramViewer" node.
xhClass - A Xholon class whose instances will be queried for values, using getVal().
numBins - Number of bins.
nameConcatLevels - Number of composite levels to concatenate in deriving name.
pathName - Path in which data and plot files will be created.
typeOfData - The type of data will be included as part of the file name.
writeType - Type of data to write.
Method Detail

initialize

public void initialize(IXholon histRootModel,
                       IXholon histRootView,
                       IXholonClass xhClass,
                       int numBins,
                       int nameConcatLevels)
This method may not be useful for the Gnuplot concrete class.

Specified by:
initialize in interface IHistogramViewer
Parameters:
histRootModel - The root node of a Xholon subtree in the model, that will be traversed looking for instances of the xholon class.
histRootView - Root node in the view. This is the "HistogramViewer" node.
xhClass - A Xholon class whose instances will be queried for values, using getVal().
numBins - Number of bins.
nameConcatLevels - Number of composite levels to concatenate in deriving name.
See Also:
IHistogramViewer.initialize(org.primordion.xholon.base.IXholon, org.primordion.xholon.base.IXholon, org.primordion.xholon.base.IXholonClass, int, int)

initialize

public void initialize(IXholon histRootModel,
                       IXholon histRootView,
                       IXholonClass xhClass,
                       int numBins,
                       int nameConcatLevels,
                       java.lang.String pathName,
                       java.lang.String typeOfData,
                       int writeType)
Initialize the histogram viewer.

Parameters:
histRootModel - The root node of a Xholon subtree in the model, that will be traversed looking for instances of the xholon class.
histRootView - Root node in the view. This is the "HistogramViewer" node.
xhClass - A Xholon class whose instances will be queried for values, using getVal().
numBins - Number of bins.
nameConcatLevels - Number of composite levels to concatenate in deriving name.
pathName - Path in which data and plot files will be created.
typeOfData - The type of data will be included as part of the file name.
writeType - Type of data to write.

chart

public void chart(double[] values)
Description copied from interface: IHistogramViewer
Produce a histogram chart.

Specified by:
chart in interface IHistogramViewer
Specified by:
chart in class AbstractHistogramViewer

remove

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

Specified by:
remove in interface IHistogramViewer
Specified by:
remove in class AbstractHistogramViewer