org.vishia.gral.base

## Class GralCurveView.Track

- java.lang.Object
- - org.vishia.gral.base.GralCurveView.Track

- All Implemented Interfaces:
    GralCurveViewTrack_ifc, GralSetValue_ifc
  Enclosing class:
    GralCurveView

      public static class GralCurveView.Track
      extends java.lang.Object
      implements GralCurveViewTrack_ifc, GralSetValue_ifc

  The describing and the actual data of one track (one curve)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private int` | `dataIx` Index of a variable
    `(package private) int` | `identLastSelect`
    `int` | `ixList` The index of the track in the List of tracks.
    `GralColor` | `lineColor` The color of the line.
    `int` | `lineWidth` The brightness of the line.
    `float` | `max`
    `float` | `min`
    `java.lang.String` | `name`
    `private java.lang.Object` | `oContent`
    `private GralCurveView` | `outer`
    `GralCurveView.TrackScale` | `scale` Reference to the scaling to show the track.
    `java.lang.String` | `sDataPath`
    `int` | `showSelected` The state to show. 0=hidden, don't show, but the values are stored. 1= show normal. 2= show lifted out (selected).
    `float[]` | `values` Array stores the last values which are able to show.
    `VariableAccess_ifc` | `variable`
    `protected int[]` | `XXXlastValueY` last values for paint.
    `int` | `ypixLast` The value from last draw, do not calculate twice.
    `float` | `YYYactValue`

    - ### Fields inherited from interface org.vishia.gral.ifc.GralCurveViewTrack_ifc

      `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Track(GralCurveView outer, java.lang.String name, int ixList)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `getContentInfo()` Gets the application specific info.
    `int` | `getDataIx()`
    `java.lang.String` | `getDataPath()` Changes the data path
    `GralColor` | `getLineColor()` Returns the set color for this line.
    `int` | `getLinePercent()` Returns the position of the 0-line as value from 0 to 100 for this track.
    `float` | `getOffset()` Returns the value which is shown at the 0-line.
    `float` | `getScale7div()` Returns the scaling per division.
    `private float` | `getValueCursor(int cursor)`
    `float` | `getValueCursorLeft()`
    `float` | `getValueCursorRight()`
    `float` | `getValueLast()`
    `float` | `getValueMax()`
    `float` | `getValueMin()`
    `int` | `getVisible()` Returns the state to show. 0=hidden, don't show, but the values are stored. 1= show normal. 2= show lifted out (selected).
    `void` | `groupTrackScale(GralCurveViewTrack_ifc from)` Sets the scaling to sharing with another track.
    `boolean` | `isGroupedTrackScale(GralCurveViewTrack_ifc with)` Checks whether the scaling is shared with the other given thread
    `void` | `setContentInfo(java.lang.Object content)` Sets a application specific info.
    `void` | `setDataIx(int dataIx)`
    `void` | `setDataPath(java.lang.String sDataPath)` Sets the data path.
    `void` | `setLineProperties(GralColor color, int width, int pattern)` Sets the properties for this track.
    `void` | `setLongValue(long value)` Sets a value to show.
    `void` | `setMinMax(float minValue, float maxValue)` Maybe used for scaling, yet unused here.
    `void` | `setText(java.lang.CharSequence text)` See `GralWidget.setText(CharSequence)`.
    `void` | `setTrackScale(float scale7div, float offset, int line0)` Change the scaling of a track.
    `void` | `setValue(float value)` Sets a value to show.
    `void` | `setValue(java.lang.Object[] value)` Sets some values to show any content.
    `void` | `setVisible(int mode)` Set the state to show. 0=hidden, don't show, but the values are stored. 1= show normal. 2= show lifted out (selected).
    `java.lang.String` | `toString()`
    `void` | `ungroupTrackScale()` Sets the scaling to a own instance of `GralCurveView.TrackScale`.

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

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

