|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.jrefinery.chart.CrosshairInfo
public class CrosshairInfo
Maintains information about crosshairs on a plot.
| Field Summary | |
|---|---|
protected double |
anchorX
The x-value for the anchor point. |
protected double |
anchorY
The y-value for the anchor point. |
protected double |
crosshairX
The x-value for the crosshair point. |
protected double |
crosshairY
The y-value for the crosshair point. |
protected double |
distance
The smallest distance so far between the anchor point and a data point. |
| Constructor Summary | |
|---|---|
CrosshairInfo()
Default constructor. |
|
| Method Summary | |
|---|---|
double |
getCrosshairX()
Sets the x-value for the crosshair point. |
double |
getCrosshairY()
Sets the y-value for the crosshair point. |
void |
setAnchorX(double x)
Sets the x-value for the anchor point. |
void |
setAnchorY(double y)
Sets the y-value for the anchor point. |
void |
setCrosshairDistance(double distance)
Sets the distance. |
void |
updateCrosshairPoint(double candidateX,
double candidateY)
Evaluates a data point and if it is the closest to the anchor point it becomes the new crosshair point. |
void |
updateCrosshairX(double candidateX)
Evaluates an x-value and if it is the closest to the anchor point it becomes the new crosshair point. |
void |
updateCrosshairY(double candidateY)
Evaluates a y-value and if it is the closest to the anchor point it becomes the new crosshair point. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double anchorX
protected double anchorY
protected double crosshairX
protected double crosshairY
protected double distance
| Constructor Detail |
|---|
public CrosshairInfo()
| Method Detail |
|---|
public void setCrosshairDistance(double distance)
public void updateCrosshairPoint(double candidateX,
double candidateY)
To understand this method, you need to know the context in which it will be called. An instance of this class is passed to an XYItemRenderer as each data point is plotted. As the point is plotted, it is passed to this method to see if it should be the new crosshair point.
public void updateCrosshairX(double candidateX)
Used in cases where only the x-axis is numerical.
public void updateCrosshairY(double candidateY)
Used in cases where only the y-axis is numerical.
public void setAnchorX(double x)
public void setAnchorY(double y)
public double getCrosshairX()
public double getCrosshairY()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||