org.jfree.chart.plot

Class CategoryCrosshairState

public class CategoryCrosshairState extends CrosshairState

Represents state information for the crosshairs in a CategoryPlot. An instance of this class is created at the start of the rendering process, and updated as each data item is rendered. At the end of the rendering process, this class holds the row key, column key and value for the crosshair location.

Since: 1.0.11

Constructor Summary
CategoryCrosshairState()
Creates a new instance.
Method Summary
ComparablegetColumnKey()
Returns the column key.
ComparablegetRowKey()
Returns the row key.
voidsetColumnKey(Comparable key)
Sets the column key.
voidsetRowKey(Comparable key)
Sets the row key.
voidupdateCrosshairPoint(Comparable rowKey, Comparable columnKey, double value, int datasetIndex, double transX, double transY, PlotOrientation orientation)
Evaluates a data point from a CategoryItemRenderer and if it is the closest to the anchor point it becomes the new crosshair point.
voidupdateCrosshairX(Comparable rowKey, Comparable columnKey, int datasetIndex, double transX, PlotOrientation orientation)
Updates only the crosshair row and column keys (this is for the case where the range crosshair does NOT lock onto the nearest data value).

Constructor Detail

CategoryCrosshairState

public CategoryCrosshairState()
Creates a new instance.

Method Detail

getColumnKey

public Comparable getColumnKey()
Returns the column key.

Returns: The column key.

getRowKey

public Comparable getRowKey()
Returns the row key.

Returns: The row key.

setColumnKey

public void setColumnKey(Comparable key)
Sets the column key.

Parameters: key the key.

setRowKey

public void setRowKey(Comparable key)
Sets the row key.

Parameters: key the row key.

updateCrosshairPoint

public void updateCrosshairPoint(Comparable rowKey, Comparable columnKey, double value, int datasetIndex, double transX, double transY, PlotOrientation orientation)
Evaluates a data point from a CategoryItemRenderer and if it is the closest to the anchor point it becomes the new crosshair point.

Parameters: rowKey the row key. columnKey the column key. value y coordinate (measured against the range axis). datasetIndex the dataset index for this point. transX x translated into Java2D space. transY y translated into Java2D space. orientation the plot orientation.

updateCrosshairX

public void updateCrosshairX(Comparable rowKey, Comparable columnKey, int datasetIndex, double transX, PlotOrientation orientation)
Updates only the crosshair row and column keys (this is for the case where the range crosshair does NOT lock onto the nearest data value).

Parameters: rowKey the row key. columnKey the column key. datasetIndex the dataset axis index. transX the translated x-value. orientation the plot orientation.

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.