com.orsoncharts.marker

## Class MarkerData

- java.lang.Object
- - com.orsoncharts.marker.MarkerData

-     public class MarkerData
      extends java.lang.Object

  A record holder for data relating to markers that needs to be passed to the 3D engine.
  Since:
    1.2

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MarkerData(MarkerData source, int v0, int v1)` Creates a new instance based on an existing source that has type `MarkerDataType.VALUE`.
    `MarkerData(MarkerData source, int v0, int v1, int v2, int v3)` Creates a new instance based on an existing source that has type `MarkerDataType.Range`.
    `MarkerData(java.lang.String key, double pos)` Creates marker data for the case where there is a single line (for example, the `NumberMarker` class).
    `MarkerData(java.lang.String key, double startPos, boolean startPegged, double endPos, boolean endPegged)` Creates marker data for the case where there are two lines.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MarkerLine` | `getEndLine()` A convenience method that returns the end line data for a range marker.
    `Anchor2D` | `getLabelAnchor()` Returns the label anchor.
    `java.awt.geom.Point2D` | `getLabelPoint()` Returns the label projection point.
    `int` | `getLabelVertexIndex()` Returns the label vertex index.
    `java.lang.String` | `getMarkerKey()` Returns the marker key (allows retrieval of the original marker object when required).
    `MarkerLine` | `getStartLine()` A convenience method that returns the start line data for a range marker.
    `MarkerDataType` | `getType()` Returns the type of marker data (value or range).
    `MarkerLine` | `getValueLine()` A convenience method that returns the value line data for a value marker.
    `void` | `setLabelAnchor(Anchor2D anchor)` Sets the label anchor.
    `void` | `setLabelVertexIndex(int labelVertexIndex)` Sets the label vertex index.
    `java.lang.String` | `toString()`
    `void` | `updateProjection(java.awt.geom.Point2D[] pts)` Updates the projected points for this marker.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### MarkerData

          public MarkerData(java.lang.String key,
                            double pos)

      Creates marker data for the case where there is a single line (for example, the `NumberMarker` class).
      Parameters:
        `key` - the key for the marker (`null` not permitted).
        `pos` - the relative position along the axis (in the range 0.0 to 1.0).

    - #### MarkerData

          public MarkerData(java.lang.String key,
                            double startPos,
                            boolean startPegged,
                            double endPos,
                            boolean endPegged)

      Creates marker data for the case where there are two lines. (for example, the `RangeMarker` class).
      Parameters:
        `key` - the key (`null` not permitted).
        `startPos` - the relative start position.
        `startPegged` - is the start position pegged?
        `endPos` - the relative end position.
        `endPegged` - is the end position pegged?

    - #### MarkerData

          public MarkerData(MarkerData source,
                            int v0,
                            int v1)

      Creates a new instance based on an existing source that has type `MarkerDataType.VALUE`.
      Parameters:
        `source` - the source (`null` not permitted).
        `v0` - the vertex index for the start of the line.
        `v1` - the vertex index for the end of the line.

    - #### MarkerData

          public MarkerData(MarkerData source,
                            int v0,
                            int v1,
                            int v2,
                            int v3)

      Creates a new instance based on an existing source that has type `MarkerDataType.Range`.
      Parameters:
        `source` - the source (`null` not permitted).
        `v0` - the vertex index for the start of the first line.
        `v1` - the vertex index for the end of the first line.
        `v2` - the vertex index for the start of the second line.
        `v3` - the vertex index for the end of the second line.

  - ### Method Detail

    - #### getMarkerKey

          public java.lang.String getMarkerKey()

      Returns the marker key (allows retrieval of the original marker object when required).
      Returns:
        The marker key (never `null`).

    - #### getType

          public MarkerDataType getType()

      Returns the type of marker data (value or range).
      Returns:
        The type (never `null`).

    - #### getValueLine

          public MarkerLine getValueLine()

      A convenience method that returns the value line data for a value marker.
      Returns:
        The value line (or `null`).

    - #### getStartLine

          public MarkerLine getStartLine()

      A convenience method that returns the start line data for a range marker.
      Returns:
        The start line (or `null`).

    - #### getEndLine

          public MarkerLine getEndLine()

      A convenience method that returns the end line data for a range marker.
      Returns:
        The end line (or `null`).

    - #### getLabelAnchor

          public Anchor2D getLabelAnchor()

      Returns the label anchor.
      Returns:
        The label anchor.

    - #### setLabelAnchor

          public void setLabelAnchor(Anchor2D anchor)

      Sets the label anchor.
      Parameters:
        `anchor` - the label anchor.

    - #### getLabelVertexIndex

          public int getLabelVertexIndex()

      Returns the label vertex index.
      Returns:
        The label vertex index.

    - #### setLabelVertexIndex

          public void setLabelVertexIndex(int labelVertexIndex)

      Sets the label vertex index.
      Parameters:
        `labelVertexIndex` - the label vertex index.

    - #### getLabelPoint

          public java.awt.geom.Point2D getLabelPoint()

      Returns the label projection point.
      Returns:
        The label projection point (possibly `null`).

    - #### updateProjection

          public void updateProjection(java.awt.geom.Point2D[] pts)

      Updates the projected points for this marker. This needs to be done before the markers can be drawn.
      Parameters:
        `pts` - the projected points for the world.

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`