nl.tudelft.simulation.jstats.charts.histogram
Class Histogram

java.lang.Object
  extended by nl.tudelft.simulation.jstats.charts.histogram.Histogram
All Implemented Interfaces:
Swingable

public class Histogram
extends Object
implements Swingable

The histogram specifies a histogram chart for the DSOL framework.

(c) copyright 2002-2004 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: Lesser General Public License (LGPL) , no warranty.

Since:
1.2
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:25:43 $
Author:
Alexander Verbraeck
Peter Jacobs

Field Summary
protected  JFreeChart chart
          chart refers to the chart
protected  HistogramDataset dataset
          dataset refers to the dataset
static String LABEL_X_AXIS
          LABEL_X_AXIS is the label on the X-axis
static String LABEL_Y_AXIS
          LABEL_Y_AXIS is the label on the Y-axis
 
Constructor Summary
Histogram(String title, double[] domain, double[] range, int numberofBins)
          constructs a new Histogram.
Histogram(String title, double[] domain, int numberofBins)
          constructs a new Histogram
 
Method Summary
 void add(Counter counter)
          adds a counter to the histogramdataset.
 void add(String description, EventProducerInterface source, EventType eventType)
          adds an eventProducer to the histogram dataset.
 JFreeChart getChart()
          returns the chart
 HistogramDataset getDataset()
          returns the dataset of a histogram.
 Container getSwingPanel()
          returns the chartPanel of this histogram.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LABEL_X_AXIS

public static final String LABEL_X_AXIS
LABEL_X_AXIS is the label on the X-axis

See Also:
Constant Field Values

LABEL_Y_AXIS

public static final String LABEL_Y_AXIS
LABEL_Y_AXIS is the label on the Y-axis

See Also:
Constant Field Values

chart

protected JFreeChart chart
chart refers to the chart


dataset

protected HistogramDataset dataset
dataset refers to the dataset

Constructor Detail

Histogram

public Histogram(String title,
                 double[] domain,
                 int numberofBins)
constructs a new Histogram

Parameters:
title - the title
domain - the domain
numberofBins - the numberofbins

Histogram

public Histogram(String title,
                 double[] domain,
                 double[] range,
                 int numberofBins)
constructs a new Histogram.

Parameters:
title - the title. The title of the histogram
domain - the domain of the x-axis.
range - the y-axis range of the histogram.
numberofBins - the numberofbins of this histogram.
Method Detail

add

public void add(Counter counter)
adds a counter to the histogramdataset. This histogram then subscribes its dataset to the Counter.COUNT_EVENT.

Parameters:
counter - the counter to add.

add

public void add(String description,
                EventProducerInterface source,
                EventType eventType)
adds an eventProducer to the histogram dataset. The histogram subscribes its dataset subsequentially to the specified event.

Parameters:
description - the description of the eventProducer
source - the eventproducer which functions as source for this histogram.
eventType - the eventType.

getChart

public JFreeChart getChart()
returns the chart

Returns:
JFreeChart

getSwingPanel

public Container getSwingPanel()
returns the chartPanel of this histogram.

Specified by:
getSwingPanel in interface Swingable
Returns:
ChartPanel

getDataset

public HistogramDataset getDataset()
returns the dataset of a histogram.

Returns:
the HistogramDataset containing all series.


Copyright © 2002-2011 Delft University of Technology, the Netherlands. All Rights Reserved.