- java.lang.Object
-
- org.jfree.chart.plot.Marker
-
- org.jfree.chart.plot.CategoryMarker
-
- All Implemented Interfaces:
Serializable,Cloneable
public class CategoryMarker extends Marker implements Cloneable, Serializable
A marker for a category.
Note that for serialization to work correctly, the category key must be an instance of a serializable class.
-
-
Constructor Summary
Constructors Constructor Description CategoryMarker(Comparable<?> key)Creates a new category marker for the specified category.CategoryMarker(Comparable<?> key, Paint paint, Stroke stroke)Creates a new category marker.CategoryMarker(Comparable<?> key, Paint paint, Stroke stroke, Paint outlinePaint, Stroke outlineStroke, float alpha)Creates a new category marker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Tests the marker for equality with an arbitrary object.booleangetDrawAsLine()Returns the flag that controls whether the marker is drawn as a region or a line.Comparable<?>getKey()Returns the key.inthashCode()Returns a hash code for this instance.voidsetDrawAsLine(boolean drawAsLine)Sets the flag that controls whether the marker is drawn as a region or as a line, and sends aMarkerChangeEventto all registered listeners.voidsetKey(Comparable<?> key)Sets the key and sends aMarkerChangeEventto all registered listeners.-
Methods inherited from class org.jfree.chart.plot.Marker
addChangeListener, clone, getAlpha, getLabel, getLabelAnchor, getLabelBackgroundColor, getLabelFont, getLabelOffset, getLabelOffsetType, getLabelPaint, getLabelTextAnchor, getListeners, getOutlinePaint, getOutlineStroke, getPaint, getStroke, notifyListeners, removeChangeListener, setAlpha, setLabel, setLabelAnchor, setLabelBackgroundColor, setLabelFont, setLabelOffset, setLabelOffsetType, setLabelPaint, setLabelTextAnchor, setOutlinePaint, setOutlineStroke, setPaint, setStroke
-
-
-
-
Constructor Detail
-
CategoryMarker
public CategoryMarker(Comparable<?> key)
Creates a new category marker for the specified category.- Parameters:
key- the category key.
-
CategoryMarker
public CategoryMarker(Comparable<?> key, Paint paint, Stroke stroke)
Creates a new category marker.- Parameters:
key- the key.paint- the paint (nullnot permitted).stroke- the stroke (nullnot permitted).
-
CategoryMarker
public CategoryMarker(Comparable<?> key, Paint paint, Stroke stroke, Paint outlinePaint, Stroke outlineStroke, float alpha)
Creates a new category marker.- Parameters:
key- the key.paint- the paint (nullnot permitted).stroke- the stroke (nullnot permitted).outlinePaint- the outline paint (nullpermitted).outlineStroke- the outline stroke (nullpermitted).alpha- the alpha transparency.
-
-
Method Detail
-
getKey
public Comparable<?> getKey()
Returns the key.- Returns:
- The key.
-
setKey
public void setKey(Comparable<?> key)
Sets the key and sends aMarkerChangeEventto all registered listeners.- Parameters:
key- the key (nullnot permitted).
-
getDrawAsLine
public boolean getDrawAsLine()
Returns the flag that controls whether the marker is drawn as a region or a line.- Returns:
- A line.
-
setDrawAsLine
public void setDrawAsLine(boolean drawAsLine)
Sets the flag that controls whether the marker is drawn as a region or as a line, and sends aMarkerChangeEventto all registered listeners.- Parameters:
drawAsLine- the flag.
-
-