org.vishia.gral.ifc

## Interface GralMng_ifc

- All Known Implementing Classes:
    GralMng

      public interface GralMng_ifc

  This is a unique interface for the GUI-panel-manager to work with it. To build the graphical application see `GralMngBuild_ifc`. This interface supports handling with all widgets in a GUI. The widgets were selected by identifier or with their `GralWidget` instance whereby the implementation environment of a widget may be known. That implementation environment is a implementor of this interface.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `cmdBackColor`
    `static int` | `cmdClear`
    `static int` | `cmdCloseWindow`
    `static int` | `cmdColor`
    `static int` | `cmdInsert`
    `static int` | `cmdLineColor`
    `static int` | `cmdRedraw`
    `static int` | `cmdRemove`
    `static int` | `cmdSelect`
    `static int` | `cmdSet`
    `static int` | `cmdSetWindowVisible`
    `static int` | `cmdTextColor`
    `static int` | `version` The version history of this interface: 2012-08-20 Hartmut new: `getWidgetsPermanentlyUpdating()` created but not used yet because `refreshCurvesFromVariable(VariableContainer_ifc)` has the necessary functionality.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addText(java.lang.String widget, java.lang.CharSequence text)` Appends the text into a named widget.
    `boolean` | `currThreadIsGraphic()` Returns true if the current thread is the graphical thread.
    `int` | `getColorValue(java.lang.String sName)` Gets the value to the named color.
    `java.util.List<GralWidget>` | `getListCurrWidgets()` Deprecated.
    `java.lang.String` | `getValue(java.lang.String sName)` Gets the value from a widget.
    `java.lang.String` | `getValueFromWidget(GralWidget widgetDescr)` Gets the String value from a widget with given descriptor Text field: The content written into, with all spaces.
    `java.util.concurrent.ConcurrentLinkedQueue<GralVisibleWidgets_ifc>` | `getVisiblePanels()` Gets the list of all panels which are visible yet and should be updated with values therefore.
    `GralWidget` | `getWidget(java.lang.String name)` Searches a widget by name.
    `GralWidget` | `getWidgetInFocus()`
    `java.util.List<GralWidget>` | `getWidgetsInFocus()` Returns a list of the last widgets in focus in there focus order.
    `GralVisibleWidgets_ifc` | `getWidgetsPermanentlyUpdating()` Gets a list of widgets which should be updated permanently because they store data in any time.
    `GralGraphicThread` | `gralDevice()`
    `LogMessage` | `log()`
    `void` | `notifyFocus(GralWidget widgd)` Notifies that this widget has the focus gotten.
    `GralGridProperties` | `propertiesGui()`
    `void` | `redrawWidget(java.lang.String sName)` Forces the redrawing for all set samples.
    `void` | `refreshCurvesFromVariable(VariableContainer_ifc container)` refresh all curve views.
    `void` | `resizeWidget(GralWidget widgd, int xSizeParent, int ySizeParent)` Forces the resizing of the given widged.
    `void` | `setBackColor(GralWidget widgetDescr, int ix, int colorValue)` Deprecated. use {@link GralWidget#setBackColor(GralColor, int)
    `void` | `setBackColor(java.lang.String name, int ix, int colorValue)` Sets the color of background of the widget, if possible.
    `void` | `setFocus(GralWidget widgd)` Sets the focus to the designated widget.
    `void` | `setLed(GralWidget widgetDescr, int colorBorder, int colorInner)` Deprecated. use `GralLed.setColor(GralColor, GralColor)`.
    `void` | `setLineColor(GralWidget widgetDescr, int ix, int colorValue)` Deprecated. use {@link GralWidget#setLineColor(GralColor, int)
    `void` | `setSampleCurveViewY(java.lang.String sName, float[] values)` Adds a sampling value set.
    `void` | `setText(java.lang.String widget, java.lang.CharSequence text)` Sets the text into a named widget.
    `void` | `setTextColor(GralWidget widgetDescr, int ix, int colorValue)` Deprecated. use {@link GralWidget#setTextColor(GralColor)
    `void` | `setValue(java.lang.String widget, java.lang.Object visibleInfo, java.lang.Object userData)` Sets the text into a named widget.
    `void` | `writeLog(int msgId, java.lang.Exception exc)` Writes a log message instead throwing an exception or writing on standard output.
    `boolean` | `XXXsetWindowsVisible(GralWindow_ifc window, GralPos atPos)` Deprecated.

- - ### Field Detail

    - #### version

          static final int version

      The version history of this interface:
      - 2012-08-20 Hartmut new: `getWidgetsPermanentlyUpdating()` created but not used yet because `refreshCurvesFromVariable(VariableContainer_ifc)` has the necessary functionality.
      - 2012-01-07 Hartmut new: `#setInfoDelayed(GralWidgetChangeRequ, int)`
      - 2011-05-08 Hartmut new; `cmdClear` used to clear a whole swt.Table, commonly using: clear a content of widget.
      - 2011-05-01 Hartmut new: `cmdInsert` etc now here.
      - 2011-05-01 Hartmut new: `#setInfo(GralWidget, int, int, Object)` as adequate method to {@link #insertInfo(String, int, String) but without symbolic addressing of the widget. It calls the internal method to insert an information in a queue for the graphical thread. It is thread-safe.
      - All other changes in 2010
      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

    - #### cmdInsert

          static final int cmdInsert

      See Also:
        Constant Field Values

    - #### cmdSet

          static final int cmdSet

      See Also:
        Constant Field Values

    - #### cmdClear

          static final int cmdClear

      See Also:
        Constant Field Values

    - #### cmdBackColor

          static final int cmdBackColor

      See Also:
        Constant Field Values

    - #### cmdLineColor

          static final int cmdLineColor

      See Also:
        Constant Field Values

    - #### cmdTextColor

          static final int cmdTextColor

      See Also:
        Constant Field Values

    - #### cmdColor

          static final int cmdColor

      See Also:
        Constant Field Values

    - #### cmdRedraw

          static final int cmdRedraw

      See Also:
        Constant Field Values

    - #### cmdRemove

          static final int cmdRemove

      See Also:
        Constant Field Values

    - #### cmdSelect

          static final int cmdSelect

      See Also:
        Constant Field Values

    - #### cmdSetWindowVisible

          static final int cmdSetWindowVisible

      See Also:
        Constant Field Values

    - #### cmdCloseWindow

          static final int cmdCloseWindow

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### propertiesGui

          GralGridProperties propertiesGui()

    - #### gralDevice

          GralGraphicThread gralDevice()

    - #### log

          LogMessage log()

    - #### getWidget

          GralWidget getWidget(java.lang.String name)

      Searches a widget by name.
      Parameters:
        `name` - The name which is assigned on build.
      Returns:
        null if the widget is not found.

    - #### getListCurrWidgets

          @Deprecated
          java.util.List<GralWidget> getListCurrWidgets()

      Deprecated.
      Returns the list of all widgets with its informations. The graphical representation of the widgets is unknown here. If it should be used, the graphic implementation should be known and a adequate instanceof-test and cast is necessary.

    - #### setBackColor

          void setBackColor(java.lang.String name,
                            int ix,
                            int colorValue)

      Sets the color of background of the widget, if possible.
      Parameters:
        `name` - The name of the widget, which was given by the add...()-Operation
        `colorValue` - blue, green and red in the bits 23..16, 15..8 and 7..0. opaque in bits 31..24 if possible.

    - #### setText

          void setText(java.lang.String widget,
                       java.lang.CharSequence text)

      Sets the text into a named widget.
      Parameters:
        `widget` -
        `text` - The text is not stored by reference, it can be changed after them.

    - #### setValue

          void setValue(java.lang.String widget,
                        java.lang.Object visibleInfo,
                        java.lang.Object userData)

      Sets the text into a named widget.
      Parameters:
        `widget` -
        `text` - The text is not stored by reference, it can be changed after them.

    - #### addText

          void addText(java.lang.String widget,
                       java.lang.CharSequence text)

      Appends the text into a named widget. The widget can be especially a text area.
      Parameters:
        `widget` -
        `text` - The text is not stored by reference, it can be changed after them.

    - #### setBackColor

          @Deprecated
          void setBackColor(GralWidget widgetDescr,
                                         int ix,
                                         int colorValue)

      Deprecated. use {@link GralWidget#setBackColor(GralColor, int)
      Sets the color of background of the widget, if possible.
      Parameters:
        `name` - The name of the widget, which was given by the add...()-Operation
        `colorValue` - blue, green and red in the bits 23..16, 15..8 and 7..0. opaque in bits 31..24 if possible.

    - #### setLineColor

          @Deprecated
          void setLineColor(GralWidget widgetDescr,
                                         int ix,
                                         int colorValue)

      Deprecated. use {@link GralWidget#setLineColor(GralColor, int)
      Sets the color of line of the widget, if possible.
      Parameters:
        `name` - The name of the widget, which was given by the add...()-Operation
        `colorValue` - blue, green and red in the bits 23..16, 15..8 and 7..0. opaque in bits 31..24 if possible.

    - #### setTextColor

          @Deprecated
          void setTextColor(GralWidget widgetDescr,
                                         int ix,
                                         int colorValue)

      Deprecated. use {@link GralWidget#setTextColor(GralColor)
      Sets the color of text of the widget, if possible.
      Parameters:
        `name` - The name of the widget, which was given by the add...()-Operation
        `colorValue` - blue, green and red in the bits 23..16, 15..8 and 7..0. opaque in bits 31..24 if possible.

    - #### setLed

          @Deprecated
          void setLed(GralWidget widgetDescr,
                                   int colorBorder,
                                   int colorInner)

      Deprecated. use `GralLed.setColor(GralColor, GralColor)`.
      Parameters:
        `widgetDescr` -
        `colorBorder` -
        `colorInner` -

    - #### setSampleCurveViewY

          void setSampleCurveViewY(java.lang.String sName,
                                   float[] values)

      Adds a sampling value set.
      Parameters:
        `sName` - The registered name
        `values` - The values.

    - #### redrawWidget

          void redrawWidget(java.lang.String sName)

      Forces the redrawing for all set samples. It should be called after { @link #setSampleCurveViewY(String, float[])}.
      Parameters:
        `sName` - The name of the widget.

    - #### resizeWidget

          void resizeWidget(GralWidget widgd,
                            int xSizeParent,
                            int ySizeParent)

      Forces the resizing of the given widged.
      Parameters:
        `widgd` - the widget

    - #### XXXsetWindowsVisible

          @Deprecated
          boolean XXXsetWindowsVisible(GralWindow_ifc window,
                                                    GralPos atPos)

      Deprecated.
      Sets a given and registered window visible at the given position and size or set it invisible.
      A window can be created by invoking `org.vishia.gral.ifc.GralMngBuild_ifc#createWindow(String, boolean)` in the build phase of the gui. It can be hidden because it is not necessary to show and operate with them. In a adequate phase of operate it can be shown and focused.
      The position is given relative to that panel, which is stored in `GralPos.panel`. To get a position instance, you can set a position invoking
      - `GralMngBuild_ifc.selectPanel(String)`
      - `GralMngBuild_ifc.setPosition(float, float, float, float, int, char)`
      - GralGridPos pos = `GralMngBuild_ifc.getPositionInPanel()`.
      That can be done in the build phase of the graphic. The position can be stored. It is possible to adjust the position relative to the unchanged panel by changing the values of `GralPos.x` etc. It is possible too to change the Panel which relates to the position. Then the grid managing instance have to be known via the `GralMngBuild_ifc` to select a panel. The panels may be moved or resized. With the knowledge of the relative position of the window in respect to a panel of the parent window, the window can be placed onto a proper position of the whole display.
      Parameters:
        `window` - the instance of the window wrapper.
        `atPos` - If null then hide the window. If not null then show the window. The position and size of the window is given related to any panel of any other window.
      Returns:
        true if it is visible.

    - #### getColorValue

          int getColorValue(java.lang.String sName)

      Gets the value to the named color. It is a method of the graphic.
      Parameters:
        `sName` - supported: red, green, blue, yellow
      Returns:
        3 bytes intensity: bit23..16 blue, bit15..8: green, bit 7..0 red.

    - #### getValue

          java.lang.String getValue(java.lang.String sName)

      Gets the value from a widget.
      Parameters:
        `sName` - The name of the widget. The widget will be searched per name.
      Returns:
        null if the named widget isn't found or the widget is not able to input.

    - #### getValueFromWidget

          java.lang.String getValueFromWidget(GralWidget widgetDescr)

      Gets the String value from a widget with given descriptor
      - Text field: The content written into, with all spaces.
      - Table: content of the selected line, all cells separated with tabulator char.
      Parameters:
        `widgetDescr` - The widget.
      Returns:
        The content.

    - #### setFocus

          void setFocus(GralWidget widgd)

      Sets the focus to the designated widget.
      Parameters:
        `widgd` -

    - #### notifyFocus

          void notifyFocus(GralWidget widgd)

      Notifies that this widget has the focus gotten. Note: not all widgets notifies this. The focus can be used to detect which widget is active while a menu command or any button is pressed.
      Parameters:
        `widgd` - The widget descriptor

    - #### getWidgetInFocus

          GralWidget getWidgetInFocus()

    - #### getWidgetsInFocus

          java.util.List<GralWidget> getWidgetsInFocus()

      Returns a list of the last widgets in focus in there focus order. On access to the list, usual with an iterator, the returned list should be used with mutex. Use 'synchronized(focusList){....}'. But don't block the access for a longer time! The graphical thread will be wait on mutex if any other widget will be focused.
      Returns:
        The list.

    - #### getVisiblePanels

          java.util.concurrent.ConcurrentLinkedQueue<GralVisibleWidgets_ifc> getVisiblePanels()

      Gets the list of all panels which are visible yet and should be updated with values therefore.
      Returns:
        The list of widget list.

    - #### refreshCurvesFromVariable

          void refreshCurvesFromVariable(VariableContainer_ifc container)

      refresh all curve views.

    - #### getWidgetsPermanentlyUpdating

          GralVisibleWidgets_ifc getWidgetsPermanentlyUpdating()

      Gets a list of widgets which should be updated permanently because they store data in any time.
      Returns:
        List of widgets which are permanently to update

    - #### currThreadIsGraphic

          boolean currThreadIsGraphic()

      Returns true if the current thread is the graphical thread. This routine is used internally firstly. The graphical thread is that thread, which dispatches all orders for the graphic, see `GralGraphicThread.run()`.
      Returns:
        true if this routine is called from the same thread as the graphical thread.

    - #### writeLog

          void writeLog(int msgId,
                        java.lang.Exception exc)

      Writes a log message instead throwing an exception or writing on standard output. The log message contains a timestamp and can be dispatched to any destination. All internal methods of gral writes exceptions to that logging system instead abort the execution of the application.
      Parameters:
        `msgId` - The ident number for dispatching and evaluation.
        `exc` - The catched exception.