|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.tools.plot.BasicGraphData
This class is a container class for data used in the FunctionGraphsJPanel class.
This class interpolates y-values by the linear interpolation. For spline
interpolation use the CubicSplineGraphData class.
CubicSplineGraphData| Nested Class Summary | |
protected class |
BasicGraphData.CompareErr
|
protected class |
BasicGraphData.CompareX
|
protected class |
BasicGraphData.CompareY
|
protected class |
BasicGraphData.XYpoint
|
| Field Summary | |
protected java.awt.Color |
color
|
protected boolean |
drawLinesOn
|
protected boolean |
drawPointsOn
|
protected double |
errYmax
|
protected java.util.Vector |
graphDataContainerV
|
protected boolean |
immediateContainerUpdate
|
protected java.awt.BasicStroke |
lineStroke
|
protected int |
lineThick
|
protected java.lang.Object |
lockUpObj
|
protected java.awt.Shape |
markShape
|
protected boolean |
markShapeFilled
|
protected java.lang.String |
name
|
protected int |
nInterpPoints
|
protected int |
pointSize
|
protected java.util.HashMap |
propertyMap
|
protected double |
xMax
|
protected double |
xMin
|
protected java.util.Vector |
xyInterpPointV
|
protected java.util.Vector |
xyPointV
|
protected double |
yMax
|
protected double |
yMin
|
| Constructor Summary | |
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 |
|
| Method Summary | |
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()
|
protected int |
getCapacity()
|
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 |
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. |
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 |
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()
|
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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.HashMap propertyMap
protected java.lang.Object lockUpObj
protected java.util.Vector graphDataContainerV
protected boolean immediateContainerUpdate
protected java.util.Vector xyPointV
protected java.util.Vector 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
| Constructor Detail |
public BasicGraphData()
public BasicGraphData(int nPoint,
int nInterpPointsIn)
| Method Detail |
protected void init(int nPoint,
int nInterpPoints)
public void addPoint(double x,
double y)
public void addPoint(double x,
double y,
double err)
public void addPoint(double[] x,
double[] y)
public void addPoint(double[] x,
double[] y,
double[] err)
public void updateValues(double[] x,
double[] y,
double[] err)
public void updateValues(double[] x,
double[] y)
public void updateValuesY(double[] y,
double[] err)
public void updateValuesY(double[] y)
public void updateValueY(int index,
double y)
public void updatePoint(int index,
double x,
double y)
public void updatePoint(int index,
double x,
double y,
double err)
public void removePoint(int index)
public void removeAllPoints()
protected void calculateRepresentation()
public double getValueY(double x)
public double getValueDerivativeY(double x)
protected int getCapacity()
public int getNumbOfPoints()
public int getNumbOfInterpPoints()
public double getX(int index)
public double getY(int index)
public double getInterpX(int index)
public double getInterpY(int index)
public double getErr(int index)
public double getMaxErr()
public double getMinX()
public double getMaxX()
public double getMinY()
public double getMaxY()
protected void updateData()
public void registerInContainer(FunctionGraphsJPanel gdc)
public int getNumberOfGraphDataContainers()
public void removeContainer(java.lang.Object obj)
public FunctionGraphsJPanel getGraphDataContainer(int index)
protected void updateContainer()
refreshGraphJPanel() of all graph containers
FunctionGraphsJPanel where this data set has been registered.
public void setImmediateContainerUpdate(boolean immediateContainerUpdate)
public boolean getImmediateContainerUpdate()
public void setGraphColor(java.awt.Color color)
public void setGraphName(java.lang.String name)
public java.awt.Color getGraphColor()
public java.lang.String getGraphName()
public void setGraphProperty(java.lang.Object keyObj,
java.lang.Object propObj)
public java.lang.Object getGraphProperty(java.lang.Object keyObj)
public int getGraphPropertySize()
public java.util.Set getGraphPropertyKeys()
public void setDrawLinesOn(boolean drawLinesOn)
public boolean getDrawLinesOn()
public void setDrawPointsOn(boolean drawPointsOn)
public boolean getDrawPointsOn()
public void setGraphPointSize(int pointSize)
public int getGraphPointSize()
public void setGraphPointShape(java.awt.Shape markShape)
null .
By default it will be a circle.
public java.awt.Shape getGraphPointShape()
public void setGraphPointFillingShape(boolean fillShape)
public boolean isGraphPointShapeFilled()
public void setLineThick(int lineThick)
public int getLineThick()
protected java.awt.BasicStroke getStroke()
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||