sub_arctic.input
Class positional_policy_class

java.lang.Object
  |
  +--sub_arctic.input.input_policy
        |
        +--sub_arctic.input.positional_policy_class

public class positional_policy_class
extends input_policy

This is the class that implements the positional input dispatch policy. This policy delivers inputs to objects "under" the position recorded in various input events.


Field Summary
protected static pick_collector _current_pick_list
          Current pick list.
protected static int _pick_valid_seq_num
          Event sequence number for which the pick collection is valid
 
Fields inherited from class sub_arctic.input.input_policy
_agent_list
 
Constructor Summary
positional_policy_class()
          Construct a positional policy.
 
Method Summary
static pick_collector current_pick_list(event picked_by_event)
          Get an up to date pick list for objects picked by the given event (which is assumed to be the "current" event in unmodified form).
 boolean dispatch_event(event evt)
          This is called by the event dispatch infrastructure to tell this policy to handle an event.
 
Methods inherited from class sub_arctic.input.input_policy
add_agent_after, add_agent_before, agent, num_agents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_current_pick_list

protected static pick_collector _current_pick_list
Current pick list. This may get shared by several policies. Policies which use pick should all call current_pick_list() to get access to an up to date copy.

_pick_valid_seq_num

protected static int _pick_valid_seq_num
Event sequence number for which the pick collection is valid
Constructor Detail

positional_policy_class

public positional_policy_class()
Construct a positional policy. User's shouldn't need to do this, it is done as part of toolkit initialization.
Method Detail

current_pick_list

public static pick_collector current_pick_list(event picked_by_event)
Get an up to date pick list for objects picked by the given event (which is assumed to be the "current" event in unmodified form). The resulting list should be treated as read-only. Note that the pick list is cached and reused for all requests that occur until the next event is dispatched by the system as a whole (i.e., until manager.event_seq_num() changes).
Parameters:
event - picked_by_event the event to return the pick_list for
Returns:
pick_collector the pick collector whose contents are those picked by the event

dispatch_event

public boolean dispatch_event(event evt)
This is called by the event dispatch infrastructure to tell this policy to handle an event.
Parameters:
event - evt the event to dispatch
Returns:
boolean the policy returns true if it dispatches the event
Overrides:
dispatch_event in class input_policy