sub_arctic.input
Class single_focus_agent

java.lang.Object
  |
  +--sub_arctic.input.dispatch_agent
        |
        +--sub_arctic.input.focus_dispatch_agent
              |
              +--sub_arctic.input.single_focus_agent
Direct Known Subclasses:
grow_drag_focus_agent, inout_drag_focus_agent, move_drag_focus_agent, navigation_agent, simple_drag_focus_agent, snap_drag_agent, text_focus_agent

public abstract class single_focus_agent
extends focus_dispatch_agent

This is a subclass of focus_dispatch_agent designed to support agents which need to limit their focus set to at most one element.


Fields inherited from class sub_arctic.input.focus_dispatch_agent
_focus_set, _user_info_set
 
Constructor Summary
single_focus_agent()
          Simple constructor
 
Method Summary
 void add_to_focus(focusable new_obj, event evt, java.lang.Object user_info)
          Add object to focus set.
 void clear_focus(event evt)
          Clear the focus set of this agent to empty.
 void remove_from_focus(focusable obj, event evt)
          Remove the given object from the focus set.
 void set_focus_to(focusable to_obj, event evt, java.lang.Object user_info)
          Replace the focus set of this agent with the given object.
 
Methods inherited from class sub_arctic.input.focus_dispatch_agent
allowable_focus, dispatch_event, focus_item, focus_set_size, inform_focus_enter, inform_focus_exit, is_in_focus, user_info_item
 
Methods inherited from class sub_arctic.input.dispatch_agent
after_dispatch_notify, dispatch_unused_event, event_is_useful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

single_focus_agent

public single_focus_agent()
Simple constructor
Method Detail

set_focus_to

public void set_focus_to(focusable to_obj,
                         event evt,
                         java.lang.Object user_info)
Replace the focus set of this agent with the given object. This provides a causal event and an uninterpreted object that will be passed back to the focus object whenever input is delivered to it by this agent.

Parameters:
focusable - to_obj the object going in the focus set.
event - evt the event that "caused" this focus.
Object - user_info the uninterpreted information that we will pass back to the object whenever it gets input from this agent.
Overrides:
set_focus_to in class focus_dispatch_agent

add_to_focus

public void add_to_focus(focusable new_obj,
                         event evt,
                         java.lang.Object user_info)
Add object to focus set. For this subclass this replaces the current focus hence acts the same as set_focus_to().
Parameters:
focusable - new_obj the object going in the focus set.
event - evt the event that "caused" this focus.
Object - user_info the uninterpreted information that we will pass back to the object whenever it gets input from this agent.
Overrides:
add_to_focus in class focus_dispatch_agent

remove_from_focus

public void remove_from_focus(focusable obj,
                              event evt)
Remove the given object from the focus set. If the object is in the focus set this acts like clear_focus(). If not an exception is thrown.
Parameters:
focusable - obj the object going in the focus set.
event - evt the event that "caused" this focus.
Overrides:
remove_from_focus in class focus_dispatch_agent

clear_focus

public void clear_focus(event evt)
Clear the focus set of this agent to empty.
Parameters:
event - evt the event that "caused" this.
Overrides:
clear_focus in class focus_dispatch_agent