org.vishia.gral.swt

## Class SwtLed

- java.lang.Object
- - org.vishia.gral.base.GralWidget.ImplAccess
  - - org.vishia.gral.base.GralLed.GraphicImplAccess
    - - org.vishia.gral.swt.SwtLed

- All Implemented Interfaces:
    GralWidgImpl_ifc

      public class SwtLed
      extends GralLed.GraphicImplAccess

  This class represents a LED, which is able to show a state with its color. The LED may have a inner light and a border light. In that case to state, which may have any association, can presented.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `private class` | `SwtLed.SwtLedImpl`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) org.eclipse.swt.graphics.Color` | `borderColor`
    `(package private) org.eclipse.swt.graphics.Color` | `innerColor`
    `(package private) SwtMng` | `mng`
    `(package private) boolean` | `round`
    `private SwtWidgetHelper` | `wdgh` It contains the association to the swt widget (Control) and the `SwtMng` and implements some methods of `GralWidgImpl_ifc` which are delegate from this.
    `private SwtLed.SwtLedImpl` | `widgSwt` Version and history 2011-12-03 chg now it is the implementation class for the new class `GralLed`.

    - ### 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
    Constructor and Description
    `SwtLed(GralLed widgg, SwtMng mng)`
    `SwtLed(java.lang.String name, 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)`
    `private void` | `setColors()` Called in the paint routine, corrects the colors for SWT depending on `GralWidget.DynamicData#backColor` and `GralWidget.DynamicData#lineColor`.
    `boolean` | `setFocusGThread()` Sets the focus to the widget.
    `void` | `setVisibleGThread(boolean bVisible)` Sets the implementation widget(s) visible state.
    `GralColor` | `XXXsetForegroundColor(GralColor color)`

    - ### Methods inherited from class org.vishia.gral.base.GralLed.GraphicImplAccess

      `dyda`

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

      `acknChanged, actionShow, 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

    - #### widgSwt

          private SwtLed.SwtLedImpl widgSwt

      Version and history
      - 2011-12-03 chg now it is the implementation class for the new class `GralLed`. It is the concept of specialized `GralWidget`. The ctor creates the swt Control. The content before is the inner class `SwtLed.SwtLedImpl` up to now.
      - 2010-05-00 created.

    - #### wdgh

          private final SwtWidgetHelper wdgh

      It contains the association to the swt widget (Control) and the `SwtMng` and implements some methods of `GralWidgImpl_ifc` which are delegate from this.

    - #### borderColor

          org.eclipse.swt.graphics.Color borderColor

    - #### innerColor

          org.eclipse.swt.graphics.Color innerColor

    - #### mng

          final SwtMng mng

    - #### round

          boolean round

  - ### Constructor Detail

    - #### SwtLed

          SwtLed(java.lang.String name,
                 SwtMng mng)

    - #### SwtLed

          SwtLed(GralLed widgg,
                 SwtMng mng)

  - ### Method Detail

    - #### setColors

          private void setColors()

      Called in the paint routine, corrects the colors for SWT depending on `GralWidget.DynamicData#backColor` and `GralWidget.DynamicData#lineColor`.
      - lineColor is the border color
      - backColor is the inner color.

    - #### getPixelPositionSize

          public GralRectangle getPixelPositionSize()

    - #### removeWidgetImplementation

          public void removeWidgetImplementation()

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

    - #### 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.

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

    - #### 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.

    - #### setBoundsPixel

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

    - #### XXXsetForegroundColor

          public GralColor XXXsetForegroundColor(GralColor color)