java.lang.Object
org.jfree.chart3d.marker.AbstractMarker
- All Implemented Interfaces:
ChartElement
,Marker
- Direct Known Subclasses:
CategoryMarker
,NumberMarker
,RangeMarker
A base class for implementing markers (includes the event notification
mechanism).
- Since:
- 1.2
-
Field Summary
Fields inherited from interface org.jfree.chart3d.marker.Marker
DEFAULT_FILL_COLOR, DEFAULT_LABEL_COLOR, DEFAULT_LINE_COLOR, DEFAULT_LINE_STROKE, DEFAULT_MARKER_FONT
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(MarkerChangeListener listener) Registers a listener to receive notification of changes to the marker.protected static TextAnchor
deriveTextAnchor
(RefPt2D refPt, boolean vflip) A utility method that returns a suitable text anchor for a given reference point.protected static TextAnchor
deriveTextAnchorForLine
(RefPt2D refPt, boolean vflip) A utility method that returns a suitable text anchor for a given reference point relative to a line (rather than a rectangle which is the normal case).protected void
drawMarkerLabel
(Graphics2D g2, String label, double x, double y, Anchor2D anchor, Line2D refLine, boolean reverse) Draws a marker label.protected void
drawMarkerLabel
(Graphics2D g2, String label, double x, double y, Anchor2D anchor, Line2D refLine1, Line2D refLine2, boolean reverse) Draws a marker label.protected void
Sends aMarkerChangeEvent
to all registered listeners.void
receive
(ChartElementVisitor visitor) Receives a visitor.void
removeChangeListener
(MarkerChangeListener listener) Deregisters a listener so that it no longer receives notification of changes to the marker.
-
Method Details
-
drawMarkerLabel
protected void drawMarkerLabel(Graphics2D g2, String label, double x, double y, Anchor2D anchor, Line2D refLine, boolean reverse) Draws a marker label.- Parameters:
g2
- the graphics target (null
not permitted).label
- the label.x
- the x-coordinate for the anchor point.y
- the y-cpordinate for the anchor point.anchor
- the label anchor (null
not permitted).refLine
- a reference line that is used to determine the rotation angle for the label (null
not permitted).reverse
- a flag to indicate reverse orientation.
-
drawMarkerLabel
protected void drawMarkerLabel(Graphics2D g2, String label, double x, double y, Anchor2D anchor, Line2D refLine1, Line2D refLine2, boolean reverse) Draws a marker label.- Parameters:
g2
- the graphics target (null
not permitted).label
- the label.x
- the x-coordinate for the anchor point.y
- the y-cpordinate for the anchor point.anchor
- the label anchor (null
not permitted).refLine1
- a reference line that is used to determine the rotation angle for the label (null
not permitted).refLine2
- a reference line that is used to determine the rotation angle for the label (null
not permitted).reverse
- a flag to indicate reverse orientation.
-
receive
Receives a visitor.- Specified by:
receive
in interfaceChartElement
- Parameters:
visitor
- the visitor.- Since:
- 1.2
-
addChangeListener
Registers a listener to receive notification of changes to the marker.- Specified by:
addChangeListener
in interfaceMarker
- Parameters:
listener
- the listener (null
not permitted).
-
removeChangeListener
Deregisters a listener so that it no longer receives notification of changes to the marker.- Specified by:
removeChangeListener
in interfaceMarker
- Parameters:
listener
- the listener (null
not permitted).
-
fireChangeEvent
Sends aMarkerChangeEvent
to all registered listeners. -
deriveTextAnchor
A utility method that returns a suitable text anchor for a given reference point. This is used for range marker label positioning.- Parameters:
refPt
- the reference point (null
not permitted).vflip
- is the text flipped vertically?- Returns:
- A text anchor (never
null
).
-
deriveTextAnchorForLine
A utility method that returns a suitable text anchor for a given reference point relative to a line (rather than a rectangle which is the normal case). This is used for value marker label positioning.- Parameters:
refPt
- the reference point (null
not permitted).vflip
- is the text flipped vertically?- Returns:
- A text anchor (never
null
).
-