org.vishia.gral.swt

## Class SwtWidgetSimpleWrapper

- java.lang.Object
- - org.vishia.gral.swt.SwtWidgetSimpleWrapper

- All Implemented Interfaces:
    GralWidgImpl_ifc

      public class SwtWidgetSimpleWrapper
      extends java.lang.Object
      implements GralWidgImpl_ifc

  This class wraps a SWT widget. In this form it is able to reference in the SWT-independent GRAL

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SwtMng` | `mng`
    `protected org.eclipse.swt.widgets.Control` | `widgetSwt`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SwtWidgetSimpleWrapper(org.eclipse.swt.widgets.Control widgetSwt, SwtMng mng)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `GralRectangle` | `getPixelPositionSize()`
    `java.lang.Object` | `getWidgetImplementation()` Returns the implementation class of the widget.
    `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.
    `void` | `swtUpdateRedraw()`

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

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

- - ### Field Detail

    - #### widgetSwt

          protected org.eclipse.swt.widgets.Control widgetSwt

    - #### mng

          protected final SwtMng mng

  - ### Constructor Detail

    - #### SwtWidgetSimpleWrapper

          public SwtWidgetSimpleWrapper(org.eclipse.swt.widgets.Control widgetSwt,
                                        SwtMng mng)

  - ### Method Detail

    - #### 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`
      Specified by:
        `repaintGthread` in interface `GralWidgImpl_ifc`

    - #### swtUpdateRedraw

          public void swtUpdateRedraw()

    - #### 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.
      Specified by:
        `getWidgetImplementation` in interface `GralWidgImpl_ifc`

    - #### setFocusGThread

          public boolean setFocusGThread()

      Description copied from interface: `GralWidgImpl_ifc`
      Sets the focus to the widget. See `GralMng_ifc#setFocus(GralWidget)`.
      Specified by:
        `setFocusGThread` in interface `GralWidgImpl_ifc`
      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.
      Specified by:
        `setVisibleGThread` in interface `GralWidgImpl_ifc`
      Parameters:
        `bVisible` - true then the widget should be visible, false it is set to invisible.

    - #### removeWidgetImplementation

          public void removeWidgetImplementation()

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

    - #### setBoundsPixel

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

      Specified by:
        `setBoundsPixel` in interface `GralWidgImpl_ifc`

    - #### getPixelPositionSize

          public GralRectangle getPixelPositionSize()

      Specified by:
        `getPixelPositionSize` in interface `GralWidgImpl_ifc`