be.ac.ulg.montefiore.run.totem.chart.model
Class Chart

java.lang.Object
  extended by be.ac.ulg.montefiore.run.totem.chart.model.Chart

public class Chart
extends java.lang.Object

Class used to collect data and create charts using the data It used a ChartDataCollector to collect the data and a ChartPlotter to generate the chart. The instances of both these interfaces should be registered in the global preferences of the toolbox under AVAILABLE-DATA-COLLECTORS and AVAILABLE-CHART-PLOTTERS respectively. The collected data are maintained in a ChartData structure.

Author:
Ga�l Monfort (monfort@run.montefiore.ulg.ac.be)
See Also:
ChartData, ChartDataCollector,

Creation date: 16 d�c. 2005


Constructor Summary
Chart(java.lang.String dataCollectorName, java.util.HashMap<java.lang.String,java.lang.String> params)
          Build a Chart object that is able to collect data with the specified collector.
 
Method Summary
 void addSeries(java.lang.String name, java.util.HashMap<java.lang.String,java.lang.String> params)
          Add a series of data to the collected data.
 ChartDataCollector getCollector()
           
 ChartData getData()
           
 org.jfree.chart.JFreeChart getPlot()
           
 void plot(java.lang.String chartPlotterName, java.lang.String title, java.lang.String xAxisTitle, java.lang.String yAxisTitle, java.util.HashMap<java.lang.String,java.lang.String> params)
          Create the JFreeChart object.
 void setData(ChartData data)
          Set the data used to compute the
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Chart

public Chart(java.lang.String dataCollectorName,
             java.util.HashMap<java.lang.String,java.lang.String> params)
      throws ChartParameterException
Build a Chart object that is able to collect data with the specified collector. Parameters are passed to the collector.

Parameters:
dataCollectorName -
params -
Throws:
ChartParameterException
Method Detail

addSeries

public void addSeries(java.lang.String name,
                      java.util.HashMap<java.lang.String,java.lang.String> params)
               throws ChartParameterException
Add a series of data to the collected data. The parameters are passed to the ChartDataCollector.

Parameters:
name - of the serie to add
params -
Throws:
ChartParameterException - if the name already exists in the data

plot

public void plot(java.lang.String chartPlotterName,
                 java.lang.String title,
                 java.lang.String xAxisTitle,
                 java.lang.String yAxisTitle,
                 java.util.HashMap<java.lang.String,java.lang.String> params)
          throws ChartParameterException
Create the JFreeChart object. The chart is generated by the plot() method of the ChartPlotter whose name is given as argument A reference to the last generated chart can be obtained by getPlot()

Parameters:
chartPlotterName - the simple name of the class corresponding to a registered extend of the interface ChartPlotter.
title - Title of the chart
xAxisTitle - X Axis Label
yAxisTitle - Y Axis Label
params - Parameters to pass to the plot method of the chosen chartPlotter
Throws:
ChartParameterException

getPlot

public org.jfree.chart.JFreeChart getPlot()
Returns:
the last chart generated.

setData

public void setData(ChartData data)
Set the data used to compute the

Parameters:
data -

getData

public ChartData getData()
Returns:
the data used to compute the charts

getCollector

public ChartDataCollector getCollector()


Copyright © 2004-2007 Research Unit in Networking, All Rights Reserved.