de.matthiasmann.twl.model
Class SimpleGraphLineModel

java.lang.Object
  extended by de.matthiasmann.twl.model.SimpleGraphLineModel
All Implemented Interfaces:
GraphLineModel

public class SimpleGraphLineModel
extends java.lang.Object
implements GraphLineModel

A simple graph line model which allows to shift points from right to left.


Constructor Summary
SimpleGraphLineModel(java.lang.String style, int size, float minValue, float maxValue)
           
 
Method Summary
 void addPoint(float value)
           
 float getMaxValue()
          Returns the largest value which should be used to scale the graph.
 float getMinValue()
          Returns the smallest value which should be used to scale the graph.
 int getNumPoints()
          Returns the number of points on the lines.
 float getPoint(int idx)
          Returns the value of the desired point.
 java.lang.String getVisualStyleName()
          Returns the name of the visual style.
 void setMaxValue(float maxValue)
           
 void setMinValue(float minValue)
           
 void setNumPoints(int numPoints)
           
 void setVisualStyleName(java.lang.String visualStyleName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGraphLineModel

public SimpleGraphLineModel(java.lang.String style,
                            int size,
                            float minValue,
                            float maxValue)
Method Detail

getVisualStyleName

public java.lang.String getVisualStyleName()
Description copied from interface: GraphLineModel
Returns the name of the visual style. The style will be looked up in the theme data of the graph widget.

Specified by:
getVisualStyleName in interface GraphLineModel
Returns:
the name of the visual style.

setVisualStyleName

public void setVisualStyleName(java.lang.String visualStyleName)

getNumPoints

public int getNumPoints()
Description copied from interface: GraphLineModel
Returns the number of points on the lines. A line is only drawn if atleast one point is available.

Specified by:
getNumPoints in interface GraphLineModel
Returns:
the number of points on the lines

getPoint

public float getPoint(int idx)
Description copied from interface: GraphLineModel
Returns the value of the desired point.

Specified by:
getPoint in interface GraphLineModel
Parameters:
idx - The index of the point. Will be >= 0 and < getNumPoints()
Returns:
the value of the desired point.
See Also:
GraphLineModel.getNumPoints()

getMinValue

public float getMinValue()
Description copied from interface: GraphLineModel
Returns the smallest value which should be used to scale the graph.

Specified by:
getMinValue in interface GraphLineModel
Returns:
the smallest value which should be used to scale the graph

getMaxValue

public float getMaxValue()
Description copied from interface: GraphLineModel
Returns the largest value which should be used to scale the graph.

Specified by:
getMaxValue in interface GraphLineModel
Returns:
the largest value which should be used to scale the graph

addPoint

public void addPoint(float value)

setMaxValue

public void setMaxValue(float maxValue)

setMinValue

public void setMinValue(float minValue)

setNumPoints

public void setNumPoints(int numPoints)