public class

Crosshair

extends Object
implements Serializable Cloneable
java.lang.Object
   ↳ org.jfree.chart.plot.Crosshair

Class Overview

A crosshair for display on a plot.

Summary

Public Constructors
Crosshair()
Creates a new crosshair with value 0.0.
Crosshair(double value)
Creates a new crosshair with the specified value.
Crosshair(double value, Paint paint, Stroke stroke)
Creates a new crosshair value with the specified value and line style.
Public Methods
void addPropertyChangeListener(PropertyChangeListener l)
Adds a property change listener.
Object clone()
Returns an independent copy of this instance.
boolean equals(Object obj)
Tests this crosshair for equality with an arbitrary object.
RectangleAnchor getLabelAnchor()
Returns the label anchor point.
Paint getLabelBackgroundPaint()
Returns the label background paint.
Font getLabelFont()
Returns the label font.
CrosshairLabelGenerator getLabelGenerator()
Returns the crosshair label generator.
Paint getLabelOutlinePaint()
Returns the label outline paint.
Stroke getLabelOutlineStroke()
Returns the label outline stroke.
Paint getLabelPaint()
Returns the label paint.
double getLabelXOffset()
Returns the x-offset for the label (in Java2D units).
double getLabelYOffset()
Returns the y-offset for the label (in Java2D units).
Paint getPaint()
Returns the paint for the crosshair line.
Stroke getStroke()
Returns the stroke for the crosshair line.
double getValue()
Returns the crosshair value.
int hashCode()
Returns a hash code for this instance.
boolean isLabelOutlineVisible()
Returns the flag that controls the visibility of the label outline.
boolean isLabelVisible()
Returns the flag that controls whether or not a label is drawn for this crosshair.
boolean isVisible()
Returns the flag that indicates whether or not the crosshair is currently visible.
void removePropertyChangeListener(PropertyChangeListener l)
Removes a property change listener.
void setLabelAnchor(RectangleAnchor anchor)
Sets the label anchor point and sends a property change event (with the name 'labelAnchor') to all registered listeners.
void setLabelBackgroundPaint(Paint paint)
Sets the label background paint and sends a property change event with the name 'labelBackgroundPaint') to all registered listeners.
void setLabelFont(Font font)
Sets the label font and sends a property change event (with the name 'labelFont') to all registered listeners.
void setLabelGenerator(CrosshairLabelGenerator generator)
Sets the crosshair label generator and sends a property change event (with the name 'labelGenerator') to all registered listeners.
void setLabelOutlinePaint(Paint paint)
Sets the label outline paint and sends a property change event (with the name "labelOutlinePaint") to all registered listeners.
void setLabelOutlineStroke(Stroke stroke)
Sets the label outline stroke and sends a property change event (with the name 'labelOutlineStroke') to all registered listeners.
void setLabelOutlineVisible(boolean visible)
Sets the flag that controls the visibility of the label outlines and sends a property change event (with the name "labelOutlineVisible") to all registered listeners.
void setLabelPaint(Paint paint)
Sets the label paint and sends a property change event (with the name 'labelPaint') to all registered listeners.
void setLabelVisible(boolean visible)
Sets the flag that controls whether or not a label is drawn for the crosshair and sends a property change event (with the name 'labelVisible') to all registered listeners.
void setLabelXOffset(double offset)
Sets the x-offset and sends a property change event (with the name 'labelXOffset') to all registered listeners.
void setLabelYOffset(double offset)
Sets the y-offset and sends a property change event (with the name 'labelYOffset') to all registered listeners.
void setPaint(Paint paint)
Sets the paint for the crosshair line and sends a property change event with the name "paint" to all registered listeners.
void setStroke(Stroke stroke)
Sets the stroke for the crosshair line and sends a property change event with the name "stroke" to all registered listeners.
void setValue(double value)
Sets the crosshair value and sends a property change event with the name 'value' to all registered listeners.
void setVisible(boolean visible)
Sets the flag that controls the visibility of the crosshair and sends a proerty change event (with the name 'visible') to all registered listeners.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Crosshair ()

Creates a new crosshair with value 0.0.

public Crosshair (double value)

Creates a new crosshair with the specified value.

Parameters
value the value.

public Crosshair (double value, Paint paint, Stroke stroke)

Creates a new crosshair value with the specified value and line style.

Parameters
value the value.
paint the line paint (null not permitted).
stroke the line stroke (null not permitted).

Public Methods

public void addPropertyChangeListener (PropertyChangeListener l)

Adds a property change listener.

Parameters
l the listener.

public Object clone ()

Returns an independent copy of this instance.

Returns
  • An independent copy of this instance.

public boolean equals (Object obj)

