org.vishia.gral.ifc

## Interface GralCurveView_ifc

- All Superinterfaces:
    GetGralWidget_ifc, GralSetValue_ifc, GralWidget_ifc, Removeable
  All Known Implementing Classes:
    GralCurveView

      public interface GralCurveView_ifc
      extends GralWidget_ifc, GralSetValue_ifc, GetGralWidget_ifc

  This interface describes the capabilities of a curve view as application interface.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `GralCurveView_ifc.ModeWrite`

    - ### Nested classes/interfaces inherited from interface org.vishia.gral.ifc.GralWidget_ifc

      `GralWidget_ifc.ActionChange, GralWidget_ifc.ActionChangeWhen`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `syntaxSettings` The ZBNF-syntax of a setting for curve view.
    `static int` | `version` Version, history and license.

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

      `sVersion`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate(boolean activate)` Activates or deactivates.
    `boolean` | `applySettings(java.lang.String in)` Applies the settings from the given String (maybe read from a file) and sets all tracks newly.
    `boolean` | `isActiv()` Returns true if the curve view is active.
    `boolean` | `isFreezed()` Returns true if the curve view is active but freezed in presentation.
    `void` | `setSample(float[] values, int timeshort)` Adds a sampling value set.
    `void` | `setTimePoint(long date, int timeshort, float millisecPerTimeshort)` Sets a point of absolute time.
    `java.lang.CharSequence` | `timeInitAutoSave()` Initializes an auto-save data write process.
    `void` | `writeCurve(WriteCurve_ifc out, GralCurveView_ifc.ModeWrite mode)` Writes the curve to the given interface, it is an exporter class.
    `void` | `writeSettings(java.lang.Appendable out)` Writes the settings of the curve view in an output, maybe a file.

    - ### Methods inherited from interface org.vishia.gral.ifc.GralWidget_ifc

      `createImplWidget_Gthread, getActionChange, getBackColor, getCmd, getContentIdent, getContentInfo, getData, getDataPath, getName, gralMng, isChanged, isEditable, isGraphicDisposed, isInFocus, isNotEditableOrShouldInitialize, isVisible, refreshFromVariable, refreshFromVariable, repaint, repaint, setBackColor, setBackgroundColor, setBoundsPixel, setCmd, setContentIdent, setData, setDataPath, setEditable, setFocus, setFocus, setForegroundColor, setHtmlHelp, setLineColor, setText, setTextColor, setToPanel, setVisible`

    - ### Methods inherited from interface org.vishia.util.Removeable

      `remove`

    - ### Methods inherited from interface org.vishia.gral.ifc.GralSetValue_ifc

      `getContentInfo, getDataIx, getDataPath, setContentInfo, setDataIx, setDataPath, setLongValue, setMinMax, setText, setValue, setValue`

    - ### Methods inherited from interface org.vishia.gral.base.GetGralWidget_ifc

      `getGralWidget`

- - ### Field Detail

    - #### version

          static final int version

      Version, history and license.
      - 2012-06-08 Hartmut new: `applySettings(String)` and `writeSettings(Appendable)` for saving and getting the configuration of curve view from a file or another text.
      - 2012-04-26 Hartmut new extends GralWidget_ifc etc: A reference to a GralCurveView_ifc is a reference to a widget too.
      - 2012-04-26 Hartmut new capability for curve view: Set active or non active. It is a state whether values are stored, independent of their visualization.
      - 2012-03-25 Hartmut created as interface to `GralCurveView`. Approach: The capabilities should be described by an interface. Yet only 1 method.
      Copyright/Copyleft: For this source the LGPL Lesser General Public License, published by the Free Software Foundation is valid. It means:
      1. You can use this source without any restriction for any desired purpose.
      2. You can redistribute copies of this source to everybody.
      3. Every user of this source, also the user of redistribute copies with or without payment, must accept this license for further using.
      4. But the LPGL is not appropriate for a whole software product, if this source is only a part of them. It means, the user must publish this part of source, but doesn't need to publish the whole source of the own product.
      5. You can study and modify (improve) this source for own using or for redistribution, but you have to license the modified sources likewise under this LGPL Lesser General Public License. You mustn't delete this Copyright/Copyleft inscription in this source file.
      If you intent to use this source without publishing its usage, you can get a second license subscribing a special contract with the author.
      See Also:
        Constant Field Values

    - #### syntaxSettings

          static final java.lang.String syntaxSettings

      The ZBNF-syntax of a setting for curve view.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setSample

          void setSample(float[] values,
                         int timeshort)

      Adds a sampling value set.
      This method can be called in any thread. It updates only data, a GUI-call isn't done. But the method is not thread-safe. If more as one threads writes data, an external synchronization should be done which may encapsulate more as only this call.
      The caller should force repaint to show the data in the graphic thread. It is possible and sensitive to force repaint after writing some done one after another if the data are given faster than the users view eye.
      Parameters:
        `values` - The values.
        `timeshort` - relative time-stamp as currently wrapping time in milliseconds.
      See Also:
        `setTimePoint(long, int, float)`

    - #### setTimePoint

          void setTimePoint(long date,
                            int timeshort,
                            float millisecPerTimeshort)

      Sets a point of absolute time. This routine should be called at least 2 times in an wrapping area of timeshort. If timeshort are milliseconds, this is about 2000000 seconds. It means, it isn't often. You should call this routine cyclically in an slower cycle. Then the graphic can showt the
      Parameters:
        `date` - The absolute time appropriate to the timeshort value.
        `timeshort` - The wrapping short time at this moment of data.
        `millisecPerTimeshort` - Number of milliseconds per step of timeshort.

    - #### activate

          void activate(boolean activate)

      Activates or deactivates. Only if the curve view is activated, it writes in time. If it is not active, than the curve can be watched, zoomed etc.
      Parameters:
        `activate` - true to activate, false to deactivate.

    - #### isActiv

          boolean isActiv()

      Returns true if the curve view is active. See `activate(boolean)`.

    - #### isFreezed

          boolean isFreezed()

      Returns true if the curve view is active but freezed in presentation.

    - #### timeInitAutoSave

          java.lang.CharSequence timeInitAutoSave()

      Initializes an auto-save data write process. The time range will be set from the last autosave or from the start of recording to the actual last value of curve yet written. After them some invocations of `writeCurve(WriteCurve_ifc, org.vishia.gral.ifc.GralCurveView_ifc.ModeWrite)` with `GralCurveView_ifc.ModeWrite.autoSave` can be done with this current time range.
      Returns:
        The absolute time of start of curve.

    - #### writeCurve

          void writeCurve(WriteCurve_ifc out,
                          GralCurveView_ifc.ModeWrite mode)

      Writes the curve to the given interface, it is an exporter class.
      Parameters:
        `out` - exporter class reference
        `mode` - autosave: Then the data range from `timeInitAutoSave()` is used. currentView: Then the data range visible in window will be used.

    - #### applySettings

          boolean applySettings(java.lang.String in)

      Applies the settings from the given String (maybe read from a file) and sets all tracks newly.
      Parameters:
        `in` - Input, syntax see `syntaxSettings`
      Returns:
        true on success.

    - #### writeSettings

          void writeSettings(java.lang.Appendable out)

      Writes the settings of the curve view in an output, maybe a file. The syntax is matching to `applySettings(String)`.
      Parameters:
        `out` - any output stream.