org.jfree.chart.plot
public class CrosshairState extends Object
Constructor Summary | |
---|---|
CrosshairState()
Creates a new CrosshairState instance that calculates
distance in Java2D space. | |
CrosshairState(boolean calculateDistanceInDataSpace)
Creates a new CrosshairState instance.
|
Method Summary | |
---|---|
Point2D | getAnchor()
Returns the anchor point.
|
double | getAnchorX()
Returns the x-coordinate (in data space) for the anchor point.
|
double | getAnchorY()
Returns the y-coordinate (in data space) for the anchor point.
|
double | getCrosshairDistance()
Returns the distance between the anchor point and the current crosshair
point.
|
double | getCrosshairX()
Get the x-value for the crosshair point.
|
double | getCrosshairY()
Get the y-value for the crosshair point. |
int | getDomainAxisIndex()
Returns the domain axis index for the crosshair x-value.
|
int | getRangeAxisIndex()
Returns the range axis index for the crosshair y-value.
|
void | setAnchor(Point2D anchor)
Sets the anchor point. |
void | setAnchorX(double x)
Sets the x-coordinate (in data space) for the anchor point. |
void | setAnchorY(double y)
Sets the y-coordinate (in data space) for the anchor point. |
void | setCrosshairDistance(double distance)
Sets the distance between the anchor point and the current crosshair
point. |
void | setCrosshairX(double x)
Sets the x coordinate for the crosshair. |
void | setCrosshairY(double y)
Sets the y coordinate for the crosshair.
|
void | updateCrosshairPoint(double x, double y, double transX, double transY, PlotOrientation orientation)
Evaluates a data point and if it is the closest to the anchor point it
becomes the new crosshair point.
|
void | updateCrosshairPoint(double x, double y, int domainAxisIndex, int rangeAxisIndex, double transX, double transY, PlotOrientation orientation)
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 x-value it
becomes the new crosshair value.
|
void | updateCrosshairX(double candidateX, int domainAxisIndex)
Evaluates an x-value and if it is the closest to the anchor x-value it
becomes the new crosshair value.
|
void | updateCrosshairY(double candidateY)
Evaluates a y-value and if it is the closest to the anchor y-value it
becomes the new crosshair value.
|
void | updateCrosshairY(double candidateY, int rangeAxisIndex)
Evaluates a y-value and if it is the closest to the anchor y-value it
becomes the new crosshair value.
|
CrosshairState
instance that calculates
distance in Java2D space.CrosshairState
instance.
Parameters: calculateDistanceInDataSpace a flag that controls whether the distance is calculated in data space or Java2D space.
Returns: The x-coordinate of the anchor point.
Since: 1.0.3
Returns: The y-coordinate of teh anchor point.
Since: 1.0.3
Returns: The distance.
Since: 1.0.3
See Also: CrosshairState
Returns: The x position of the crosshair point.
See Also: CrosshairState
Returns: The y position of the crosshair point.
See Also: CrosshairState
Returns: The domain axis index.
Since: 1.0.4
Returns: The range axis index.
Since: 1.0.4
Parameters: anchor the anchor point (null
permitted).
See Also: getAnchor
Parameters: x the x-coordinate.
Since: 1.0.3
Parameters: y the y-coordinate.
Since: 1.0.3
Parameters: distance the distance.
See Also: getCrosshairDistance
Parameters: x the coordinate.
See Also: getCrosshairX CrosshairState CrosshairState
Parameters: y the y coordinate.
See Also: getCrosshairY CrosshairState CrosshairState
Deprecated: Use CrosshairState. See bug report 1086307.
Evaluates a data point and if it is the closest to the anchor point it becomes the new crosshair point.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.
Parameters: x x coordinate (measured against the domain axis). y y coordinate (measured against the range axis). transX x translated into Java2D space. transY y translated into Java2D space. orientation the plot orientation.
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.
Parameters: x x coordinate (measured against the domain axis). y y coordinate (measured against the range axis). domainAxisIndex the index of the domain axis for this point. rangeAxisIndex the index of the range axis for this point. transX x translated into Java2D space. transY y translated into Java2D space. orientation the plot orientation.
Since: 1.0.4
Deprecated: Use CrosshairState. See bug report 1086307.
Evaluates an x-value and if it is the closest to the anchor x-value it becomes the new crosshair value.Used in cases where only the x-axis is numerical.
Parameters: candidateX x position of the candidate for the new crosshair point.
Used in cases where only the x-axis is numerical.
Parameters: candidateX x position of the candidate for the new crosshair point. domainAxisIndex the index of the domain axis for this x-value.
Since: 1.0.4
Deprecated: Use CrosshairState. See bug report 1086307.
Evaluates a y-value and if it is the closest to the anchor y-value it becomes the new crosshair value.Used in cases where only the y-axis is numerical.
Parameters: candidateY y position of the candidate for the new crosshair point.
Used in cases where only the y-axis is numerical.
Parameters: candidateY y position of the candidate for the new crosshair point. rangeAxisIndex the index of the range axis for this y-value.
Since: 1.0.4