java.lang.Object | |
↳ | org.jfree.chart.plot.CrosshairState |
![]() |
Maintains state information about crosshairs on a plot between successive calls to the renderer's draw method. This class is used internally by JFreeChart - it is not intended for external use.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new
CrosshairState instance that calculates
distance in Java2D space. | |||||||||||
Creates a new
CrosshairState instance. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the anchor point.
| |||||||||||
Returns the x-coordinate (in data space) for the anchor point.
| |||||||||||
Returns the y-coordinate (in data space) for the anchor point.
| |||||||||||
Returns the distance between the anchor point and the current crosshair
point.
| |||||||||||
Get the x-value for the crosshair point.
| |||||||||||
Get the y-value for the crosshair point.
| |||||||||||
Returns the dataset index that the crosshair values relate to.
| |||||||||||
This method is deprecated.
As of version 1.0.11, the domain axis should be determined
using the dataset index.
| |||||||||||
This method is deprecated.
As of version 1.0.11, the domain axis should be determined
using the dataset index.
| |||||||||||
Sets the anchor point.
| |||||||||||
Sets the x-coordinate (in data space) for the anchor point.
| |||||||||||
Sets the y-coordinate (in data space) for the anchor point.
| |||||||||||
Sets the distance between the anchor point and the current crosshair
point.
| |||||||||||
Sets the x coordinate for the crosshair.
| |||||||||||
Sets the y coordinate for the crosshair.
| |||||||||||
Sets the dataset index that the current crosshair values relate to.
| |||||||||||
Evaluates a data point and if it is the closest to the anchor point it
becomes the new crosshair point.
| |||||||||||
This method is deprecated.
Use
updateCrosshairPoint(double, double, int, int, double, double, PlotOrientation) . See bug report 1086307.
| |||||||||||
This method is deprecated.
Use
updateCrosshairX(double, int) . 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.
| |||||||||||
This method is deprecated.
Use
updateCrosshairY(double, int) . 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.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Creates a new CrosshairState
instance that calculates
distance in Java2D space.
Creates a new CrosshairState
instance.
calculateDistanceInDataSpace | a flag that controls whether the distance is calculated in data space or Java2D space. |
---|
Returns the x-coordinate (in data space) for the anchor point.
Returns the y-coordinate (in data space) for the anchor point.
Returns the distance between the anchor point and the current crosshair point.
Get the x-value for the crosshair point.
Get the y-value for the crosshair point. This is the coordinate in data space measured against the range axis.
Returns the dataset index that the crosshair values relate to. The dataset is mapped to specific axes, and this is how the crosshairs are mapped also.
This method is deprecated.
As of version 1.0.11, the domain axis should be determined
using the dataset index.
Returns the domain axis index for the crosshair x-value.
This method is deprecated.
As of version 1.0.11, the domain axis should be determined
using the dataset index.
Returns the range axis index for the crosshair y-value.
Sets the anchor point. This is usually the mouse click point in a chart
panel, and the crosshair point will often be the data item that is
closest to the anchor point.
Note that the x and y coordinates (in data space) are not updated by
this method - the caller is responsible for ensuring that this happens
in sync.
anchor | the anchor point (null permitted). |
---|
Sets the x-coordinate (in data space) for the anchor point. Note that this does NOT update the anchor itself - the caller is responsible for ensuring this is done in sync.
x | the x-coordinate. |
---|
Sets the y-coordinate (in data space) for the anchor point. Note that this does NOT update the anchor itself - the caller is responsible for ensuring this is done in sync.
y | the y-coordinate. |
---|
Sets the distance between the anchor point and the current crosshair point. As each data point is processed, its distance to the anchor point is compared with this value and, if it is closer, the data point becomes the new crosshair point.
distance | the distance. |
---|
Sets the x coordinate for the crosshair. This is the coordinate in data space measured against the domain axis.
x | the coordinate. |
---|
Sets the y coordinate for the crosshair.
y | the y coordinate. |
---|
Sets the dataset index that the current crosshair values relate to.
index | the dataset index. |
---|
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.
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. |
This method is deprecated.
Use updateCrosshairPoint(double, double, int, int, double, double, PlotOrientation)
. 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.
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. |
This method is deprecated.
Use updateCrosshairX(double, int)
. 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.
candidateX | x position of the candidate for the new crosshair point. |
---|
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.
candidateX | x position of the candidate for the new crosshair point. |
---|---|
domainAxisIndex | the index of the domain axis for this x-value. |
This method is deprecated.
Use updateCrosshairY(double, int)
. 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.
candidateY | y position of the candidate for the new crosshair point. |
---|
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.
candidateY | y position of the candidate for the new crosshair point. |
---|---|
rangeAxisIndex | the index of the range axis for this y-value. |