org.vishia.gral.swt

## Class SwtPanel

- java.lang.Object
- - org.vishia.gral.base.GralWidget.ImplAccess
  - - org.vishia.gral.base.GralPanelContent.ImplAccess
    - - org.vishia.gral.swt.SwtPanel

- All Implemented Interfaces:
    GralWidgImpl_ifc
  Direct Known Subclasses:
    SwtCanvasStorePanel

      public class SwtPanel
      extends GralPanelContent.ImplAccess

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `org.eclipse.swt.widgets.TabItem` | `itsTabSwt` The associated tab in a TabFolder if this panel is the main panel of the TabItem, or null if it isn't a main panel of a tab in a tabbed panel.
    `org.eclipse.swt.widgets.Composite` | `panelComposite` It is either a Composite or a SwtCanvas
    `protected org.eclipse.swt.events.ControlListener` | `resizeItemListener`
    `static int` | `version` Version history: 2011-11-19 Hartmut chg: `itsTabSwt` with correct type moved from `GralPanelContent`.

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

      `chgBitsDerived, chgColorBack, chgColorLine, chgColorText, chgEditable, chgFloat, chgFocus, chgFont, chgIntg, chgInvisible, chgObjects, chgPos, chgText, chgVisible, chgVisibleInfo, pixBounds, wdgimpl, widgg`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `private` | `SwtPanel(GralPanelContent panelg)`
    `` | `SwtPanel(GralPanelContent panelg, org.eclipse.swt.widgets.Composite panelSwt)` Constructs a panel

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `GralRectangle` | `getPixelPositionSize()` Returns the absolute position of this panel on screen and its size.
    `GralRectangle` | `getPixelSize()` Returns the size of this panel in pixel.
    `java.lang.Object` | `getWidgetImplementation()` Returns the implementation class of the widget.
    `boolean` | `remove()`
    `void` | `removeWidgetImplementation()` Removes the graphical widget in the graphic.
    `void` | `repaintGthread()` This method should be implemented in all Widget implementations of the adapter for the underlying graphic system.
    `void` | `setBoundsPixel(int x, int y, int dx, int dy)`
    `boolean` | `setFocusGThread()` Sets the focus to the widget.
    `void` | `setVisibleGThread(boolean bVisible)` Sets the implementation widget(s) visible state.

    - ### Methods inherited from class org.vishia.gral.base.GralPanelContent.ImplAccess

      `gralPanel`

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

      `acknChanged, actionShow, dyda, getActionChange, getChanged, gralWidgetFromImplData, setDragEnable, setDropEnable, setFocused, setTextChanged, setVisibleState, XXXfocusGained`

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

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

- - ### Field Detail

    - #### version

          public static final int version

      Version history:
      - 2011-11-19 Hartmut chg: `itsTabSwt` with correct type moved from `GralPanelContent`.
      - 2011-09-25 Hartmut creation: Common class for all Swt implementations of Panels. This class can implement the abstract methods from `GralPanelContent` for the implementation in a common form.
      See Also:
        Constant Field Values

    - #### panelComposite

          public org.eclipse.swt.widgets.Composite panelComposite

      It is either a Composite or a SwtCanvas

    - #### itsTabSwt

          public org.eclipse.swt.widgets.TabItem itsTabSwt

      The associated tab in a TabFolder if this panel is the main panel of the TabItem, or null if it isn't a main panel of a tab in a tabbed panel.
      Note: can't be final because it may be unknown on calling constructor. The property whether a panel is a tab-panel can't be presented with an extra subclass, because this class is the subclass of several Swt panel types. Use the aggregation principle instead multi-inheritance.

    - #### resizeItemListener

          protected org.eclipse.swt.events.ControlListener resizeItemListener

  - ### Constructor Detail

    - #### SwtPanel

          private SwtPanel(GralPanelContent panelg)

    - #### SwtPanel

          public SwtPanel(GralPanelContent panelg,
                          org.eclipse.swt.widgets.Composite panelSwt)

      Constructs a panel
      Parameters:
        `name` - of panel.
        `mng` - The widget manager
        `panelSwt` - may be null, then the `GralPanelContent#panelComposite` should be set after construction of a derived class.

  - ### Method Detail

    - #### getPixelPositionSize

          public GralRectangle getPixelPositionSize()

      Description copied from class: `GralPanelContent.ImplAccess`
      Returns the absolute position of this panel on screen and its size. If it is a main window, the useable area of the window without title and menu bar is returned.
      Specified by:
        `getPixelPositionSize` in interface `GralWidgImpl_ifc`
      Specified by:
        `getPixelPositionSize` in class `GralPanelContent.ImplAccess`

    - #### getPixelSize

          public GralRectangle getPixelSize()

      Description copied from class: `GralPanelContent.ImplAccess`
      Returns the size of this panel in pixel.
      Specified by:
        `getPixelSize` in class `GralPanelContent.ImplAccess`
      Returns:
        the x and y is 0, the dy and dy is the size.

    - #### setBoundsPixel

          public void setBoundsPixel(int x,
                                     int y,
                                     int dx,
                                     int dy)

    - #### repaintGthread

          public void repaintGthread()

      Description copied from interface: `GralWidgImpl_ifc`
      This method should be implemented in all Widget implementations of the adapter for the underlying graphic system.
      Implementation hints: In SWT it should call redraw().
      It is possible that the widget consists of more as one graphical widget, then all of it should be redrawn. It is possible that some data are set in another thread, they should be applied to the widgets firstly. It is possible that the widget is removed though a repaintGthread-order is pending from the time before deleting, for example if the graphic layout is changed.
      See `#repaintRequ`

    - #### removeWidgetImplementation

          public void removeWidgetImplementation()

      Description copied from interface: `GralWidgImpl_ifc`
      Removes the graphical widget in the graphic.

    - #### remove

          public boolean remove()

    - #### setFocusGThread

          public boolean setFocusGThread()

      Description copied from interface: `GralWidgImpl_ifc`
      Sets the focus to the widget. See `GralMng_ifc#setFocus(GralWidget)`.
      Returns:
        true if it has the focus after this operation. false on any error.

    - #### setVisibleGThread

          public void setVisibleGThread(boolean bVisible)

      Description copied from interface: `GralWidgImpl_ifc`
      Sets the implementation widget(s) visible state. The widgets are really invisible, or they are visible in principle, but they can be covered by other windows or clipping. This method should set the `GralWidget.bVisibleState` too. Therewith it is able to quest `GralWidget.isVisible()` in any thread.
      Parameters:
        `bVisible` - true then the widget should be visible, false it is set to invisible.

    - #### getWidgetImplementation

          public java.lang.Object getWidgetImplementation()

      Description copied from interface: `GralWidgImpl_ifc`
      Returns the implementation class of the widget. If the widget has more as one implementation widgets, this method returns one of the widgets, usual the first important one respectively that widget which represents the implementation layer. A widget of the implementation layer is a SWT.control or a `Component`.
      If more as one widget are part of the GralWidget, use the special `GralWidget._wdgImpl` class which should contain the references to that implementation widgets.