public class Event extends Object
EventGenerator
classes with event constants and helper methods to build and analyse events.
An event has a type, a 8-bit figure that forms the most significant byte of the int-event, followed by 8-bits which
is the generator identifier quantity, and followed by 16-bit of data.
event : type (8-bit) + generatorId (8-bit) + data (16-bit)
The very first 16 types [0x00..0x0f], some of which are defined by constants in this class, are MicroUI reserved. An application may create as many as 240 different kind of events.
EventGenerator
Modifier and Type | Method and Description |
---|---|
static int |
buildEvent(int type,
EventGenerator gen,
int data)
Builds an event from a given type, an eventGenerator and data.
|
static int |
getData(int event)
Returns the event's data issued by a generator.
|
static EventGenerator |
getGenerator(int event)
Gets a converter out of an event assuming the event has been generated by an
EventGenerator that has been
previously added to the system pool. |
static int |
getGeneratorId(int event)
Returns the event's generator identifier.
|
static int |
getType(int event)
Returns the type of an event.
|
public static int buildEvent(int type, EventGenerator gen, int data)
type
and data
must respect the format (respectively 0x0 to 0xff and 0x0 to 0xffff). No
check is performed at runtime, only a crop is performed.
type
- the type of the event to buildgen
- the generator associated with the eventdata
- the data of the event to buildint
public static int getData(int event)
event
- an eventint
public static EventGenerator getGenerator(int event)
EventGenerator
that has been
previously added to the system pool.event
- an eventIllegalArgumentException
- if there is no generator associated to this event.MicroUIException
- if MicroUI is not startedEventGenerator.addToSystemPool()
public static int getGeneratorId(int event)
event
- an eventint
public static int getType(int event)
event
- an eventint