org.vishia.gral.base

## Class GralPanelContent

- java.lang.Object
- - org.vishia.gral.base.GralWidget
  - - org.vishia.gral.base.GralPanelContent

- All Implemented Interfaces:
    GetGralWidget_ifc, GralSetValue_ifc, GralWidget_ifc, Removeable
  Direct Known Subclasses:
    AwtPanel, GralTabbedPanel, GralWindow

      public class GralPanelContent
      extends GralWidget
      implements GralWidget_ifc

  This class describes a panel with its content for managing.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GralPanelContent.ImplAccess`
    `static class` | `GralPanelContent.MethodsCalledbackFromImplementation` This inner class contains methods which can call by the implementation layer.

    - ### Nested classes/interfaces inherited from class org.vishia.gral.base.GralWidget

      `GralWidget.ActionChangeSelect, GralWidget.ConfigData, GralWidget.DynamicData`

    - ### 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
    --- | ---
    `protected boolean` | `bGridZoomed` True then the grid of the panel is zoomed with the actual size of panel.
    `protected boolean` | `bZoomed` True then the content of the panel is zoomed with the actual size of panel.
    `GralCanvasStorage` | `canvas` If this instance is not null, the content of that should be paint in the paint routine of the implementation graphic.
    `private java.util.Map<java.lang.String,GralWidget>` | `idxWidgets`
    `protected GralWidget` | `primaryWidget` The widget which should be focused if the panel is focused.
    `static int` | `version` Version history: 2018-08-17 Hartmut new: `getWidget(String)`, `getTextFrom(String)` 2016-07-16 Hartmut chg: On `GralWidget.setToPanel(GralMngBuild_ifc)` all widgets of this panel are initialized too.
    `protected java.util.List<GralWidget>` | `widgetList` List of all widgets which are contained in this panel.
    `java.util.List<GralWidget>` | `widgetsToResize`

    - ### Fields inherited from class org.vishia.gral.base.GralWidget

      `_wdgImpl, bEditable, bHasFocus, bShouldInitialize, buildMng, bVisibleState, cfg, contextMenu, dateUser, dyda, htmlHelp, itsMng, lastTimeSetVisible, name, repaintDelay, repaintDelayMax, sCmd, sFormat, sToolTip, sVersion, whatIs`

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

      `sVersion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GralPanelContent(java.lang.String namePanel, GralMng mng, java.lang.Object panelComposite)` Deprecated.
    `GralPanelContent(java.lang.String posString, java.lang.String namePanel)` Create a panel, registers it and sets the `GralMng.pos()` of this thread to the panel.
    `GralPanelContent(java.lang.String posString, java.lang.String namePanel, char whatIsit)` Create a panel, registers it and sets the `GralMng.pos()` of this thread to the panel.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `addWidget(GralWidget widg, boolean toResize)` Adds a widget to its panel.
    `void` | `createImplWidget_Gthread()` Overridden implementation of `GralWidget.createImplWidget_Gthread()` for instantiation of all widgets of this panel.
    `java.lang.String` | `getTextFrom(java.lang.String nameWidget)` Gets the text from the named widget
    `GralWidget` | `getWidget(java.lang.String name)` Gets a named widget on this panel.
    `java.lang.Object` | `getWidgetImplementation()` Deprecated.
    `java.util.List<GralWidget>` | `getWidgetList()`
    `boolean` | `remove()` This overridden form of `Removeable.remove()` removes all widgets of this panel.
    `void` | `removeWidget(GralWidget widg)` Removes this widget from the lists in this panel.
    `void` | `setPrimaryWidget(GralWidget widg)`
    `void` | `setTextIn(java.lang.String nameWidget, java.lang.CharSequence text)` Sets the text to the named widget
    `void` | `setVisibleState(boolean visible)` Sets the visible state to all widgets of the panel, but not to windows (that is only in the primaryWindow)
    `java.lang.String` | `toString()` Returns the container instance of the panel of the implementing graphic.
    `java.util.List<GralWidget>` | `widgetList()` Deprecated. use `getWidgetList()`
    `boolean` | `XXXsetFocusGThread()` Sets the focus to the primary widget if it is set.

    - ### Methods inherited from class org.vishia.gral.base.GralWidget

      `chgPos, clearShowParam, getActionChange, getActionChangeStrict, getActionDrag, getActionDrop, getActionFocused, getActionShow, getBackColor, getCfgElement, getCmd, getCmd, getContentIdent, getContentInfo, getContextMenu, getData, getDataIx, getDataPath, getDataPath, getFloatValue, getFormat, getGralWidget, getHtmlHelp, getImpl, getItsPanel, getLongValue, getName, getShowMethod, getShowParam, getsToolTip, getText, getValue, getVariable, getVariableFromContentInfo, gralMng, isChanged, isEditable, isGraphicDisposed, isInFocus, isNotEditableOrShouldInitialize, isVisible, pos, refreshFromVariable, refreshFromVariable, registerWidget, repaint, repaint, requestNewValueForVariable, setActionChange, setActionFocused, setActionMouse, setActionShow, setBackColor, setBackgroundColor, setBoundsPixel, setCfgElement, setCmd, setContentIdent, setContentInfo, setData, setDataIx, setDataPath, setDragEnable, setDropEnable, setEditable, setFocus, setFocus, setForegroundColor, setFormat, setHtmlHelp, setLineColor, setLongValue, setMinMax, setPanelMng, setPrimaryWidgetOfPanel, setText, setTextColor, setToolTip, setToPanel, setValue, setValue, setValue, setValue, setVisible, setVisibleStateWidget, specifyActionChange, specifyContextMenu, stop, XXXgetPixelPositionSize, XXXgetWidgetImplementation, XXXremoveWidgetImplementation, XXXrepaintGthread, XXXsetVisibleGThread`

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

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

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

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

- - ### Field Detail

    - #### version

          public static final int version

      Version history:
      - 2018-08-17 Hartmut new: `getWidget(String)`, `getTextFrom(String)`
      - 2016-07-16 Hartmut chg: On `GralWidget.setToPanel(GralMngBuild_ifc)` all widgets of this panel are initialized too. More simple for user application.
      - 2015-05-02 Hartmut new: `setTextIn(String, CharSequence)`, change of registering a widget. Now any panel knows its widgets by name.
      - 2012-07-13 Hartmut new: `#getPixelSize()`, chg: `#getPixelPositionSize()` in all implementations. A swt.widget.Shell now returns the absolute position and the real size of its client area without menu and title bar.
      - 2012-04-22 Hartmut new: `canvas` as property maybe null for each panel to support stored graphics.
      - 2012-03-31 Hartmut new: `#implMethodPanel_` and `GralPanelContent.MethodsCalledbackFromImplementation.setVisibleState(boolean)`.
      - 2012-01-14 Hartmut new: `setPrimaryWidget(GralWidget)` for panel focus.
      - 2012-01-08 Hartmut new: `remove()`
      - 2011-11-19 Hartmut chg: The 'itsTabSwt' is moved to `SwtPanel` now.
      - 2011-11-12 Hartmut new: `#getPixelPositionSize()`.
      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 ist 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 don'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 are intent to use this sources without publishing its usage, you can get a second license subscribing a special contract with the author.
      See Also:
        Constant Field Values

    - #### primaryWidget

          protected GralWidget primaryWidget

      The widget which should be focused if the panel is focused. It is possible to set any actual widget to store the focus situation, It is possible too to have only one widget to focus. if the panel gets the focus.

    - #### widgetList

          protected java.util.List<GralWidget> widgetList

      List of all widgets which are contained in this panel. This list is used in the communication thread to update the content of all widgets in the panel.

    - #### widgetsToResize

          public java.util.List<GralWidget> widgetsToResize

    - #### idxWidgets

          private final java.util.Map<java.lang.String,GralWidget> idxWidgets

    - #### bZoomed

          protected boolean bZoomed

      True then the content of the panel is zoomed with the actual size of panel. It means that all widgets are zoomed in position and size, but there content isn't changed.

    - #### bGridZoomed

          protected boolean bGridZoomed

      True then the grid of the panel is zoomed with the actual size of panel. It means that all fonts are changed too.

    - #### canvas

          public GralCanvasStorage canvas

      If this instance is not null, the content of that should be paint in the paint routine of the implementation graphic.

  - ### Constructor Detail

    - #### GralPanelContent

          @Deprecated
          public GralPanelContent(java.lang.String namePanel,
                                               GralMng mng,
                                               java.lang.Object panelComposite)

      Deprecated.

    - #### GralPanelContent

          public GralPanelContent(java.lang.String posString,
                                  java.lang.String namePanel)

      Create a panel, registers it and sets the `GralMng.pos()` of this thread to the panel.

    - #### GralPanelContent

          public GralPanelContent(java.lang.String posString,
                                  java.lang.String namePanel,
                                  char whatIsit)

      Create a panel, registers it and sets the `GralMng.pos()` of this thread to the panel.

  - ### Method Detail

    - #### setPrimaryWidget

          public void setPrimaryWidget(GralWidget widg)

    - #### addWidget

          void addWidget(GralWidget widg,
                         boolean toResize)

      Adds a widget to its panel. This method will be called in `GralWidget#initPosAndRegisterWidget(GralPos)` either on creation the GralWidget with a given position String or on `GralWidget.setToPanel(GralMngBuild_ifc)` with the given currently `GralMng.pos()`.
      Parameters:
        `widg` -
        `toResize` -

    - #### createImplWidget_Gthread

          public void createImplWidget_Gthread()
                                        throws java.lang.IllegalStateException

      Overridden implementation of `GralWidget.createImplWidget_Gthread()` for instantiation of all widgets of this panel.
      Specified by:
        `createImplWidget_Gthread` in interface `GralWidget_ifc`
      Overrides:
        `createImplWidget_Gthread` in class `GralWidget`
      Throws:
        `java.lang.IllegalStateException` - This routine can be called only if the graphic implementation widget is not existing. It is one time after startup or more as one time if `#removeWidgetImplementation()` was called.

    - #### removeWidget

          public void removeWidget(GralWidget widg)

      Removes this widget from the lists in this panel. This method is not intent to invoke by an application. It is only used in `GralWidget.remove()`. Use the last one method to remove a widget includint is disposition and remove from the panel.
      Parameters:
        `widg` - The widget.

    - #### remove

          public boolean remove()

      This overridden form of `Removeable.remove()` removes all widgets of this panel. It includes the disposition of the widgets in the graphic. It is done by invocation `GralWidget.remove()`.
      Specified by:
        `remove` in interface `Removeable`
      Overrides:
        `remove` in class `GralWidget`
      Returns:
        true because it is done.

    - #### widgetList

          @Deprecated
          public java.util.List<GralWidget> widgetList()

      Deprecated. use `getWidgetList()`

    - #### getWidgetList

          public java.util.List<GralWidget> getWidgetList()

    - #### getWidget

          public GralWidget getWidget(java.lang.String name)

      Gets a named widget on this panel. Returns null if faulty name.
      Since:
        2018-09

    - #### setTextIn

          public void setTextIn(java.lang.String nameWidget,
                                java.lang.CharSequence text)

      Sets the text to the named widget
      Parameters:
        `nameWidget` - the registered widget in its panel.
        `text` - The text to set.
      Throws:
        `java.lang.IllegalArgumentException` - on faulty widget name
      Since:
        2015-05-02

    - #### getTextFrom

          public java.lang.String getTextFrom(java.lang.String nameWidget)

      Gets the text from the named widget
      Parameters:
        `nameWidget` - the registered widget in its panel.
        `text` - The text to set.
      Throws:
        `java.lang.IllegalArgumentException` - on faulty widget name
      Since:
        2015-05-02

    - #### XXXsetFocusGThread

          public boolean XXXsetFocusGThread()

      Sets the focus to the primary widget if it is set. Elsewhere do nothing and returns false. The focus may be set then by the inherit implementation class.
      See `setPrimaryWidget(GralWidget)`.
      Overrides:
        `XXXsetFocusGThread` in class `GralWidget`
      Returns:
        true if the focus is set to the primary widget.

    - #### getWidgetImplementation

          @Deprecated
          public java.lang.Object getWidgetImplementation()

      Deprecated.
      Use GralWidet._wdgImpl.getWidgetImplementation() internally! Not public.
      Returns:

    - #### toString

          public java.lang.String toString()

      Returns the container instance of the panel of the implementing graphic.
      Overrides:
        `toString` in class `GralWidget`
      Returns:
        The container.
      See Also:
        `Object.toString()`

    - #### setVisibleState

          public void setVisibleState(boolean visible)

      Sets the visible state to all widgets of the panel, but not to windows (that is only in the primaryWindow)
      Overrides:
        `setVisibleState` in class `GralWidget`
      See Also:
        `GralWidget.setVisibleState(boolean)`