sub_arctic.new_lib
Class audio_navigator

java.lang.Object
  |
  +--sub_arctic.new_lib.navigator_base
        |
        +--sub_arctic.new_lib.halo_navigator
              |
              +--sub_arctic.new_lib.audio_navigator

public class audio_navigator
extends halo_navigator

This class implements an audio based navigator (which also does visual halo feedback at the same time). It works both with audio aware interactors (implementing audio_navigation_aware) which provide their own translation into audio, or by using a generic_audio_xlation object it creates internally to do a translation. In addition to feedback from the interactor at the current location in the tree, the navigator also provides generic navigation feedback (such as hitting the top, bottom, left, or right, etc.).


Field Summary
protected  java.util.Vector _cur_audio
          A description of the audio segments currently playing.
protected static audio_renderer _hit_bottom_sound
          Description of sound for hitting the bottom of the tree
protected static audio_renderer _hit_left_sound
          Description of sound for hitting the left most child
protected static audio_renderer _hit_right_sound
          Description of sound for hitting the right most child
protected static audio_renderer _hit_top_sound
          Description of sound for hitting the top of the tree
protected static audio_renderer _text_mode_entry_sound
          Description of sound for entering text entry mode
protected static audio_renderer _text_mode_exit_sound
          Description of sound for exiting text entry mode
protected  generic_audio_xlation _xlator
          Audio translator we use to convert interactors to audio
 
Fields inherited from class sub_arctic.new_lib.halo_navigator
_feedback_halo
 
Fields inherited from class sub_arctic.new_lib.navigator_base
_current_location
 
Constructor Summary
audio_navigator(halo_container feedback_halo, interactor cur_loc)
          Construct an audio navigator based on an initial position in the tree.
 
Method Summary
 void arrive(interactor at_interactor)
          Provide feedback and/or actions associated with arriving at a particular interactor node.
 void depart(interactor from_interactor)
          Provide feedback and/or actions associated with leaving a particular interactor node.
 boolean enter_text_entry_mode(event evt, java.lang.Object user_info)
          Request to enter text entry mode.
 boolean exit_text_entry_mode(event evt, java.lang.Object user_info)
          Indicate that we are leaving text entry mode and returning to navigation mode.
protected  interactor find_down(interactor from_loc)
          Find the next node moving down, returning null if we hit the top.
protected  interactor find_left(interactor from_loc)
          Find the next node moving left, returning null if we go past the first child.
protected  interactor find_right(interactor from_loc)
          Find the next node moving right, returning null if we go past the last child.
protected  interactor find_up(interactor from_loc)
          Find the next node moving up, returning null if we hit the top.
static audio_renderer get_audio_renderer(java.lang.String name)
          Load an audio_renderer by name.
protected static audio_renderer hit_bottom_sound()
          Description of sound for hitting the bottom of the tree
 void hit_bottom()
          Provide feedback for attempting to move down past a leaf.
protected static audio_renderer hit_left_sound()
          Description of sound for hitting the left most child
 void hit_left()
          Provide feedback for attempting to move left past the first sibling.
protected static audio_renderer hit_right_sound()
          Description of sound for hitting the right most child
 void hit_right()
          Provide feedback for attempting to move right past the last sibling.
protected static audio_renderer hit_top_sound()
          Description of sound for hitting the top of the tree
 void hit_top()
          Provide feedback for attempting to move up past the root.
 boolean perform_action(int act_num, event evt, java.lang.Object user_info)
          Perform an action associated with the interactor at the current location (e.g., if this is a button, push it).
protected  void play(audio_renderer sound_desc)
          Start playing a particular audio segment keeping the bookkeeping we need to stop this early if necessary.
 void preview_arrive(interactor at_interactor)
          Provide preview feedback associated with arriving at a particular interactor node.
 void preview_depart(interactor from_interactor)
          Provide preview feedback associated with leaving a particular interactor node.
 void preview_hit_bottom()
          Provide preview feedback for attempting to move down past a leaf.
 void preview_hit_left()
          Provide preview feedback for attempting to move left past the first sibling.
 void preview_hit_right()
          Provide preview feedback for attempting to move right past the last sibling.
 void preview_hit_top()
          Provide preview feedback for attempting to move up past the root.
protected  void stop_all()
          Stop all currently playing audio segments
protected static audio_renderer text_mode_entry_sound()
          Description of sound for entering text entry mode
