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 TypeMethodDescriptionvoidaddChangeListener(MarkerChangeListener listener) Registers a listener to receive notification of changes to the marker.protected static TextAnchorderiveTextAnchor(RefPt2D refPt, boolean vflip) A utility method that returns a suitable text anchor for a given reference point.protected static TextAnchorderiveTextAnchorForLine(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 voiddrawMarkerLabel(Graphics2D g2, String label, double x, double y, Anchor2D anchor, Line2D refLine, boolean reverse) Draws a marker label.protected voiddrawMarkerLabel(Graphics2D g2, String label, double x, double y, Anchor2D anchor, Line2D refLine1, Line2D refLine2, boolean reverse) Draws a marker label.protected voidSends aMarkerChangeEventto all registered listeners.voidreceive(ChartElementVisitor visitor) Receives a visitor.voidremoveChangeListener(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 (nullnot permitted).label- the label.x- the x-coordinate for the anchor point.y- the y-cpordinate for the anchor point.anchor- the label anchor (nullnot permitted).refLine- a reference line that is used to determine the rotation angle for the label (nullnot 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 (nullnot permitted).label- the label.x- the x-coordinate for the anchor point.y- the y-cpordinate for the anchor point.anchor- the label anchor (nullnot permitted).refLine1- a reference line that is used to determine the rotation angle for the label (nullnot permitted).refLine2- a reference line that is used to determine the rotation angle for the label (nullnot permitted).reverse- a flag to indicate reverse orientation.
-
receive
Receives a visitor.- Specified by:
receivein interfaceChartElement- Parameters:
visitor- the visitor.- Since:
- 1.2
-
addChangeListener
Registers a listener to receive notification of changes to the marker.- Specified by:
addChangeListenerin interfaceMarker- Parameters:
listener- the listener (nullnot permitted).
-
removeChangeListener
Deregisters a listener so that it no longer receives notification of changes to the marker.- Specified by:
removeChangeListenerin interfaceMarker- Parameters:
listener- the listener (nullnot permitted).
-
fireChangeEvent
Sends aMarkerChangeEventto 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 (nullnot 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 (nullnot permitted).vflip- is the text flipped vertically?- Returns:
- A text anchor (never
null).
-