sub_arctic.input
Class simple_drag_focus_agent

java.lang.Object
  |
  +--sub_arctic.input.dispatch_agent
        |
        +--sub_arctic.input.focus_dispatch_agent
              |
              +--sub_arctic.input.single_focus_agent
                    |
                    +--sub_arctic.input.simple_drag_focus_agent

public class simple_drag_focus_agent
extends single_focus_agent

Focus dispatch agent for misc. dragging. This agent dispatches under the simple_drag input protocol which is designed for generic dragging (i.e., anything not handled by one of the more specifically targeted drag protocols). Its particularly suitable for dragging components that are inside the object itself (such as the thumb of a slider).


Field Summary
protected  java.lang.reflect.Method drag_end
          Hold a reference to the Method for drag_end
protected  java.lang.reflect.Method drag_feedback
          Hold a reference to the Method for drag_feedback
protected  java.lang.reflect.Method drag_start
          Hold a reference to the Method for drag_start
 
Fields inherited from class sub_arctic.input.focus_dispatch_agent
_focus_set, _user_info_set
 
Constructor Summary
simple_drag_focus_agent()
          Simple constructor.
 
Method Summary
 boolean allowable_focus(focusable candidate_obj)
          Indicate if the given object is suitable for inclusion in the focus set of this object.
 boolean dispatch_event(event evt, java.lang.Object user_info, interactor to_obj, int seq_num)
          Attempt to dispatch an event via this agent.
 boolean event_is_useful(event evt)
          Indicate if the given event should be passed to this agent.
protected  void inform_focus_enter(focusable obj, event evt, java.lang.Object user_info)
          Do the work needed when an object goes in the focus set.
protected  void inform_focus_exit(focusable obj, event evt, java.lang.Object user_info)
          Do the work needed when an object comes out of the focus set.
 
Methods inherited from class sub_arctic.input.single_focus_agent
add_to_focus, clear_focus, remove_from_focus, set_focus_to
 
Methods inherited from class sub_arctic.input.focus_dispatch_agent
focus_item, focus_set_size, is_in_focus, user_info_item
 
Methods inherited from class sub_arctic.input.dispatch_agent
after_dispatch_notify, dispatch_unused_event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

drag_start

protected java.lang.reflect.Method drag_start
Hold a reference to the Method for drag_start

drag_feedback

protected java.lang.reflect.Method drag_feedback
Hold a reference to the Method for drag_feedback

drag_end

protected java.lang.reflect.Method drag_end
Hold a reference to the Method for drag_end
Constructor Detail

simple_drag_focus_agent

public simple_drag_focus_agent()
Simple constructor.
Method Detail

allowable_focus

public boolean allowable_focus(focusable candidate_obj)
Indicate if the given object is suitable for inclusion in the focus set of this object. In this case the object must be a simple_draggable.
Parameters:
focusable - candidate_obj the object we are testing suitability for.
Returns:
boolean indicating whether the object is suitable.
Overrides:
allowable_focus in class focus_dispatch_agent

event_is_useful

public boolean event_is_useful(event evt)
Indicate if the given event should be passed to this agent. In this case we are interested in MOUSE_DRAGGED, MOUSE_MOVED, or MOUSE_RELEASED events.
Parameters:
event - evt the event we are testing.
Returns:
boolean indicating whether we want this event.
Overrides:
event_is_useful in class dispatch_agent

inform_focus_enter

protected void inform_focus_enter(focusable obj,
                                  event evt,
                                  java.lang.Object user_info)
Do the work needed when an object goes in the focus set. In this case we send the object a drag_start().
Parameters:
focusable - obj the object entering the focus set.
event - evt the event "causing" that entry.
Object - user_info the user info that should be sent to the object.
Overrides:
inform_focus_enter in class focus_dispatch_agent

inform_focus_exit

protected void inform_focus_exit(focusable obj,
                                 event evt,
                                 java.lang.Object user_info)
Do the work needed when an object comes out of the focus set. In this case we send the object an drag_end().
Parameters:
focusable - obj the object leaving the focus set.
event - evt the event "causing" that exit.
Object - user_info the user info that should be sent to the object.
Overrides:
inform_focus_exit in class focus_dispatch_agent

dispatch_event

public boolean dispatch_event(event evt,
                              java.lang.Object user_info,
                              interactor to_obj,
                              int seq_num)
Attempt to dispatch an event via this agent.
Parameters:
event - evt the event being dispatched.
Object - user_info ignored (because this is a focus agent).
interactor - to_obj ignored (because this is a focus agent).
int - seq_num ignored (because this is a focus agent).
Overrides:
dispatch_event in class focus_dispatch_agent