gov.sns.tools.plot
Class CurveData

java.lang.Object
  |
  +--gov.sns.tools.plot.CurveData

public class CurveData
extends java.lang.Object

This class is a curve data class for data used in the FunctionGraphsJPanel class. This class contains a set of 2D points that will be connected on the graph's plane. This class does not update the graph panel automatically. User must call the method updateGraphJPanel() of the FunctionGraphsJPanel in the program.


Constructor Summary
CurveData()
          The data set constructor.
 
Method Summary
 void addPoint(double x, double y)
          Adds a point.
 void clear()
          Deletes all points.
 java.awt.Color getColor()
          Returns the color of the curve.
 int getLineWidth()
          Returns the line width.
 double getMaxX()
          Returns the maximal X value.
 double getMaxY()
          Returns the maximal Y value.
 double getMinX()
          Returns the minimal X value.
 double getMinY()
          Returns the minimal Y value.
 int getSize()
          Returns number of points.
protected  java.awt.BasicStroke getStroke()
          returns the stroke for drawing.
 double getX(int i)
          Returns the x-value for index i.
 double getY(int i)
          Returns the y-value for index i.
 void setColor(java.awt.Color color)
          Sets the color of the curve.
 void setLineWidth(int lineWidth)
          Sets the line width.
 void setPoint(int i, double x, double y)
          Sets a particular point with the index i.
 void setPoints(double[] x, double[] y)
          Sets the points.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurveData

public CurveData()
The data set constructor.

Method Detail

setColor

public void setColor(java.awt.Color color)
Sets the color of the curve.


getColor

public java.awt.Color getColor()
Returns the color of the curve.


clear

public void clear()
Deletes all points.


getSize

public int getSize()
Returns number of points.


setLineWidth

public void setLineWidth(int lineWidth)
Sets the line width.


getLineWidth

public int getLineWidth()
Returns the line width.


getStroke

protected java.awt.BasicStroke getStroke()
returns the stroke for drawing.


setPoints

public void setPoints(double[] x,
                      double[] y)
Sets the points.


addPoint

public void addPoint(double x,
                     double y)
Adds a point.


setPoint

public void setPoint(int i,
                     double x,
                     double y)
Sets a particular point with the index i.


getX

public double getX(int i)
Returns the x-value for index i.


getY

public double getY(int i)
Returns the y-value for index i.


getMinX

public double getMinX()
Returns the minimal X value.


getMaxX

public double getMaxX()
Returns the maximal X value.


getMinY

public double getMinY()
Returns the minimal Y value.


getMaxY

public double getMaxY()
Returns the maximal Y value.