org.vishia.gral.base

## Class GralLed

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

- All Implemented Interfaces:
    GetGralWidget_ifc, GralSetValue_ifc, GralWidget_ifc, Removeable

      public class GralLed
      extends GralWidget

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `GralLed.GraphicImplAccess`

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

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

    - ### 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
    --- | ---
    `private GralColor[]` | `colorBorderSelectable` Some given colors which can be selected by value calling `setValue(Object[])` or `setValue(float)`.
    `private GralColor[]` | `colorInnerSelectable` Some given colors which can be selected by value calling `setValue(Object[])` or `setValue(float)`.
    `static int` | `version` Version and history 2016-11-22 bugfix: `setValue(Object[])` with negative input causes an exception.

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

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `GralLed(java.lang.String name)`
    `protected` | `GralLed(java.lang.String name, GralMng mng)` Deprecated. use `GralLed(String)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setColor(GralColor colorBorder, GralColor colorInner)` Sets the LED's color.
    `void` | `setValue(float value)` Sets the color both inner and border with the given value using the `colorInnerSelectable`
    `void` | `setValue(java.lang.Object[] values)` This method is invoked if more as one variable is assigned to the widget.

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

      `chgPos, clearShowParam, createImplWidget_Gthread, 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, remove, 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, setVisible, setVisibleState, setVisibleStateWidget, specifyActionChange, specifyContextMenu, stop, toString, XXXgetPixelPositionSize, XXXgetWidgetImplementation, XXXremoveWidgetImplementation, XXXrepaintGthread, XXXsetFocusGThread, XXXsetVisibleGThread`

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

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

- - ### Field Detail

    - #### version

          public static final int version

      Version and history
      - 2016-11-22 bugfix: `setValue(Object[])` with negative input causes an exception. Now a 3. color magenta was shown to see that failure.
      - 2014-10-12 chg: now instantiable. New concept.
      - 2012-04-01 new: `#colorBorder`, `colorBorderSelectable`, `setValue(Object[])`
      - 2011-12-03 new Baseclass for LED visualization. It is the concept of specialized `GralWidget`.
      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

    - #### colorBorderSelectable

          private final GralColor[] colorBorderSelectable

      Some given colors which can be selected by value calling `setValue(Object[])` or `setValue(float)`.

    - #### colorInnerSelectable

          private final GralColor[] colorInnerSelectable

      Some given colors which can be selected by value calling `setValue(Object[])` or `setValue(float)`.

  - ### Constructor Detail

    - #### GralLed

          protected GralLed(java.lang.String name,
                            GralMng mng)

      Deprecated. use `GralLed(String)`
      Parameters:
        `name` -
        `mng` -

    - #### GralLed

          public GralLed(java.lang.String name)

  - ### Method Detail

    - #### setColor

          public void setColor(GralColor colorBorder,
                               GralColor colorInner)

      Sets the LED's color. The border can be another than the inner color. The effect of `setValue(Object[])` is independent from this method.
      Parameters:
        `colorBorder` - assign to `GralWidget.setLineColor(GralColor, int)` or `GralWidget.DynamicData.lineColor`.
        `colorInner` - assign to `GralWidget.setBackColor(GralColor, int)` `GralWidget.DynamicData.backColor`.

    - #### setValue

          public void setValue(float value)

      Sets the color both inner and border with the given value using the `colorInnerSelectable`
      Specified by:
        `setValue` in interface `GralSetValue_ifc`
      Overrides:
        `setValue` in class `GralWidget`
      Parameters:
        `value` - This routine may be overridden by some specialized widgets.
      See Also:
        `GralWidget.setValue(float)`

    - #### setValue

          public void setValue(java.lang.Object[] values)

      This method is invoked if more as one variable is assigned to the widget. It sets the line and the back color which is the inner color (back) and border (line). The values should be integer-readable.
      Specified by:
        `setValue` in interface `GralSetValue_ifc`
      Overrides:
        `setValue` in class `GralWidget`
      Parameters:
        `values` - This routine may be overridden by some specialized widgets.
      See Also:
        `GralWidget.setValue(java.lang.Object[])`