RiTa
index
Name RiTaEvent
Description Simple class for event-based callbacks (generally dynamically dispatched to PApplet subclasses).

A typical usage is to switch on the type of a RiTaEvent within a callback:

    public void onRiTaEvent(RiTaEvent re)
    {
      switch (re.getType()) {
        case RiTa.TIMER_TICK:
           ...
        case RiTa.TEXT_ENTERED:
           ...
        case RiTa.SPEECH_COMPLETED:
           ...
        case RiTa.BEHAVIOR_COMPLETED:
           ...
      }
    }
Constructors
RiTaEvent(source, type);
RiTaEvent(source, type, data);
Methods
getData()   Returns auxillary data that varies based on the different event types.
For example,
  • if type == SPEECH_COMPLETED, then data will contain a String with the last spoken text.
  • if type == TEXT_ENTERED, then data will contain a String with the entered text.
  • if type == BEHAVIOR_COMPLETED, or type == TIMER_COMPLETED, then data will contain the RiTextBehavior object that has just completed.


getId()  

getName()   Return the user-specified name for this event, or for the associated TextBehavior. For example, if a name has been assigned to a RiTa timer which generated this event, it will be accessible here.

getType()   Returns one of the event types specified in the RiConstants interface, e.g., BEHAVIOR_COMPLETED, or SPEECH_COMPLETED.

To test, use the following syntax:

    if (re.getType() == RiTa.BEHAVIOR_COMPLETED)
      // do something
 


toString()  

Usage Web & Application