public class BasicGraphData
extends java.lang.Object
CubicSplineGraphData
class.CubicSplineGraphData
Modifier and Type | Class and Description |
---|---|
protected class |
BasicGraphData.CompareErr
Description of the Class
|
protected class |
BasicGraphData.CompareX
Description of the Class
|
protected class |
BasicGraphData.CompareY
Description of the Class
|
protected class |
BasicGraphData.XYpoint
Description of the Class
|
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
color
Description of the Field
|
protected boolean |
drawLinesOn
Description of the Field
|
protected boolean |
drawPointsOn
Description of the Field
|
protected double |
errYmax
Description of the Field
|
protected java.util.Vector<java.lang.Object> |
graphDataContainerV
Description of the Field
|
protected boolean |
immediateContainerUpdate
Description of the Field
|
protected java.awt.BasicStroke |
lineStroke
Description of the Field
|
protected int |
lineThick
Description of the Field
|
protected java.lang.Object |
lockUpObj
Description of the Field
|
protected java.awt.Shape |
markShape
Description of the Field
|
protected boolean |
markShapeFilled
Description of the Field
|
protected java.lang.String |
name
Description of the Field
|
protected int |
nInterpPoints
Description of the Field
|
protected int |
pointSize
Description of the Field
|
protected java.util.HashMap<java.lang.Object,java.lang.Object> |
propertyMap
Description of the Field
|
protected double |
xMax
Description of the Field
|
protected double |
xMin
Description of the Field
|
protected java.util.Vector<BasicGraphData.XYpoint> |
xyInterpPointV
Description of the Field
|
protected java.util.Vector<BasicGraphData.XYpoint> |
xyPointV
Description of the Field
|
protected double |
yMax
Description of the Field
|
protected double |
yMin
Description of the Field
|
Constructor and Description |
---|
BasicGraphData()
data set constructor
|
BasicGraphData(int nPoint,
int nInterpPointsIn)
data set constructor with defined initial capacity for number of (x,y)
points and interpolated points
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(double[] x,
double[] y)
add an array of (x,y) points to the data set
|
void |
addPoint(double[] x,
double[] y,
double[] err)
add an array of (x,y, error of y) points to the data set
|
void |
addPoint(double x,
double y)
add (x,y) point to the data set
|
void |
addPoint(double x,
double y,
double err)
add (x,y, error of y) point to the data set
|
protected void |
calculateRepresentation()
Description of the Method
|
protected int |
getCapacity()
Returns the capacity attribute of the BasicGraphData object
|
boolean |
getDrawLinesOn()
returns the "draw lines on/off" state
|
boolean |
getDrawPointsOn()
returns the "draw points on/off" state
|
double |
getErr(int index)
returns the error value for certain index
|
java.awt.Color |
getGraphColor()
returns the color of the graph
|
FunctionGraphsJPanel |
getGraphDataContainer(int index)
returns the graph containers where this data set has been registered
|
java.lang.String |
getGraphName()
returns the name of the graph
|
java.awt.Shape |
getGraphPointShape()
returns the shape of the point during drawing.
|
int |
getGraphPointSize()
returns the size of the point during drawing.
|
java.lang.Object |
getGraphProperty(java.lang.Object keyObj)
sets the value of the data set property by the key-value
|
java.util.Set<java.lang.Object> |
getGraphPropertyKeys()
returns the set of the keys
|
int |
getGraphPropertySize()
returns the number of pairs (key,value)
|
boolean |
getImmediateContainerUpdate()
returns true if data changes cause the immediate graph container update.
|
double |
getInterpX(int index)
returns x-value for a particular point in the interpolating data set
|
double |
getInterpY(int index)
returns interpolated y-value from the interpolating data set
|
int |
getLineThick()
returns the line thickness during drawing.
|
java.lang.Object |
getLockObject()
Returns the lock object of the BasicGraphData object
|
double |
getMaxErr()
returns the maximal y-error
|
double |
getMaxX()
returns the maximal x
|
double |
getMaxY()
returns the maximal y
|
double |
getMinX()
returns the minimal x
|
double |
getMinY()
returns the minimal y
|
int |
getNumberOfGraphDataContainers()
returns the number of graph containers where this data set has been
registered
|
int |
getNumbOfInterpPoints()
returns the number of data points in the interpolation
|
int |
getNumbOfPoints()
returns the number of data points
|
protected java.awt.BasicStroke |
getStroke()
returns the stroke for drawing.
|
double |
getValueDerivativeY(double x)
get y'-value for certain x-value
|
double |
getValueY(double x)
get y-value for certain x-value
|
double |
getX(int index)
returns x-value from the container
|
double |
getY(int index)
returns y-value from the container
|
protected void |
init(int nPoint,
int nInterpPoints)
initializes graph data containers
|
boolean |
isGraphPointShapeFilled()
returns the filling shape property of the point during drawing.
|
static void |
main(java.lang.String[] args)
this is a test method
|
void |
registerInContainer(FunctionGraphsJPanel gdc)
registers this data set into a graph container.
|
void |
removeAllPoints()
remove all points from the data set
|
void |
removeContainer(java.lang.Object obj)
removes this data set from a graph container.
|
void |
removePoint(int index)
remove a point from the data set
|
void |
setDrawLinesOn(boolean drawLinesOn)
sets "draw lines" on/off
|
void |
setDrawPointsOn(boolean drawPointsOn)
sets "draw points" on/off
|
void |
setGraphColor(java.awt.Color color)
sets the color of the graph
|
void |
setGraphName(java.lang.String name)
sets the name of the graph
|
void |
setGraphPointFillingShape(boolean fillShape)
sets the filling shape property of the point during drawing.
|
void |
setGraphPointShape(java.awt.Shape markShape)
sets the shape of the point during drawing.
|
void |
setGraphPointSize(int pointSize)
sets the size of the point during drawing.
|
void |
setGraphProperty(java.lang.Object keyObj,
java.lang.Object propObj)
sets the (key,value) of the data set properties
|
void |
setImmediateContainerUpdate(boolean immediateContainerUpdate)
sets the immediate graph container update if data has been changed.
|
void |
setLineDashPattern(float... dashPattern)
Set the line stroke dash pattern.
|
void |
setLineStroke(float width,
float... dashPattern)
Set the line stroke (both width and dash pattern).
|
void |
setLineThick(int lineThick)
sets the line thickness during drawing.
|
protected void |
updateContainer()
calls the method
refreshGraphJPanel() of all graph
containers FunctionGraphsJPanel where this data set has been
registered. |
protected void |
updateData()
Description of the Method
|
void |
updatePoint(int index,
double x,
double y)
update the y-value and x-value with certain index into the data set
|
void |
updatePoint(int index,
double x,
double y,
double err)
update the y-value, x-value and error with certain index into the data set
|
void |
updateValues(double[] x,
double[] y)
update all points if they do exist or create new if they do not
|
void |
updateValues(double[] x,
double[] y,
double[] err)
update all points if they do exist or create new if they do not
|
void |
updateValuesY(double[] y)
update the y-array into the data set
|
void |
updateValuesY(double[] y,
double[] err)
update the y-array with errors into the data set
|
void |
updateValueY(int index,
double y)
update the y-value with certain index into the data set
|
protected java.util.HashMap<java.lang.Object,java.lang.Object> propertyMap
protected java.lang.Object lockUpObj
protected java.util.Vector<java.lang.Object> graphDataContainerV
protected boolean immediateContainerUpdate
protected java.util.Vector<BasicGraphData.XYpoint> xyPointV
protected java.util.Vector<BasicGraphData.XYpoint> xyInterpPointV
protected int nInterpPoints
protected double xMax
protected double yMax
protected double xMin
protected double yMin
protected double errYmax
protected java.awt.Color color
protected java.lang.String name
protected boolean drawLinesOn
protected boolean drawPointsOn
protected int pointSize
protected int lineThick
protected java.awt.BasicStroke lineStroke
protected java.awt.Shape markShape
protected boolean markShapeFilled
public BasicGraphData()
public BasicGraphData(int nPoint, int nInterpPointsIn)
nPoint
- Description of the ParameternInterpPointsIn
- Description of the Parameterprotected void init(int nPoint, int nInterpPoints)
nPoint
- Description of the ParameternInterpPoints
- Description of the Parameterpublic void addPoint(double x, double y)
x
- The feature to be added to the Point attributey
- The feature to be added to the Point attributepublic void addPoint(double x, double y, double err)
x
- The feature to be added to the Point attributey
- The feature to be added to the Point attributeerr
- The feature to be added to the Point attributepublic void addPoint(double[] x, double[] y)
x
- The feature to be added to the Point attributey
- The feature to be added to the Point attributepublic void addPoint(double[] x, double[] y, double[] err)
x
- The feature to be added to the Point attributey
- The feature to be added to the Point attributeerr
- The feature to be added to the Point attributepublic void updateValues(double[] x, double[] y, double[] err)
x
- Description of the Parametery
- Description of the Parametererr
- Description of the Parameterpublic void updateValues(double[] x, double[] y)
x
- Description of the Parametery
- Description of the Parameterpublic void updateValuesY(double[] y, double[] err)
y
- Description of the Parametererr
- Description of the Parameterpublic void updateValuesY(double[] y)
y
- Description of the Parameterpublic void updateValueY(int index, double y)
index
- Description of the Parametery
- Description of the Parameterpublic void updatePoint(int index, double x, double y)
index
- Description of the Parameterx
- Description of the Parametery
- Description of the Parameterpublic void updatePoint(int index, double x, double y, double err)
index
- Description of the Parameterx
- Description of the Parametery
- Description of the Parametererr
- Description of the Parameterpublic void removePoint(int index)
index
- Description of the Parameterpublic void removeAllPoints()
protected void calculateRepresentation()
public double getValueY(double x)
x
- Description of the Parameterpublic double getValueDerivativeY(double x)
x
- Description of the Parameterprotected int getCapacity()
public int getNumbOfPoints()
public int getNumbOfInterpPoints()
public double getX(int index)
index
- Description of the Parameterpublic double getY(int index)
index
- Description of the Parameterpublic double getInterpX(int index)
index
- Description of the Parameterpublic double getInterpY(int index)
index
- Description of the Parameterpublic double getErr(int index)
index
- Description of the Parameterpublic double getMaxErr()
public double getMinX()
public double getMaxX()
public double getMinY()
public double getMaxY()
protected void updateData()
public void registerInContainer(FunctionGraphsJPanel gdc)
gdc
- Description of the Parameterpublic int getNumberOfGraphDataContainers()
public void removeContainer(java.lang.Object obj)
obj
- Description of the Parameterpublic FunctionGraphsJPanel getGraphDataContainer(int index)
index
- Description of the Parameterprotected void updateContainer()
refreshGraphJPanel()
of all graph
containers FunctionGraphsJPanel
where this data set has been
registered.public void setImmediateContainerUpdate(boolean immediateContainerUpdate)
immediateContainerUpdate
- The new immediateContainerUpdate valuepublic boolean getImmediateContainerUpdate()
public void setGraphColor(java.awt.Color color)
color
- The new graphColor valuepublic void setGraphName(java.lang.String name)
name
- The new graphName valuepublic java.awt.Color getGraphColor()
public java.lang.String getGraphName()
public void setGraphProperty(java.lang.Object keyObj, java.lang.Object propObj)
keyObj
- The new graphProperty valuepropObj
- The new graphProperty valuepublic java.lang.Object getGraphProperty(java.lang.Object keyObj)
keyObj
- Description of the Parameterpublic int getGraphPropertySize()
public java.util.Set<java.lang.Object> getGraphPropertyKeys()
public void setDrawLinesOn(boolean drawLinesOn)
drawLinesOn
- The new drawLinesOn valuepublic boolean getDrawLinesOn()
public void setDrawPointsOn(boolean drawPointsOn)
drawPointsOn
- The new drawPointsOn valuepublic boolean getDrawPointsOn()
public void setGraphPointSize(int pointSize)
pointSize
- The new graphPointSize valuepublic int getGraphPointSize()
public void setGraphPointShape(java.awt.Shape markShape)
null
. By default it will be a circle.markShape
- The new graphPointShape valuepublic java.awt.Shape getGraphPointShape()
public void setGraphPointFillingShape(boolean fillShape)
fillShape
- The new graphPointFillingShape valuepublic boolean isGraphPointShapeFilled()
public void setLineThick(int lineThick)
lineThick
- The new lineThick valuepublic int getLineThick()
public void setLineDashPattern(float... dashPattern)
dashPattern
- array of dash segment lengthspublic void setLineStroke(float width, float... dashPattern)
width
- line width (aka thickness)dashPattern
- array of dash segment lengthsprotected java.awt.BasicStroke getStroke()
public java.lang.Object getLockObject()
public static void main(java.lang.String[] args)
args
- Description of the Parameter