java.lang.Object
org.jfree.chart.plot.Marker
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
CategoryMarker
,IntervalMarker
,ValueMarker
The base class for markers that can be added to plots to highlight a value
or range of values.
An event notification mechanism was added to this class in JFreeChart version 1.0.3.
An event notification mechanism was added to this class in JFreeChart version 1.0.3.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(MarkerChangeListener listener) Registers an object for notification of changes to the marker.clone()
Creates a clone of the marker.boolean
Tests the marker for equality with an arbitrary object.float
getAlpha()
Returns the alpha transparency.getLabel()
Returns the label (ifnull
no label is displayed).Returns the label anchor.Returns the label background color.Returns the label font.Returns the label offset.Returns the label offset type.Returns the label paint.Returns the label text anchor.getListeners
(Class listenerType) Returns an array containing all the listeners of the specified type.Returns the outline paint.Returns the outline stroke.getPaint()
Returns the paint.Returns the stroke.void
notifyListeners
(MarkerChangeEvent event) Notifies all registered listeners that the marker has been modified.void
removeChangeListener
(MarkerChangeListener listener) Unregisters an object for notification of changes to the marker.void
setAlpha
(float alpha) Sets the alpha transparency that should be used when drawing the marker, and sends aMarkerChangeEvent
to all registered listeners.void
Sets the label (ifnull
no label is displayed) and sends aMarkerChangeEvent
to all registered listeners.void
setLabelAnchor
(RectangleAnchor anchor) Sets the label anchor and sends aMarkerChangeEvent
to all registered listeners.void
setLabelBackgroundColor
(Color color) Sets the label background color.void
setLabelFont
(Font font) Sets the label font and sends aMarkerChangeEvent
to all registered listeners.void
setLabelOffset
(RectangleInsets offset) Sets the label offset and sends aMarkerChangeEvent
to all registered listeners.void
Sets the label offset type and sends aMarkerChangeEvent
to all registered listeners.void
setLabelPaint
(Paint paint) Sets the label paint and sends aMarkerChangeEvent
to all registered listeners.void
setLabelTextAnchor
(TextAnchor anchor) Sets the label text anchor and sends aMarkerChangeEvent
to all registered listeners.void
setOutlinePaint
(Paint paint) Sets the outline paint and sends aMarkerChangeEvent
to all registered listeners.void
setOutlineStroke
(Stroke stroke) Sets the outline stroke and sends aMarkerChangeEvent
to all registered listeners.void
Sets the paint and sends aMarkerChangeEvent
to all registered listeners.void
Sets the stroke and sends aMarkerChangeEvent
to all registered listeners.
-
Constructor Details
-
Marker
protected Marker()Creates a new marker with default attributes. -
Marker
Constructs a new marker.- Parameters:
paint
- the paint (null
not permitted).
-
Marker
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).- Throws:
IllegalArgumentException
- ifpaint
orstroke
isnull
, oralpha
is not in the specified range.
-
-
Method Details
-
getPaint
Returns the paint.- Returns:
- The paint (never
null
). - See Also:
-
setPaint
Sets the paint and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getStroke
Returns the stroke.- Returns:
- The stroke (never
null
). - See Also:
-
setStroke
Sets the stroke and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
stroke
- the stroke (null
not permitted).- See Also:
-
getOutlinePaint
Returns the outline paint.- Returns:
- The outline paint (possibly
null
). - See Also:
-
setOutlinePaint
Sets the outline paint and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
paint
- the paint (null
permitted).- See Also:
-
getOutlineStroke
Returns the outline stroke.- Returns:
- The outline stroke (possibly
null
). - See Also:
-
setOutlineStroke
Sets the outline stroke and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
stroke
- the stroke (null
permitted).- See Also:
-
getAlpha
public float getAlpha()Returns the alpha transparency.- Returns:
- The alpha transparency.
- See Also:
-
setAlpha
public void setAlpha(float alpha) Sets the alpha transparency that should be used when drawing the marker, and sends aMarkerChangeEvent
to all registered listeners. The alpha transparency 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).- Throws:
IllegalArgumentException
- ifalpha
is not in the specified range.- See Also:
-
getLabel
Returns the label (ifnull
no label is displayed).- Returns:
- The label (possibly
null
). - See Also:
-
setLabel
Sets the label (ifnull
no label is displayed) and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
label
- the label (null
permitted).- See Also:
-
getLabelFont
Returns the label font.- Returns:
- The label font (never
null
). - See Also:
-
setLabelFont
Sets the label font and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
font
- the font (null
not permitted).- See Also:
-
getLabelPaint
Returns the label paint.- Returns:
- The label paint (never
null
). - See Also:
-
setLabelPaint
Sets the label paint and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
paint
- the paint (null
not permitted).- See Also:
-
getLabelBackgroundColor
Returns the label background color. The default value isColor(100, 100, 100, 100)
..- Returns:
- The label background color (never
null
).
-
setLabelBackgroundColor
Sets the label background color.- Parameters:
color
- the color (null
not permitted).
-
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
). - See Also:
-
setLabelAnchor
Sets the label anchor and sends aMarkerChangeEvent
to all registered listeners. The anchor defines the position of the label anchor, relative to the bounds of the marker.- Parameters:
anchor
- the anchor (null
not permitted).- See Also:
-
getLabelOffset
Returns the label offset.- Returns:
- The label offset (never
null
). - See Also:
-
setLabelOffset
Sets the label offset and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
offset
- the label offset (null
not permitted).- See Also:
-
getLabelOffsetType
Returns the label offset type.- Returns:
- The type (never
null
). - See Also:
-
setLabelOffsetType
Sets the label offset type and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
adj
- the type (null
not permitted).- See Also:
-
getLabelTextAnchor
Returns the label text anchor.- Returns:
- The label text anchor (never
null
). - See Also:
-
setLabelTextAnchor
Sets the label text anchor and sends aMarkerChangeEvent
to all registered listeners.- Parameters:
anchor
- the label text anchor (null
not permitted).- See Also:
-
addChangeListener
Registers an object for notification of changes to the marker.- Parameters:
listener
- the object to be registered.- See Also:
-
removeChangeListener
Unregisters an object for notification of changes to the marker.- Parameters:
listener
- the object to be unregistered.- See Also:
-
notifyListeners
Notifies all registered listeners that the marker has been modified.- Parameters:
event
- information about the change event.
-
getListeners
Returns an array containing all the listeners of the specified type.- Parameters:
listenerType
- the listener type.- Returns:
- The array of listeners.
-
equals
Tests the marker for equality with an arbitrary object. -
clone
Creates a clone of the marker.- Overrides:
clone
in classObject
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- never.
-