public class LED extends Widget implements LLUILedImpl
LLUILedImpl
interface. An implementation of this interface is
required to be able to use a MicroUI Led in a MicroEJ application.Widget.WidgetAttribute, Widget.WidgetDescription
DEFAULT_LABEL
MAX_INTENSITY, MIN_INTENSITY
Constructor and Description |
---|
LED() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes the widget's associated resources (such as threads, images...).
|
void |
finalizeConfiguration()
Checks whether the widget configuration is valid or not and finalizes the widget configuration according all
attributes previously set.
|
int |
getIntensity()
Gets the intensity of this led.
|
void |
setIntensity(int intensity)
Sets the intensity of this led.
|
void |
setLedOff(Image ledOff)
Sets the image which represents the LED off.
|
void |
setLedOn(Image ledOn)
Sets the image which represents the LED on.
|
void |
showYourself(boolean appearSwitchedOn)
Called by front panel viewer to make widgets appear as if "switched on" or not.
|
getAbsoluteX, getAbsoluteY, getCurrentSkin, getFilter, getHeight, getLabel, getParent, getSkin, getWidth, getX, getY, isOver, repaint, repaint, setCurrentSkin, setFilter, setHeight, setLabel, setOverlay, setSkin, setWidth, setX, setY, start
public void dispose()
Widget
Default behavior disposes the common images and subclasses should override this method to define their own behavior.
This method should only be called by front panel engine.
public void finalizeConfiguration()
Widget
The widget attributes are set by the front panel parser but the order is not defined. This method allows to perform some checks between several attributes (this method is called by the front panel parser after setting all attributes defined in front panel file).
The configuration validation depends on widget itself. Each subclass must verify its configuration after checking its parent configuration.
When framework calling this method, all device widgets are not created and finalized yet, and by extension the
device itself is not fully created too. So the implementation must not have to call some methods on other widgets
and the methods Device.getDevice()
or FrontPanel.getDevice()
. As soon as all widgets are created
and finalized, the simulation starts calling the method Widget.start()
on each widget. As this moment only, the
widget is able to use the other widgets and the device itself.
On configuration error, a RuntimeException
(or a subclass of RuntimeException
) must be thrown.
This method should only be called by front panel parser.
finalizeConfiguration
in class Widget
public int getIntensity()
LLUILedImpl
getIntensity
in interface LLUILedImpl
public void setIntensity(int intensity)
LLUILedImpl
setIntensity
in interface LLUILedImpl
intensity
- the intensity to set.public void setLedOff(Image ledOff)
This method should only be called by front panel parser.
ledOff
- the LED off image.public void setLedOn(Image ledOn)
This method should only be called by front panel parser.
ledOn
- the LED on image.public void showYourself(boolean appearSwitchedOn)
Widget
This method does nothing by default.
This method should only be called by front panel engine.
showYourself
in class Widget
appearSwitchedOn
- true to switch on widget, false to switch off.