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, update
public 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 IGraphicalObserver
getGUI
in class GraphicalObserver
public void experimentRunning(SimRunEvent e)
experimentRunning
in interface ExperimentListener
e
- a SimRunEventpublic void experimentStopped(SimRunEvent e)
experimentStopped
in interface ExperimentListener
e
- a SimRunEventpublic void experimentPaused(SimRunEvent e)
experimentPaused
in interface ExperimentListener
e
- a SimRunEventpublic void drawChart(java.awt.Graphics g)
drawChart
in interface ChartOwner
g
- The specified Graphics object.public void update(java.util.Observable x, java.lang.Object y)
update
in interface java.util.Observer
public void updatePlotter()