Class TimeSeriesGraph

java.lang.Object
  |
  +--TimeSeriesGraph
All Implemented Interfaces:
DataSink
Direct Known Subclasses:
TickedTimeSeriesGraph

public class TimeSeriesGraph
extends java.lang.Object
implements DataSink

A TimeSeriesGraph graphs a series of points assumed to be in time order. It provides a DataSink interface so that it can be easily attached to data generators.


Field Summary
protected  int yMax
           
protected  int yMaxDefault
           
protected  int ySize
           
 
Constructor Summary
TimeSeriesGraph()
          Place the time series on its own InfiniteCanvas.
TimeSeriesGraph(InfiniteCanvas c)
          Places the time series on a predefined canvas.
 
Method Summary
 void addPoint(PointValue p)
          Adds a new point to the time series.
 InfiniteCanvas getCanvas()
           
 java.awt.Color getColor()
          Determines the line/point color used by time series.
protected  int scale(PointValue p)
          MADE PROTECTED
 void setLined(boolean l)
          Specifies whether points should be connected.
 void setMax(int max)
          Specifies maximum y value for this time series for scaling purposes.
 java.lang.String toString()
          Creates a fancy printable name for this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ySize

protected int ySize

yMaxDefault

protected int yMaxDefault

yMax

protected int yMax
Constructor Detail

TimeSeriesGraph

public TimeSeriesGraph()
Place the time series on its own InfiniteCanvas.

See Also:
InfiniteCanvas

TimeSeriesGraph

public TimeSeriesGraph(InfiniteCanvas c)
Places the time series on a predefined canvas.

Parameters:
c - the canvas this time series should be placed on.
Method Detail

getCanvas

public InfiniteCanvas getCanvas()
Returns:
the canvas for this time series.

setLined

public void setLined(boolean l)
Specifies whether points should be connected.

Parameters:
l - true connect the dots. false use dots

setMax

public void setMax(int max)
Specifies maximum y value for this time series for scaling purposes.

Specified by:
setMax in interface DataSink
Parameters:
max - maximum y value

scale

protected int scale(PointValue p)
MADE PROTECTED


addPoint

public void addPoint(PointValue p)
Adds a new point to the time series.

Specified by:
addPoint in interface DataSink
Parameters:
p - the new point.

getColor

public java.awt.Color getColor()
Determines the line/point color used by time series.

Returns:
color the color.

toString

public java.lang.String toString()
Creates a fancy printable name for this class

Overrides:
toString in class java.lang.Object
Returns:
fancy name