- - ### Field Detail

    - #### name

          public final java.lang.String name

    - #### ixList

          public final int ixList

      The index of the track in the List of tracks. It is the correspondent index in the float parameter for `GralCurveView.setSample(float[], int)`

    - #### outer

          private final GralCurveView outer

    - #### sDataPath

          public java.lang.String sDataPath

    - #### variable

          public VariableAccess_ifc variable

    - #### oContent

          private java.lang.Object oContent

    - #### dataIx

          private int dataIx

      Index of a variable

    - #### YYYactValue

          public float YYYactValue

    - #### min

          public float min

    - #### max

          public float max

    - #### scale

          public GralCurveView.TrackScale scale

      Reference to the scaling to show the track. More as one track can build a scale group which refers the same instance.

    - #### lineColor

          public GralColor lineColor

      The color of the line.

    - #### lineWidth

          public int lineWidth

      The brightness of the line. It is used to show the selected line.

    - #### showSelected

          public int showSelected

      The state to show. 0=hidden, don't show, but the values are stored. 1= show normal. 2= show lifted out (selected).

    - #### values

          public float[] values

      Array stores the last values which are able to show.

    - #### XXXlastValueY

          protected final int[] XXXlastValueY

      last values for paint. The current paint goes from lastValueY[1] to the current point. The lastValueY[0] is used to repaint the last curve peace while shifting draw content.

    - #### identLastSelect

          int identLastSelect

    - #### ypixLast

          public int ypixLast

      The value from last draw, do not calculate twice.

  - ### Constructor Detail

    - #### Track

          public Track(GralCurveView outer,
                       java.lang.String name,
                       int ixList)

  - ### Method Detail

    - #### setContentInfo

          public void setContentInfo(java.lang.Object content)

      Description copied from interface: `GralSetValue_ifc`
      Sets a application specific info. It should help to present user data which are associated to this widget. This info can be set and changed anytime.
      Specified by:
        `setContentInfo` in interface `GralSetValue_ifc`

    - #### getContentInfo

          public java.lang.Object getContentInfo()

      Description copied from interface: `GralSetValue_ifc`
      Gets the application specific info. See `GralSetValue_ifc.setContentInfo(Object)`.
      Specified by:
        `getContentInfo` in interface `GralSetValue_ifc`

    - #### setDataPath

          public void setDataPath(java.lang.String sDataPath)

      Description copied from interface: `GralSetValue_ifc`
      Sets the data path. It is a String in application context.
      Specified by:
        `setDataPath` in interface `GralCurveViewTrack_ifc`
      Specified by:
        `setDataPath` in interface `GralSetValue_ifc`

    - #### getDataPath

          public java.lang.String getDataPath()

      Description copied from interface: `GralSetValue_ifc`
      Changes the data path
      Specified by:
        `getDataPath` in interface `GralCurveViewTrack_ifc`
      Specified by:
        `getDataPath` in interface `GralSetValue_ifc`
      Returns:
        the last one.

    - #### getDataIx

          public int getDataIx()

      Specified by:
        `getDataIx` in interface `GralSetValue_ifc`

    - #### setDataIx

          public void setDataIx(int dataIx)

      Specified by:
        `setDataIx` in interface `GralSetValue_ifc`

    - #### setValue

          public void setValue(float value)

      Description copied from interface: `GralSetValue_ifc`
      Sets a value to show.
      Specified by:
        `setValue` in interface `GralSetValue_ifc`

    - #### setLongValue

          public void setLongValue(long value)

      Description copied from interface: `GralSetValue_ifc`
      Sets a value to show.
      Specified by:
        `setLongValue` in interface `GralSetValue_ifc`

    - #### setValue

          public void setValue(java.lang.Object[] value)

      Description copied from interface: `GralSetValue_ifc`
      Sets some values to show any content. Depending from the type of widget more as one value can be used for several functionality.
      Specified by:
        `setValue` in interface `GralSetValue_ifc`
      Parameters:
        `value` - array of floats

    - #### setMinMax

          public void setMinMax(float minValue,
                                float maxValue)

      Maybe used for scaling, yet unused here.
      Specified by:
        `setMinMax` in interface `GralSetValue_ifc`
      See Also:
        `GralSetValue_ifc.setMinMax(float, float)`

    - #### getLinePercent

          public int getLinePercent()

      Description copied from interface: `GralCurveViewTrack_ifc`
      Returns the position of the 0-line as value from 0 to 100 for this track.
      Specified by:
        `getLinePercent` in interface `GralCurveViewTrack_ifc`

    - #### getOffset

          public float getOffset()

      Description copied from interface: `GralCurveViewTrack_ifc`
      Returns the value which is shown at the 0-line.
      Specified by:
        `getOffset` in interface `GralCurveViewTrack_ifc`

    - #### getScale7div

          public float getScale7div()

      Description copied from interface: `GralCurveViewTrack_ifc`
      Returns the scaling per division. One division is 1/10 of full y presentation, like usual on oscilloscopes.
      Specified by:
        `getScale7div` in interface `GralCurveViewTrack_ifc`

    - #### getLineColor

          public GralColor getLineColor()

      Description copied from interface: `GralCurveViewTrack_ifc`
      Returns the set color for this line.
      Specified by:
        `getLineColor` in interface `GralCurveViewTrack_ifc`

    - #### setTrackScale

          public void setTrackScale(float scale7div,
                                    float offset,
                                    int line0)

      Change the scaling of a track.
      Specified by:
        `setTrackScale` in interface `GralCurveViewTrack_ifc`
      Parameters:
        `trackNr` - Number of the track in order of creation, 0 ist the first.
        `scale7div` - value per division
        `offset` - value, which is shown at line0
        `line0` - percent of 0-line in graphic.

    - #### groupTrackScale

          public void groupTrackScale(GralCurveViewTrack_ifc from)

      Sets the scaling to sharing with another track. Changing one of this tracks with `setTrackScale(float, float, int)` influences all shared tracks immediately. All shared tracks refer the same instance of `GralCurveView.TrackScale`.
      Specified by:
        `groupTrackScale` in interface `GralCurveViewTrack_ifc`
      Parameters:
        `from` -

    - #### isGroupedTrackScale

          public boolean isGroupedTrackScale(GralCurveViewTrack_ifc with)

      Description copied from interface: `GralCurveViewTrack_ifc`
      Checks whether the scaling is shared with the other given thread
      Specified by:
        `isGroupedTrackScale` in interface `GralCurveViewTrack_ifc`
      Parameters:
        `with` - The other track.
      Returns:
        true if it refers the same instance of scaling values.

    - #### ungroupTrackScale

          public void ungroupTrackScale()

      Sets the scaling to a own instance of `GralCurveView.TrackScale`. The track is independent now.
      Specified by:
        `ungroupTrackScale` in interface `GralCurveViewTrack_ifc`

    - #### getValueCursorLeft

          public float getValueCursorLeft()

      Specified by:
        `getValueCursorLeft` in interface `GralCurveViewTrack_ifc`

    - #### getValueCursorRight

          public float getValueCursorRight()

      Specified by:
        `getValueCursorRight` in interface `GralCurveViewTrack_ifc`

    - #### getValueCursor

          private float getValueCursor(int cursor)

    - #### getValueLast

          public float getValueLast()

      Specified by:
        `getValueLast` in interface `GralCurveViewTrack_ifc`

    - #### getValueMin

          public float getValueMin()

      Specified by:
        `getValueMin` in interface `GralCurveViewTrack_ifc`

    - #### getValueMax

          public float getValueMax()

      Specified by:
        `getValueMax` in interface `GralCurveViewTrack_ifc`

    - #### setLineProperties

          public void setLineProperties(GralColor color,
                                        int width,
                                        int pattern)

      Description copied from interface: `GralCurveViewTrack_ifc`
      Sets the properties for this track.
      Specified by:
        `setLineProperties` in interface `GralCurveViewTrack_ifc`
      Parameters:
        `color` - The color of line, null: no change
        `width` - The thickness of the line. 0: no change
        `pattern` - a Pattern of the line. Yet the pattern is not used (TODO). Value 0 doesn't change the current one.
      See Also:
        `GralCurveViewTrack_ifc.setLineProperties(org.vishia.gral.ifc.GralColor, int, int)`

    - #### setVisible

          public void setVisible(int mode)

      Description copied from interface: `GralCurveViewTrack_ifc`
      Set the state to show. 0=hidden, don't show, but the values are stored. 1= show normal. 2= show lifted out (selected).
      Specified by:
        `setVisible` in interface `GralCurveViewTrack_ifc`

    - #### getVisible

          public int getVisible()

      Description copied from interface: `GralCurveViewTrack_ifc`
      Returns the state to show. 0=hidden, don't show, but the values are stored. 1= show normal. 2= show lifted out (selected).
      Specified by:
        `getVisible` in interface `GralCurveViewTrack_ifc`

    - #### setText

          public void setText(java.lang.CharSequence text)

      Description copied from interface: `GralSetValue_ifc`
      See `GralWidget.setText(CharSequence)`.
      Specified by:
        `setText` in interface `GralSetValue_ifc`

    - #### toString

          public java.lang.String toString()

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