multivalent
public class SemanticEvent extends AWTEvent
The type of semantic event, or its message, is given by a String field. By using String's, the set of event types is kept open ended. Message detail is given in fields; fields are given suggestive names, but the exact contents depend on the particular semantic event arg, in, out.
Following the Multivalent architectural principle
that new behaviors can introduce whatever new structure is needed,
any behavior can introduce a semantic event by defining it.
Defining means specifying the use of all the fields,
usually in the Javadoc comment of a public static final String
field that specifies the message.
Of course, behaviors should take pains to use existing names when available.
The defining behavior usually provides some implementation in its
Behavior and/or Behavior methods.
For examples of the standard format for event definitions, see MSG_OPEN, MSG_NEW, and MSG_EXECUTE.
Semantic events are thrown or fired by adding them to a browser's event queue. Complete semantic events, which should have a handle to the browser in their source field, can be fired via Browser. The convenience method Browser constructs and fires a semantic with the given String message and Object arg. Semantic events are caught in the Behavior and Behavior methods. Often a behavior will throw and catch the same event.
Version: $Revision: 1.4 $ $Date: 2003/06/02 05:10:16 $
See Also: Document Browser SystemEvents Multipage VMenu SemanticUI
Constructor Summary | |
---|---|
SemanticEvent(Object source, String message, Object arg) | |
SemanticEvent(Object source, String message, Object arg, Object in, Object out) |
Method Summary | |
---|---|
boolean | equals(Object o)
Two SemanticEvents are equal() iff == is true for all their fields
(source, message, arg, in, and out). |
Object | getArg() |
Object | getIn() |
String | getMessage()
Messages are intern()'ed, so you can compare it with == rather than Object#equals(Object). |
Object | getOut() |
int | hashCode() |
void | setArg(Object arg) |
String | toString() |
SemanticEvents
are equal()
iff ==
is true for all their fields
(source, message, arg, in, and out).==
rather than Object#equals(Object).