org.jfree.chart.plot

Class Marker

Implemented Interfaces:
Cloneable, Serializable
Known Direct Subclasses:
CategoryMarker, IntervalMarker, ValueMarker

public abstract class Marker
extends java.lang.Object
implements Cloneable, Serializable

The base class for markers that can be added to plots to highlight a value or range of values.

Note that there is no listener mechanism for markers, so changing the attributes for a marker will not lead to any automatic chart repainting.

Constructor Summary

Marker()
Creates a new marker with default attributes.
Marker(Paint paint)
Constructs a new marker.
Marker(Paint paint, Stroke stroke, Paint outlinePaint, Stroke outlineStroke, float alpha)
Constructs a new marker.

Method Summary

Object
clone()
Creates a clone of the marker.
boolean
equals(Object obj)
Tests the marker for equality with an arbitrary object.
float
getAlpha()
Returns the alpha transparency.
String
getLabel()
Returns the label (if null no label is displayed).
RectangleAnchor
getLabelAnchor()
Returns the label anchor.
Font
getLabelFont()
Returns the label font.
RectangleInsets
getLabelOffset()
Returns the label offset.
LengthAdjustmentType
getLabelOffsetType()
Returns the label offset type.
Paint
getLabelPaint()
Returns the label paint.
TextAnchor
getLabelTextAnchor()
Returns the label text anchor.
Paint
getOutlinePaint()
Returns the outline paint.
Stroke
getOutlineStroke()
Returns the outline stroke.
Paint
getPaint()
Returns the paint.
Stroke
getStroke()
Returns the stroke.
void
setAlpha(float alpha)
Sets the alpha transparency that should be used when drawing the marker.
void
setLabel(String label)
Sets the label (if null no label is displayed).
void
setLabelAnchor(RectangleAnchor anchor)
Sets the label anchor.
void
setLabelFont(Font font)
Sets the label font.
void
setLabelOffset(RectangleInsets offset)
Sets the label offset.
void
setLabelOffsetType(LengthAdjustmentType adj)
Sets the label offset type.
void
setLabelPaint(Paint paint)
Sets the label paint.
void
setLabelTextAnchor(TextAnchor anchor)
Sets the label text anchor.
void
setOutlinePaint(Paint paint)
Sets the outline paint.
void
setOutlineStroke(Stroke stroke)
Sets the outline stroke.
void
setPaint(Paint paint)
Sets the paint.
void
setStroke(Stroke stroke)
Sets the stroke.

Constructor Details

Marker

protected Marker()
Creates a new marker with default attributes.

Marker

protected Marker(Paint paint)
Constructs a new marker.
Parameters:
paint - the paint (null not permitted).

Marker

protected Marker(Paint paint,
                 Stroke stroke,
                 Paint outlinePaint,
                 Stroke outlineStroke,
                 float alpha)
Constructs a new marker.
Parameters:
paint - the paint (null not permitted).
stroke - the stroke (null not permitted).
outlinePaint - the outline paint (null permitted).
outlineStroke - the outline stroke (null permitted).
alpha - the alpha transparency (must be in the range 0.0f to 1.0f).

Method Details

clone

public Object clone()
            throws CloneNotSupportedException
Creates a clone of the marker.
Returns:
A clone.

equals

public boolean equals(Object obj)
Tests the marker for equality with an arbitrary object.
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

getAlpha

public float getAlpha()
Returns the alpha transparency.
Returns:
The alpha transparency.

getLabel

public String getLabel()
Returns the label (if null no label is displayed).
Returns:
The label (possibly null).

getLabelAnchor

public RectangleAnchor getLabelAnchor()
Returns the label anchor. This defines the position of the label anchor, relative to the bounds of the marker.
Returns:
The label anchor (never null).

getLabelFont

public Font getLabelFont()
Returns the label font.
Returns:
The label font (never null).

getLabelOffset

public RectangleInsets getLabelOffset()
Returns the label offset.
Returns:
The label offset (never null).

getLabelOffsetType

public LengthAdjustmentType getLabelOffsetType()
Returns the label offset type.
Returns:
The type (never null).

getLabelPaint

public Paint getLabelPaint()
Returns the label paint.
Returns:
The label paint (never null).

getLabelTextAnchor

public TextAnchor getLabelTextAnchor()
Returns the label text anchor.
Returns:
The label text anchor (never null).

getOutlinePaint

public Paint getOutlinePaint()
Returns the outline paint.
Returns:
The outline paint (possibly null).

getOutlineStroke

public Stroke getOutlineStroke()
Returns the outline stroke.
Returns:
The outline stroke (possibly null).

getPaint

public Paint getPaint()
Returns the paint.
Returns:
The paint (never null).

getStroke

public Stroke getStroke()
Returns the stroke.
Returns:
The stroke (never null).

setAlpha

public void setAlpha(float alpha)
Sets the alpha transparency that should be used when drawing the marker. This is a value in the range 0.0f (completely transparent) to 1.0f (completely opaque).
Parameters:
alpha - the alpha transparency (must be in the range 0.0f to 1.0f).
See Also:
getAlpha()

setLabel

public void setLabel(String label)
Sets the label (if null no label is displayed).
Parameters:
label - the label (null permitted).
See Also:
getLabel()

setLabelAnchor

public void setLabelAnchor(RectangleAnchor anchor)
Sets the label anchor. This defines the position of the label anchor, relative to the bounds of the marker.
Parameters:
anchor - the anchor (null not permitted).

setLabelFont

public void setLabelFont(Font font)
Sets the label font.
Parameters:
font - the font (null not permitted).

setLabelOffset

public void setLabelOffset(RectangleInsets offset)
Sets the label offset.
Parameters:
offset - the label offset (null not permitted).

setLabelOffsetType

public void setLabelOffsetType(LengthAdjustmentType adj)
Sets the label offset type.
Parameters:
adj - the type (null not permitted).

setLabelPaint

public void setLabelPaint(Paint paint)
Sets the label paint.
Parameters:
paint - the paint (null not permitted).

setLabelTextAnchor

public void setLabelTextAnchor(TextAnchor anchor)
Sets the label text anchor.
Parameters:
anchor - the label text anchor (null not permitted).

setOutlinePaint

public void setOutlinePaint(Paint paint)
Sets the outline paint.
Parameters:
paint - the paint (null permitted).

setOutlineStroke

public void setOutlineStroke(Stroke stroke)
Sets the outline stroke.
Parameters:
stroke - the stroke (null permitted).

setPaint

public void setPaint(Paint paint)
Sets the paint.
Parameters:
paint - the paint (null not permitted).
See Also:
getPaint()

setStroke

public void setStroke(Stroke stroke)
Sets the stroke.
Parameters:
stroke - the stroke (null not permitted).
See Also:
getStroke()