Module org.jfree.chart3d
Package org.jfree.chart3d.marker

# Class RangeMarker

java.lang.Object
org.jfree.chart3d.marker.AbstractMarker
org.jfree.chart3d.marker.RangeMarker

All Implemented Interfaces:
  `Serializable`, `EventListener`, `ChartElement`, `Marker`, `MarkerChangeListener`, `ValueMarker`

public class RangeMarker extends AbstractMarker implements ValueMarker, MarkerChangeListener, Serializable
A marker that marks a range of values on an axis.
For an example, please refer to the demo `RangeMarkerDemo1.java`.
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:
  - Serialized Form

## 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`

## Constructor Summary

Constructors
Constructor
Description
`RangeMarker(double lowerBound, double upperBound)`
Creates a new range marker for the given bounds.
`RangeMarker(double lowerBound, double upperBound, String label)`
Creates a new range marker for the given bounds.

## Method Summary

Modifier and Type
Method
Description
`void`
`draw(Graphics2D g2, MarkerData markerData, boolean reverse)`
Draws the marker based on the `markerData` which has been passed to the 3D engine to generate the required 2D projection points.
`boolean`
`equals(Object obj)`
Tests this marker for equality with an arbitrary object.
`NumberMarker`
`getEnd()`
Returns the ending point for the range marker.
`Color`
`getFillColor()`
Returns the color used to fill the band representing the range for the marker.
`Font`
`getFont()`
Returns the font for the label.
`String`
`getLabel()`
Returns the label for the marker (if this is `null` then no label is displayed).
`Anchor2D`
`getLabelAnchor()`
Returns the anchor for the label.
`Color`
`getLabelColor()`
Returns the label color.
`Range`
`getRange()`
Returns the range of values for the marker.
`NumberMarker`
`getStart()`
Returns the starting point for the range marker.
`int`
`hashCode()`
`void`
`markerChanged(MarkerChangeEvent event)`
Receives notification of a change to the start or end marker for the range.
`void`
`setFillColor(Color color)`
Sets the color used to fill the band representing the range for the marker and sends a change event to all registered listeners.
`void`
`setFont(Font font)`
Sets the font for the marker label and sends a change event to all registered listeners.
`void`
`setLabel(String label)`
Sets the label and sends a change event to all registered listeners.
`void`
`setLabelAnchor(Anchor2D anchor)`
Sets the anchor for the label and sends a change event to all registered listeners.
`void`
`setLabelColor(Color color)`
Sets the label color and sends a change event to all registered listeners.

### Methods inherited from class org.jfree.chart3d.marker.AbstractMarker

`addChangeListener, deriveTextAnchor, deriveTextAnchorForLine, drawMarkerLabel, drawMarkerLabel, fireChangeEvent, receive, removeChangeListener`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.jfree.chart3d.ChartElement

`receive`

### Methods inherited from interface org.jfree.chart3d.marker.Marker

`addChangeListener, removeChangeListener`

## Constructor Details

### RangeMarker

public RangeMarker(double lowerBound, double upperBound)
Creates a new range marker for the given bounds.

Parameters:
  `lowerBound` - the lower bound.
  `upperBound` - the upper bound.

### RangeMarker

public RangeMarker(double lowerBound, double upperBound, String label)
Creates a new range marker for the given bounds.

Parameters:
  `lowerBound` - the lower bound.
  `upperBound` - the upper bound.
  `label` - the label (`null` permitted).

## Method Details

### getStart

public NumberMarker getStart()
Returns the starting point for the range marker.

Returns:
  The starting point.

### getEnd

public NumberMarker getEnd()
Returns the ending point for the range marker.

Returns:
  The ending point.

### getRange

public Range getRange()
Returns the range of values for the marker.

Specified by:
  `getRange` in interface `ValueMarker`
Returns:
  The range of values for the marker.

### getLabel

public String getLabel()
Returns the label for the marker (if this is `null` then no label is displayed).

Returns:
  The label (possibly `null`).

### setLabel

public void setLabel(String label)
Sets the label and sends a change event to all registered listeners. If the label is set to `null` then no label is displayed for the marker.

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

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

### getFillColor

public Color getFillColor()
Returns the color used to fill the band representing the range for the marker. The default value is `Marker.DEFAULT_FILL_COLOR`.

Returns:
  The fill color (never `null`).

### setFillColor

public void setFillColor(Color color)
Sets the color used to fill the band representing the range for the marker 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)
Description copied from interface: `Marker`
Draws the marker based on the `markerData` which has been passed to the 3D engine to generate the required 2D projection points.

Specified by:
  `draw` in interface `Marker`
Parameters:
  `g2` - the graphics target (`null` not permitted).
  `markerData` - transient data for the marker (`null` not permitted).
  `reverse` - a flag to indicate reverse orientation.

### markerChanged

public void markerChanged(MarkerChangeEvent event)
Receives notification of a change to the start or end marker for the range.

Specified by:
  `markerChanged` in interface `MarkerChangeListener`
Parameters:
  `event` - the event (`null` not permitted).

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)
Tests this marker for equality with an arbitrary object.

Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - the object to test against (`null` permitted).
Returns:
  A boolean.