public class TimeSeriesPlotter extends GraphicalObserver implements ExperimentListener, ChartOwner, java.util.Observer
| Modifier and Type | Class and Description |
|---|---|
static class |
TimeSeriesPlotter.SimpleTimeSeriesViewer
A simple means of drawing a TimeSeries without requiring the
experimentation GUI by adding a TimeSeriesPlotter to an
otherwise empty Frame.
|
| Constructor and Description |
|---|
TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries[] data,
int winWidth,
int winHeight)
Creates a new TimeSeries plotter from the given array of TimeSeries objects.
|
TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries[] data,
int winWidth,
int winHeight,
int xLocation,
int yLocation)
Creates a new TimeSeries plotter from the given array of TimeSeries objects.
|
TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries data,
int winWidth,
int winHeight)
Creates a new TimeSeries plotter from the given TimeSeries object.
|
TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries data,
int winWidth,
int winHeight,
int xLocation,
int yLocation)
Creates a new TimeSeries plotter from the given TimeSeries object.
|
TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries data,
int winWidth,
int winHeight,
java.lang.String legend)
Creates a new TimeSeries plotter from the given TimeSeries object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTimeSeries(TimeSeries newData)
Adds another TimeSeries statistic object which will be displayed in the chart, using a default legend entry.
|
void |
addTimeSeries(TimeSeries newData,
java.lang.String legend)
Adds another TimeSeries statistic object which will be displayed in the chart.
|
void |
drawChart(java.awt.Graphics g)
Draws the values given by the TimeSeries statistic object into the
chart.
|
void |
experimentPaused(SimRunEvent e)
Called when the experiment is paused.
|
void |
experimentRunning(SimRunEvent e)
Called when the experiment is (re)started.
|
void |
experimentStopped(SimRunEvent e)
Called when the experiment is stopped.
|
java.awt.Component |
getGUI()
Returns the plotter's GUI (a JFreeCHartPanel)
|
void |
update(java.util.Observable x,
java.lang.Object y)
The update method (required by interface 'Observer') will be called, if
the TimeSeries produces new values.
|
void |
updatePlotter()
This method updates the chart.
|
deregister, getContext, getName, register, setLocation, setSize, setVisible, updatepublic TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries[] data,
int winWidth,
int winHeight)
title - window titlecontext - the context to show this observer indata - array of TimeSeries data to displaywinWidth - width of windowwinHeight - height of windowpublic TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries data,
int winWidth,
int winHeight)
title - window titlecontext - the context to show this observer indata - TimeSeries to displaywinWidth - width of windowwinHeight - height of windowpublic TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries data,
int winWidth,
int winHeight,
java.lang.String legend)
title - window titlecontext - the context to show this observer indata - TimeSeries to displaywinWidth - width of windowwinHeight - height of windowString - legend (only used if further plots are added to this plotter)public TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries data,
int winWidth,
int winHeight,
int xLocation,
int yLocation)
title - window titlecontext - the context to show this observer indata - data of time series to displaywinWidth - width of windowwinHeight - height of windowxLocation - horizontal position of windowyLocation - vertical position of windowpublic TimeSeriesPlotter(java.lang.String title,
GraphicalObserverContext context,
TimeSeries[] data,
int winWidth,
int winHeight,
int xLocation,
int yLocation)
title - window titlecontext - the context to show this observer indata - data of time series to displaywinWidth - width of windowwinHeight - height of windowxLocation - horizontal position of windowyLocation - vertical position of windowpublic void addTimeSeries(TimeSeries newData)
newData - Another TimeSeries statistic object which will be displayed in the chart.public void addTimeSeries(TimeSeries newData, java.lang.String legend)
newData - Another TimeSeries statistic object which will be displayed in the chart.legend - A short description. *public java.awt.Component getGUI()
getGUI in interface IGraphicalObservergetGUI in class GraphicalObserverpublic void experimentRunning(SimRunEvent e)
experimentRunning in interface ExperimentListenere - a SimRunEventpublic void experimentStopped(SimRunEvent e)
experimentStopped in interface ExperimentListenere - a SimRunEventpublic void experimentPaused(SimRunEvent e)
experimentPaused in interface ExperimentListenere - a SimRunEventpublic void drawChart(java.awt.Graphics g)
drawChart in interface ChartOwnerg - The specified Graphics object.public void update(java.util.Observable x,
java.lang.Object y)
update in interface java.util.Observerpublic void updatePlotter()