protected static audio_renderer text_mode_exit_sound()
          Description of sound for entering text entry mode
 
Methods inherited from class sub_arctic.new_lib.halo_navigator
feedback_halo, feedback_halo, navigate_up, preview_to_top
 
Methods inherited from class sub_arctic.new_lib.navigator_base
current_location, do_move, do_preview, focus_set_enter, focus_set_exit, navigate_down, navigate_left, navigate_right, navigate_to_top, navigate_to, preview_down, preview_left, preview_right, preview_to, preview_up
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_xlator

protected generic_audio_xlation _xlator
Audio translator we use to convert interactors to audio

_cur_audio

protected java.util.Vector _cur_audio
A description of the audio segments currently playing. This will always contain audio_renderer objects.

_text_mode_entry_sound

protected static audio_renderer _text_mode_entry_sound
Description of sound for entering text entry mode

_text_mode_exit_sound

protected static audio_renderer _text_mode_exit_sound
Description of sound for exiting text entry mode

_hit_top_sound

protected static audio_renderer _hit_top_sound
Description of sound for hitting the top of the tree

_hit_bottom_sound

protected static audio_renderer _hit_bottom_sound
Description of sound for hitting the bottom of the tree

_hit_left_sound

protected static audio_renderer _hit_left_sound
Description of sound for hitting the left most child

_hit_right_sound

protected static audio_renderer _hit_right_sound
Description of sound for hitting the right most child
Constructor Detail

audio_navigator

public audio_navigator(halo_container feedback_halo,
                       interactor cur_loc)
Construct an audio navigator based on an initial position in the tree.
Parameters:
halo_container - feedback_halo object that does visual feedback for us.
interactor - cur_loc initial location for the navigator
Method Detail

find_up

protected interactor find_up(interactor from_loc)
Find the next node moving up, returning null if we hit the top. Here we consider objects which the translator marks as !display_this() as transparent to navigation and we silently move through or collapse them.
Parameters:
interactor - from_loc the interactor we are moving up from
Returns:
interactor the next interactor in the up direction, or null if we hit the top
Overrides:
find_up in class navigator_base

find_down

protected interactor find_down(interactor from_loc)
Find the next node moving down, returning null if we hit the top. Here we consider objects which the translator marks as !display_this() as transparent to navigation and we silently move through or collapse them.
Parameters:
interactor - from_loc the interactor we are moving down from
Returns:
interactor the next interactor in the down direction, or null if we hit the bottom
Overrides:
find_down in class navigator_base

find_left

protected interactor find_left(interactor from_loc)
Find the next node moving left, returning null if we go past the first child. Here we consider objects which the translator marks as !display_this() as transparent to navigation and we silently move through or collapse them. If we hit the left and our parent is transparent then we consider its previous siblings to be our previous siblings and look at them (this corresponds to collapsing the parent).
Parameters:
interactor - from_loc the interactor we are moving left from
Returns:
interactor the next interactor in the down direction, or null if we go past the first child
Overrides:
find_left in class navigator_base

find_right

protected interactor find_right(interactor from_loc)
Find the next node moving right, returning null if we go past the last child. Here we consider objects which the translator marks as !display_this() as transparent to navigation and we silently move through or collapse them. If we hit the right and our parent is transparent then we consider its next siblings to be our next siblings and look at them (this corresponds to collapsing the parent).
Parameters:
interactor - from_loc the interactor we are moving left from
Returns:
interactor the next interactor in the down direction, or null if we go past the first child
Overrides:
find_right in class navigator_base

get_audio_renderer

public static audio_renderer get_audio_renderer(java.lang.String name)
Load an audio_renderer by name. Currently we get the audio icon portion from the document base under the given name, and set the text to empty.
Parameters:
String - name name of the sound file we use
Returns:
audio_renderer the requested object

text_mode_entry_sound

protected static audio_renderer text_mode_entry_sound()
Description of sound for entering text entry mode

text_mode_exit_sound

protected static audio_renderer text_mode_exit_sound()
Description of sound for entering text entry mode

hit_top_sound

protected static audio_renderer hit_top_sound()
Description of sound for hitting the top of the tree

hit_bottom_sound

protected static audio_renderer hit_bottom_sound()
Description of sound for hitting the bottom of the tree

hit_left_sound

