| java.lang.Object org.jfree.chart.plot.CrosshairState
CrosshairState | public class CrosshairState (Code) | | 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.
|
Constructor Summary | |
public | CrosshairState() Creates a new CrosshairState instance that calculates
distance in Java2D space. | public | CrosshairState(boolean calculateDistanceInDataSpace) Creates a new CrosshairState instance. |
Method Summary | |
public Point2D | getAnchor() Returns the anchor point. | public double | getAnchorX() Returns the x-coordinate (in data space) for the anchor point. | public double | getAnchorY() Returns the y-coordinate (in data space) for the anchor point. | public double | getCrosshairDistance() Returns the distance between the anchor point and the current crosshair
point. | public double | getCrosshairX() Get the x-value for the crosshair point. | public double | getCrosshairY() Get the y-value for the crosshair point. | public int | getDomainAxisIndex() Returns the domain axis index for the crosshair x-value. | public int | getRangeAxisIndex() Returns the range axis index for the crosshair y-value. | public void | setAnchor(Point2D anchor) Sets the anchor point. | public void | setAnchorX(double x) Sets the x-coordinate (in data space) for the anchor point. | public void | setAnchorY(double y) Sets the y-coordinate (in data space) for the anchor point. | public void | setCrosshairDistance(double distance) Sets the distance between the anchor point and the current crosshair
point. | public void | setCrosshairX(double x) Sets the x coordinate for the crosshair. | public void | setCrosshairY(double y) Sets the y coordinate for the crosshair. | public 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.
To understand this method, you need to know the context in which it will
be called. | public 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.
To understand this method, you need to know the context in which it will
be called. | public 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. | public 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. | public 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. | public 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 | public CrosshairState()(Code) | | Creates a new CrosshairState instance that calculates
distance in Java2D space.
|
CrosshairState | public CrosshairState(boolean calculateDistanceInDataSpace)(Code) | | Creates a new CrosshairState instance.
Parameters: calculateDistanceInDataSpace - a flag that controls whether the distance is calculated in data space or Java2D space. |
getAnchorX | public double getAnchorX()(Code) | | Returns the x-coordinate (in data space) for the anchor point.
The x-coordinate of the anchor point. since: 1.0.3 |
getAnchorY | public double getAnchorY()(Code) | | Returns the y-coordinate (in data space) for the anchor point.
The y-coordinate of teh anchor point. since: 1.0.3 |
getCrosshairY | public double getCrosshairY()(Code) | | Get the y-value for the crosshair point. This is the coordinate in data
space measured against the range axis.
The y position of the crosshair point. See Also: CrosshairState.setCrosshairY(double) |
getDomainAxisIndex | public int getDomainAxisIndex()(Code) | | Returns the domain axis index for the crosshair x-value.
The domain axis index. since: 1.0.4 |
getRangeAxisIndex | public int getRangeAxisIndex()(Code) | | Returns the range axis index for the crosshair y-value.
The range axis index. since: 1.0.4 |
setAnchor | public void setAnchor(Point2D anchor)(Code) | | 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.
Parameters: anchor - the anchor point (null permitted). See Also: CrosshairState.getAnchor() |
setAnchorX | public void setAnchorX(double x)(Code) | | 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.
Parameters: x - the x-coordinate. since: 1.0.3 |
setAnchorY | public void setAnchorY(double y)(Code) | | 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.
Parameters: y - the y-coordinate. since: 1.0.3 |
setCrosshairDistance | public void setCrosshairDistance(double distance)(Code) | | 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.
Parameters: distance - the distance. See Also: CrosshairState.getCrosshairDistance() |
updateCrosshairPoint | public void updateCrosshairPoint(double x, double y, double transX, double transY, PlotOrientation orientation)(Code) | | 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
org.jfree.chart.renderer.xy.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). Parameters: y - y coordinate (measured against the range axis). Parameters: transX - x translated into Java2D space. Parameters: transY - y translated into Java2D space. Parameters: orientation - the plot orientation.CrosshairState.updateCrosshairPoint(double,double,int,int,double,double,PlotOrientation) |
updateCrosshairPoint | public void updateCrosshairPoint(double x, double y, int domainAxisIndex, int rangeAxisIndex, double transX, double transY, PlotOrientation orientation)(Code) | | 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
org.jfree.chart.renderer.xy.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). Parameters: y - y coordinate (measured against the range axis). Parameters: domainAxisIndex - the index of the domain axis for this point. Parameters: rangeAxisIndex - the index of the range axis for this point. Parameters: transX - x translated into Java2D space. Parameters: transY - y translated into Java2D space. Parameters: orientation - the plot orientation. since: 1.0.4 |
updateCrosshairX | public void updateCrosshairX(double candidateX)(Code) | | 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.CrosshairState.updateCrosshairX(double,int) |
updateCrosshairX | public void updateCrosshairX(double candidateX, int domainAxisIndex)(Code) | | 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. Parameters: domainAxisIndex - the index of the domain axis for this x-value. since: 1.0.4 |
updateCrosshairY | public void updateCrosshairY(double candidateY)(Code) | | 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.CrosshairState.updateCrosshairY(double,int) |
updateCrosshairY | public void updateCrosshairY(double candidateY, int rangeAxisIndex)(Code) | | 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. Parameters: rangeAxisIndex - the index of the range axis for this y-value. since: 1.0.4 |
|
|