Class NumberMarker

java.lang.Object
org.jfree.chart3d.marker.AbstractMarker
org.jfree.chart3d.marker.NumberMarker
All Implemented Interfaces:
Serializable, ChartElement, Marker, ValueMarker

public class NumberMarker extends AbstractMarker implements ValueMarker, Serializable
A marker used to mark one value on an axis.

NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
Since:
1.2
See Also:
  • Constructor Details

    • NumberMarker

      public NumberMarker(double value)
      Creates a new marker.
      Parameters:
      value - the value.
  • Method Details

    • getValue

      public double getValue()
      Returns the value for the marker (the initial value comes from the constructor).
      Returns:
      The value.
    • setValue

      public void setValue(double value)
      Sets the value for the marker and sends a change event to all registered listeners.
      Parameters:
      value - the value.
    • getRange

      public Range getRange()
      Returns the range for the marker (in this case, a single value range). This method is used by the axis to filter out markers that do not touch the current axis range.
      Specified by:
      getRange in interface ValueMarker
      Returns:
      The range for the marker (never null).
    • getLabel

      public String getLabel()
      Returns the label for the marker (if this is null then no label is displayed). The default value is null.
      Returns:
      The label (possibly null).
    • setLabel

      public void setLabel(String label)
      Sets the label and sends a change event to all registered listeners.
      Parameters:
      label - the label (null permitted).
    • getFont

      public Font getFont()
      Returns the font for the label. The default value is Marker.DEFAULT_MARKER_FONT.
      Returns:
      The font (never null).
    • setFont

      public void setFont(Font font)
      Sets the font for the marker label and sends a change event to all registered listeners.
      Parameters:
      font - the font (null not permitted).
    • getLabelColor

      public Color getLabelColor()
      Returns the label color. The default value is Marker.DEFAULT_LABEL_COLOR.
      Returns:
      The label color (never null).
    • setLabelColor

      public void setLabelColor(Color color)
      Sets the label color and sends a change event to all registered listeners.
      Parameters:
      color - the color (null not permitted).
    • getLabelAnchor

      Returns the anchor for the label. The default value is Anchor2D.CENTER.
      Returns:
      The anchor for the label.
    • setLabelAnchor

      public void setLabelAnchor(Anchor2D anchor)
      Sets the anchor for the label and sends a change event to all registered listeners.
      Parameters:
      anchor - the anchor (null not permitted).
    • getLineStroke

      Returns the stroke for the marker line. The default value is Marker.DEFAULT_LINE_STROKE.
      Returns:
      The stroke for the marker line (never null).
    • setLineStroke

      public void setLineStroke(Stroke stroke)
      Sets the stroke for the marker line and sends a change event to all registered listeners.
      Parameters:
      stroke - the stroke (null not permitted).
    • getLineColor

      public Color getLineColor()
      Returns the color for the marker line. The default value is Marker.DEFAULT_LINE_COLOR.
      Returns:
      The color for the marker line (never null).
    • setLineColor

      public void setLineColor(Color color)
      Sets the color for the marker line and sends a change event to all registered listeners.
      Parameters:
      color - the color (null not permitted).
    • draw

      public void draw(Graphics2D g2, MarkerData markerData, boolean reverse)
      Draws the marker. This method is called by the library, you won't normally call it directly.
      Specified by:
      draw in interface Marker
      Parameters:
      g2 - the graphics target (null not permitted).
      markerData - transient marker data (null not permitted).
      reverse - a flag to indicate reverse orientation.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object