edu.berkeley.guir.ptk.transition
Class Transition

java.lang.Object
  extended byedu.berkeley.guir.ptk.PTK
      extended byedu.berkeley.guir.ptk.transition.Transition
Direct Known Subclasses:
RADTransition

public class Transition
extends PTK

The transition() method is the entry and exit point for this class, which calls state machine methods to create the transition. The transition consists of a chain of events. The chain of events is passed to the output, which displays each in turn. To create this chain of events, the transition calls the Animatable methods in a certain order. This order is implemented by the state machine methods. A transition from one notification level to another may need to be unique. The state machine methods include actions for all permutations of one notification level to another (e.g., changeblind2ignore, changeblind2changeblind, changeblind2makeaware, etc.). The default Transition class implements only the following methods, which are called by the state machine methods based on a new event's notification level. These events call the Animatable methods, creating varying chains of events.

These methods and the remaining state machine methods can be overridden to created custom transitions by extending this class. However, the Animatable interface methods that must be implemented by the developer may provide enough customization.

Author:
tmatthew Created: Mar 2, 2003

Field Summary
 DisplayInfo display_info
          Contains application-specific event display information, such as the color of text of pacing information.
 int num_steps_changeblind
          The number of steps a changeblind transition will have (default = 30).
 int num_steps_interrupt
          The number of steps an interrupt transition will have (default = 10).
 int num_steps_makeaware
          The number of steps a make aware transition will have (default = 1).
 
Fields inherited from class edu.berkeley.guir.ptk.PTK
debug, MAX_DEBUG, MED_DEBUG, MIN_DEBUG, NO_DEBUG
 
Constructor Summary
Transition()
          Default constructor: sets this.display_info to a new DisplayInfo object.
Transition(DisplayInfo di)
          Parameterized constructor: sets this.display_info to the given DisplayInfo object.
 
Method Summary
protected  Event[] changeblind2changeblind(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] changeblind2demandaction(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] changeblind2ignore(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] changeblind2interrupt(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] changeblind2makeaware(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] changeblindTrans(Animatable out, Event prev_event, Event new_event)
          Function used to create a change blind transition.
protected  Event[] demandaction2changeblind(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] demandaction2demandaction(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] demandaction2ignore(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] demandaction2interrupt(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] demandaction2makeaware(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] demandactionTrans(Animatable out, Event prev_event, Event new_event)
          Function that creates the array of events for a demand action transition.
protected  Event[] ignore2changeblind(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] ignore2demandaction(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] ignore2ignore(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] ignore2interrupt(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] ignore2makeaware(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] ignoreTrans(Animatable out, Event prev_event, Event new_event)
          Function used to create an ignore transition (which just returns null).
protected  Event[] interrupt2changeblind(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] interrupt2demandaction(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] interrupt2ignore(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] interrupt2interrupt(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] interrupt2makeaware(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] interruptTrans(Animatable out, Event prev_event, Event new_event)
          Function used to create in interrupt transition.
protected  Event[] makeaware2changeblind(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] makeaware2demandaction(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] makeaware2ignore(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] makeaware2interrupt(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] makeaware2makeaware(Animatable a, Event prev_event, Event new_event)
           
protected  Event[] makeawareTrans(Animatable out, Event prev_event, Event new_event)
          Function used to create a make aware transition.
 Event[] transition(Animatable a, Event new_event)
          This is the entry and exit point of an event to the Transition object.
 
Methods inherited from class edu.berkeley.guir.ptk.PTK
getMAX, getMED, getMIN, getNO, printDebug, printDebug, printError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

display_info

public DisplayInfo display_info
Contains application-specific event display information, such as the color of text of pacing information. The default DisplayInfo only has a color data field, but developers can set this Transition's DisplayInfo to their own custom DisplayInfo class.


num_steps_changeblind

public int num_steps_changeblind
The number of steps a changeblind transition will have (default = 30). This corresponds to the number of events in the transition. In all cases, a changeblind transition will have at least one step.


num_steps_makeaware

public int num_steps_makeaware
The number of steps a make aware transition will have (default = 1). This corresponds to the number of events in the transition. In all cases, a make aware transition will have at least one step.


num_steps_interrupt

public int num_steps_interrupt
The number of steps an interrupt transition will have (default = 10). This corresponds to the number of events in the transition. In all cases, an interrupt transition will have at least one step.

Constructor Detail

Transition

public Transition()
Default constructor: sets this.display_info to a new DisplayInfo object.


Transition

public Transition(DisplayInfo di)
Parameterized constructor: sets this.display_info to the given DisplayInfo object.

Parameters:
di - DisplayInfo
Method Detail

transition

public Event[] transition(Animatable a,
                          Event new_event)
This is the entry and exit point of an event to the Transition object. It is unlikely that a developer should override this method.

