Package xal.extension.widgets.plot
Class CurveData
java.lang.Object
xal.extension.widgets.plot.CurveData
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
refreshGraphJPanel() of the
FunctionGraphsJPanel in the program.- Version:
- 1.0
- Author:
- A. Shishlo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPoint(double x, double y) Adds a point.voidclear()Deletes all points.voidFinds min and max values.getColor()Returns the color of the curve.intReturns the line width.doublegetMaxX()Returns the maximal X value.doublegetMaxY()Returns the maximal Y value.doublegetMinX()Returns the minimal X value.doublegetMinY()Returns the minimal Y value.intgetSize()Returns number of points.returns the stroke for drawing.doublegetX(int i) Returns the x-value for index i.doublegetY(int i) Returns the y-value for index i.voidSets the color of the curve.voidsetLineWidth(int lineWidth) Sets the line width.voidsetPoint(int i, double x, double y) Sets a particular point with the index i.voidsetPoints(double[] x, double[] y) Sets the points.voidsetStroke(BasicStroke lineStroke) sets the stroke for drawing.
-
Constructor Details
-
CurveData
public CurveData()The data set constructor.
-
-
Method Details
-
setColor
Sets the color of the curve. -
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
returns the stroke for drawing. -
setStroke
sets 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. -
findMinMax
public void findMinMax()Finds min and max values. -
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.
-