Class AbstractMarker

java.lang.Object
org.jfree.chart3d.marker.AbstractMarker
All Implemented Interfaces:
ChartElement, Marker
Direct Known Subclasses:
CategoryMarker, NumberMarker, RangeMarker

public abstract class AbstractMarker extends Object implements Marker
A base class for implementing markers (includes the event notification mechanism).
Since:
1.2
  • 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

      public void receive(ChartElementVisitor visitor)
      Receives a visitor.
      Specified by:
      receive in interface ChartElement
      Parameters:
      visitor - the visitor.
      Since:
      1.2
    • addChangeListener

      public void addChangeListener(MarkerChangeListener listener)
      Registers a listener to receive notification of changes to the marker.
      Specified by:
      addChangeListener in interface Marker
      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 interface Marker
      Parameters:
      listener - the listener (null not permitted).
    • fireChangeEvent

      protected void fireChangeEvent()
      Sends a MarkerChangeEvent to all registered listeners.
    • deriveTextAnchor

      protected static TextAnchor deriveTextAnchor(RefPt2D refPt, boolean vflip)
      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

      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). 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).