This method provides the full range of calls corresponding to every pair of new event and old event notification levels. The default functionality is to reduce the function calls to ones that only consider the new event's notification level. These in turn are given a default functionality described in the class comments above.

Returns:
Event[] an array of events that will be passed to the Output in order and displayed.

ignore2ignore

protected Event[] ignore2ignore(Animatable a,
                                Event prev_event,
                                Event new_event)

ignore2changeblind

protected Event[] ignore2changeblind(Animatable a,
                                     Event prev_event,
                                     Event new_event)

ignore2makeaware

protected Event[] ignore2makeaware(Animatable a,
                                   Event prev_event,
                                   Event new_event)

ignore2interrupt

protected Event[] ignore2interrupt(Animatable a,
                                   Event prev_event,
                                   Event new_event)

ignore2demandaction

protected Event[] ignore2demandaction(Animatable a,
                                      Event prev_event,
                                      Event new_event)

changeblind2ignore

protected Event[] changeblind2ignore(Animatable a,
                                     Event prev_event,
                                     Event new_event)

changeblind2changeblind

protected Event[] changeblind2changeblind(Animatable a,
                                          Event prev_event,
                                          Event new_event)

changeblind2makeaware

protected Event[] changeblind2makeaware(Animatable a,
                                        Event prev_event,
                                        Event new_event)

changeblind2interrupt

protected Event[] changeblind2interrupt(Animatable a,
                                        Event prev_event,
                                        Event new_event)

changeblind2demandaction

protected Event[] changeblind2demandaction(Animatable a,
                                           Event prev_event,
                                           Event new_event)

makeaware2ignore

protected Event[] makeaware2ignore(Animatable a,
                                   Event prev_event,
                                   Event new_event)

makeaware2changeblind

protected Event[] makeaware2changeblind(Animatable a,
                                        Event prev_event,
                                        Event new_event)

makeaware2makeaware

protected Event[] makeaware2makeaware(Animatable a,
                                      Event prev_event,
                                      Event new_event)

makeaware2interrupt

protected Event[] makeaware2interrupt(Animatable a,
                                      Event prev_event,
                                      Event new_event)

makeaware2demandaction

protected Event[] makeaware2demandaction(Animatable a,
                                         Event prev_event,
                                         Event new_event)

interrupt2ignore

protected Event[] interrupt2ignore(Animatable a,
                                   Event prev_event,
                                   Event new_event)

interrupt2changeblind

protected Event[] interrupt2changeblind(Animatable a,
                                        Event prev_event,
                                        Event new_event)

interrupt2makeaware

protected Event[] interrupt2makeaware(Animatable a,
                                      Event prev_event,
                                      Event new_event)

interrupt2interrupt

protected Event[] interrupt2interrupt(Animatable a,
                                      Event prev_event,
                                      Event new_event)

interrupt2demandaction

protected Event[] interrupt2demandaction(Animatable a,
                                         Event prev_event,
                                         Event new_event)

demandaction2ignore

protected Event[] demandaction2ignore(Animatable a,
                                      Event prev_event,
                                      Event new_event)

demandaction2changeblind

protected Event[] demandaction2changeblind(Animatable a,
                                           Event prev_event,
                                           Event new_event)

demandaction2makeaware

protected Event[] demandaction2makeaware(Animatable a,
                                         Event prev_event,
                                         Event new_event)

demandaction2interrupt

protected Event[] demandaction2interrupt(Animatable a,
                                         Event prev_event,
                                         Event new_event)

demandaction2demandaction

protected Event[] demandaction2demandaction(Animatable a,
                                            Event prev_event,
                                            Event new_event)

ignoreTrans

protected Event[] ignoreTrans(Animatable out,
                              Event prev_event,
                              Event new_event)
Function used to create an ignore transition (which just returns null).


changeblindTrans

protected Event[] changeblindTrans(Animatable out,
                                   Event prev_event,
                                   Event new_event)
Function used to create a change blind transition. By default, it creates num_steps_changeblind events to be displayed in in order on the output.


makeawareTrans

protected Event[] makeawareTrans(Animatable out,
                                 Event prev_event,
                                 Event new_event)
Function used to create a make aware transition. By default, returns an array of one event. Array can be increased by setting num_steps_makeaware to be greater than one.

Returns:
Event[] the array of events that will be displayed in the output

interruptTrans

protected Event[] interruptTrans(Animatable out,
                                 Event prev_event,
                                 Event new_event)
Function used to create in interrupt transition. By default it creates a "flashing" effect by alternating between calls to alternateStep and endTransition.


demandactionTrans

protected Event[] demandactionTrans(Animatable out,
                                    Event prev_event,
                                    Event new_event)
Function that creates the array of events for a demand action transition. By default, it calls interruptTrans() and then adds another event to the array that will have the grab_action_event flag set so that the output will know that it is time to check that a specific action has been performed by the user.