Tests this crosshair for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public RectangleAnchor getLabelAnchor ()

Returns the label anchor point.

Returns
  • the label anchor point (never null.

public Paint getLabelBackgroundPaint ()

Returns the label background paint.

Returns
  • The label background paint (possibly null).

public Font getLabelFont ()

Returns the label font.

Returns
  • The label font (never null).

public CrosshairLabelGenerator getLabelGenerator ()

Returns the crosshair label generator.

Returns
  • The label crosshair generator (never null).

public Paint getLabelOutlinePaint ()

Returns the label outline paint.

Returns
  • The label outline paint (never null).

public Stroke getLabelOutlineStroke ()

Returns the label outline stroke.

Returns
  • The label outline stroke (never null).

public Paint getLabelPaint ()

Returns the label paint.

Returns
  • The label paint (never null).

public double getLabelXOffset ()

Returns the x-offset for the label (in Java2D units).

Returns
  • The x-offset.

public double getLabelYOffset ()

Returns the y-offset for the label (in Java2D units).

Returns
  • The y-offset.

public Paint getPaint ()

Returns the paint for the crosshair line.

Returns
  • The paint (never null).

public Stroke getStroke ()

Returns the stroke for the crosshair line.

Returns
  • The stroke (never null).

public double getValue ()

Returns the crosshair value.

Returns
  • The crosshair value.

public int hashCode ()

Returns a hash code for this instance.

Returns
  • A hash code.

public boolean isLabelOutlineVisible ()

Returns the flag that controls the visibility of the label outline.

Returns
  • A boolean.

public boolean isLabelVisible ()

Returns the flag that controls whether or not a label is drawn for this crosshair.

Returns
  • A boolean.

public boolean isVisible ()

Returns the flag that indicates whether or not the crosshair is currently visible.

Returns
  • A boolean.

public void removePropertyChangeListener (PropertyChangeListener l)

Removes a property change listener.

Parameters
l the listener.

public void setLabelAnchor (RectangleAnchor anchor)

Sets the label anchor point and sends a property change event (with the name 'labelAnchor') to all registered listeners.

Parameters
anchor the anchor (null not permitted).

public void setLabelBackgroundPaint (Paint paint)

Sets the label background paint and sends a property change event with the name 'labelBackgroundPaint') to all registered listeners.

Parameters
paint the paint (null permitted).

public void setLabelFont (Font font)

Sets the label font and sends a property change event (with the name 'labelFont') to all registered listeners.

Parameters
font the font (null not permitted).

public void setLabelGenerator (CrosshairLabelGenerator generator)

Sets the crosshair label generator and sends a property change event (with the name 'labelGenerator') to all registered listeners.

Parameters
generator the new generator (null not permitted).

public void setLabelOutlinePaint (Paint paint)

Sets the label outline paint and sends a property change event (with the name "labelOutlinePaint") to all registered listeners.

Parameters
paint the paint (null not permitted).

public void setLabelOutlineStroke (Stroke stroke)

Sets the label outline stroke and sends a property change event (with the name 'labelOutlineStroke') to all registered listeners.

Parameters
stroke the stroke (null not permitted).

public void setLabelOutlineVisible (boolean visible)

Sets the flag that controls the visibility of the label outlines and sends a property change event (with the name "labelOutlineVisible") to all registered listeners.

Parameters
visible the new flag value.

public void setLabelPaint (Paint paint)

Sets the label paint and sends a property change event (with the name 'labelPaint') to all registered listeners.

Parameters
paint the paint (null not permitted).

public void setLabelVisible (boolean visible)

Sets the flag that controls whether or not a label is drawn for the crosshair and sends a property change event (with the name 'labelVisible') to all registered listeners.

Parameters
visible the new flag value.

public void setLabelXOffset (double offset)

Sets the x-offset and sends a property change event (with the name 'labelXOffset') to all registered listeners.

Parameters
offset the new offset.

public void setLabelYOffset (double offset)

Sets the y-offset and sends a property change event (with the name 'labelYOffset') to all registered listeners.

Parameters
offset the new offset.

public void setPaint (Paint paint)

Sets the paint for the crosshair line and sends a property change event with the name "paint" to all registered listeners.

Parameters
paint the paint (null not permitted).

public void setStroke (Stroke stroke)

Sets the stroke for the crosshair line and sends a property change event with the name "stroke" to all registered listeners.

Parameters
stroke the stroke (null not permitted).

public void setValue (double value)

Sets the crosshair value and sends a property change event with the name 'value' to all registered listeners.

Parameters
value the value.

public void setVisible (boolean visible)

Sets the flag that controls the visibility of the crosshair and sends a proerty change event (with the name 'visible') to all registered listeners.

Parameters
visible the new flag value.