public class LLUIInput extends Object
EventGenerator
event generator implementation.
Several methods takes in argument a string generatorID
. This ID must refer to a MicroUI events generator
defined during the MicroEJ plaform build in microui/microui.xml
file (in platform configuration
project).
In designer mode (plugin mode), this ID is unknown so all methods throw an IllegalArgumentException
. The
caller should catch this exception and prints in the standard output stream a description of this event.
In MicroEJ application mode, this exception should not occur (the MicroUI events generator ID should exist). However, when exception occurs, the trace allows to the user to note there is an issue according the MicroUI events generator ID.
Modifier and Type | Method and Description |
---|---|
static int |
buildEvent(int generatorId,
int data)
Constructs and returns an event.
|
static int |
buildEvent(String generatorId,
int data)
Constructs and returns an event.
|
static int |
getData(int event)
Returns the data component of the event.
|
static int |
getType(int event)
Returns the type (i.e.
|
static void |
sendEvent(int event)
Sends an event in the queue.
|
static void |
sendEvent(int generatorId,
int data)
Constructs an event and sends it to the simulator input queue.
|
static void |
sendEvent(String generatorId,
int data)
Constructs an event and sends it to the simulator input queue.
|
static void |
sendEvents(int[] events)
Sends several events in the queue.
|
public static int buildEvent(int generatorId, int data)
generatorId
- the required generator id (i.e. type) of the event.data
- the data component of the event.public static int buildEvent(String generatorId, int data)
generatorId
- the required generator id (i.e. type) of the event.data
- the data component of the event.IllegalArgumentException
- whether the generatorID refers to an unknown MicroUI generator (see class comment).public static int getData(int event)
event
- the event to decode.public static int getType(int event)
event
- the event to decode.public static void sendEvent(int event)
buildEvent(int, int)
or
buildEvent(String, int)
.event
- the event to send.public static void sendEvent(int generatorId, int data)
sendEvent(buildEvent(generatorId, data))
.generatorId
- the required generator id (i.e. type) of the event.data
- the data component of the event.public static void sendEvent(String generatorId, int data)
sendEvent(buildEvent(generatorId, data))
.generatorId
- the required generator id (i.e. type) of the event.data
- the data component of the event.IllegalArgumentException
- whether the generatorID refers to an unknown MicroUI generator (see class comment).public static void sendEvents(int[] events)
buildEvent(int, int)
or buildEvent(String, int)
.events
- the events to send.