protected static audio_renderer hit_left_sound()
Description of sound for hitting the left most child

hit_right_sound

protected static audio_renderer hit_right_sound()
Description of sound for hitting the right most child

play

protected void play(audio_renderer sound_desc)
Start playing a particular audio segment keeping the bookkeeping we need to stop this early if necessary. Later this will schedule this after currently playing sounds but this is currently not possible so we used the brain damaged overlapping audio scheme provided by applets.
Parameters:
audio_renderer - soud_desc the sound to play

stop_all

protected void stop_all()
Stop all currently playing audio segments

enter_text_entry_mode

public boolean enter_text_entry_mode(event evt,
                                     java.lang.Object user_info)
Request to enter text entry mode. In this mode, keystrokes that might normally be interpreted by the input agent as navigation commands are treated as normal keystrokes again. If the current interactor does not accept text, text_entry_mode_fail() will be called, and false will be returned (indicating that the input agent should not enter text entry mode).
Parameters:
event - evt the event causing this input
Object - user_info information supplied at focus time
Returns:
boolean indicating successful entry into text entry mode.
Overrides:
enter_text_entry_mode in class navigator_base

exit_text_entry_mode

public boolean exit_text_entry_mode(event evt,
                                    java.lang.Object user_info)
Indicate that we are leaving text entry mode and returning to navigation mode.
Parameters:
event - evt the event causing this input
Object - user_info information supplied at focus time
Returns:
boolean indicating whether input was accepted
Overrides:
exit_text_entry_mode in class navigator_base

perform_action

public boolean perform_action(int act_num,
                              event evt,
                              java.lang.Object user_info)
Perform an action associated with the interactor at the current location (e.g., if this is a button, push it).
Parameters:
int - act_num the number of the action to perform (0 will be the primary or default action)
event - evt the event causing this input
Object - user_info information supplied at focus time
Returns:
boolean indicating if the (inputs corresponding to the) action was accepted by the object.
Overrides:
perform_action in class navigator_base

hit_top

public void hit_top()
Provide feedback for attempting to move up past the root. This is normally called internally as a side effect of navigation input calls.
Overrides:
hit_top in class navigator_base

hit_bottom

public void hit_bottom()
Provide feedback for attempting to move down past a leaf. This is normally called internally as a side effect of navigation input calls.
Overrides:
hit_bottom in class navigator_base

hit_left

public void hit_left()
Provide feedback for attempting to move left past the first sibling. This is normally called internally as a side effect of navigation input calls.
Overrides:
hit_left in class navigator_base

hit_right

public void hit_right()
Provide feedback for attempting to move right past the last sibling. This is normally called internally as a side effect of navigation input calls.
Overrides:
hit_right in class navigator_base

preview_hit_top

public void preview_hit_top()
Provide preview feedback for attempting to move up past the root. This is normally called internally as a side effect of preview input calls.
Overrides:
preview_hit_top in class navigator_base

preview_hit_bottom

public void preview_hit_bottom()
Provide preview feedback for attempting to move down past a leaf. This is normally called internally as a side effect of preview input calls.
Overrides:
preview_hit_bottom in class navigator_base

preview_hit_left

public void preview_hit_left()
Provide preview feedback for attempting to move left past the first sibling. This is normally called internally as a side effect of preview input calls.
Overrides:
preview_hit_left in class navigator_base

preview_hit_right

public void preview_hit_right()
Provide preview feedback for attempting to move right past the last sibling. This is normally called internally as a side effect of preview input calls.
Overrides:
preview_hit_right in class navigator_base

depart

public void depart(interactor from_interactor)
Provide feedback and/or actions associated with leaving a particular interactor node.
Parameters:
interactor - from_interactor
Overrides:
depart in class halo_navigator

arrive

public void arrive(interactor at_interactor)
Provide feedback and/or actions associated with arriving at a particular interactor node.
Parameters:
interactor - at_interactor
Overrides:
arrive in class halo_navigator

preview_depart

public void preview_depart(interactor from_interactor)
Provide preview feedback associated with leaving a particular interactor node.
Parameters:
interactor - from_interactor
Overrides:
preview_depart in class navigator_base

preview_arrive

public void preview_arrive(interactor at_interactor)
Provide preview feedback associated with arriving at a particular interactor node.
Parameters:
interactor - at_interactor
Overrides:
preview_arrive in class navigator_base