Class MessageEvent
public class MessageEvent
Payload of a message-family event (evCommand, evBroadcast, or a
user-defined message).
This class corresponds to the evMessage variant of the Pascal
TEvent record. It is active when JtvEvent.getWhat() is in the
EventCodes.evMessage mask.
The original Pascal record stored the extra payload as an overlay of several
types (InfoPtr, InfoLong, InfoWord, …). Here the most
commonly used overlays are exposed as separate fields.
org.viktor44.jtvision.core.MessageEvent
Summary
Constructors
| Visibility | Signature |
|---|---|
| public | MessageEvent(int command, Object infoPtr) |
| public | MessageEvent() |
| public | MessageEvent(int command, Object infoPtr, int infoInt, long infoLong) |
Fields
| Modifiers | Field name | Type |
|---|---|---|
| private | command | int |
| private | infoPtr | Object |
| private | infoInt | int |
| private | infoLong | long |
Methods
| Modifiers | Method signature | Return type |
|---|---|---|
| public | getCommand() | int |
| public | setCommand(int command) | void |
| public | getInfoPtr() | Object |
| public | setInfoPtr(Object infoPtr) | void |
| public | getInfoInt() | int |
| public | setInfoInt(int infoInt) | void |
| public | getInfoLong() | long |
| public | setInfoLong(long infoLong) | void |
Constructors
MessageEvent(int command, Object infoPtr)
Constructs a message event with a command and an object payload.
Parameters
command- the command codeinfoPtr- the object payload (may benull)
MessageEvent()
No method description provided
MessageEvent(int command, Object infoPtr, int infoInt, long infoLong)
Creates a new MessageEvent instance.
Parameters
-
command- The command code carried by this event.For
evCommandevents this is the integer constant bound to the menu item, status key, or hot key that generated the command. ForevBroadcastevents it identifies the broadcast type (for examplecmCommandSetChanged). Standard command codes are defined inCommandCodes. -
infoPtr- Arbitrary object payloadViews that generate events often place a reference to themselves or to some related object here so that the recipient can identify the source.
JtvEvent#clearEventsets this field to the view that consumed the event, which is used byMessage()to return that view to the caller. -
infoInt- Integer payloadAlternative numeric interpretation of the message payload, used when a signed integer value needs to be passed alongside the command code.
-
infoLong- Long-integer payload
Alternative numeric interpretation of the message payload for cases that
require a wider integer value than #infoInt can hold.
Fields
int command
The command code carried by this event.
For evCommand events this is the integer constant bound to the
menu item, status key, or hot key that generated the command. For
evBroadcast events it identifies the broadcast type (for example
cmCommandSetChanged). Standard command codes are defined in
CommandCodes.
Object infoPtr
Arbitrary object payload
Views that generate events often place a reference to themselves or to
some related object here so that the recipient can identify the source.
JtvEvent.clearEvent sets this field to the view that consumed the
event, which is used by Message() to return that view to the caller.
int infoInt
Integer payload
Alternative numeric interpretation of the message payload, used when a signed integer value needs to be passed alongside the command code.
long infoLong
Long-integer payload
Alternative numeric interpretation of the message payload for cases that
require a wider integer value than infoInt can hold.
Methods
getCommand()
The command code carried by this event.
For evCommand events this is the integer constant bound to the
menu item, status key, or hot key that generated the command. For
evBroadcast events it identifies the broadcast type (for example
cmCommandSetChanged). Standard command codes are defined in
CommandCodes.
setCommand(int command)
The command code carried by this event.
For evCommand events this is the integer constant bound to the
menu item, status key, or hot key that generated the command. For
evBroadcast events it identifies the broadcast type (for example
cmCommandSetChanged). Standard command codes are defined in
CommandCodes.
Parameters
command
getInfoPtr()
Arbitrary object payload
Views that generate events often place a reference to themselves or to
some related object here so that the recipient can identify the source.
JtvEvent.clearEvent sets this field to the view that consumed the
event, which is used by Message() to return that view to the caller.
setInfoPtr(Object infoPtr)
Arbitrary object payload
Views that generate events often place a reference to themselves or to
some related object here so that the recipient can identify the source.
JtvEvent.clearEvent sets this field to the view that consumed the
event, which is used by Message() to return that view to the caller.
Parameters
infoPtr
getInfoInt()
Integer payload
Alternative numeric interpretation of the message payload, used when a signed integer value needs to be passed alongside the command code.
setInfoInt(int infoInt)
Integer payload
Alternative numeric interpretation of the message payload, used when a signed integer value needs to be passed alongside the command code.
Parameters
infoInt
getInfoLong()
Long-integer payload
Alternative numeric interpretation of the message payload for cases that
require a wider integer value than infoInt can hold.
setInfoLong(long infoLong)
Long-integer payload
Alternative numeric interpretation of the message payload for cases that
require a wider integer value than infoInt can hold.
Parameters
infoLong