sub_arctic.input
Class grow_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.grow_drag_focus_agent

public class grow_drag_focus_agent
extends single_focus_agent

Focus agent that implements grow-drag. Grow_drag is a drag designed for changing the size objects. The grow_drag protocol provides for drag_start(), drag_feedback(), and drag_end() methods. The parameters passed to these supply an original size and a new size (based on movement horizontally and vertically away from the drag start point).

See Also:
grow_draggable

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
protected  int start_h
          Start height of the current drag
protected  int start_w
          Start width of the current drag
protected  int start_x
          Start x position of the current drag (in global coordinates)
protected  int start_y
          Start y position of the current drag (in global coordinates)
 
Fields inherited from class sub_arctic.input.focus_dispatch_agent
_focus_set, _user_info_set
 
Constructor Summary
grow_drag_focus_agent()
          Default constructor
 
Method Summary
 boolean allowable_focus(focusable candidate_obj)
          Method to limit the objects allowable as members of the focus set.
 boolean dispatch_event(event evt, java.lang.Object user_info, interactor to_obj, int seq_num)
          Dispatch an event under this protocol.
 boolean event_is_useful(event evt)
          Method to determine if this agent needs to see a given event.
protected  void inform_focus_enter(focusable obj, event evt, java.lang.Object user_info)
          Override the normal inform_focus_enter to deliver the drag_start().
protected  void inform_focus_exit(focusable obj, event evt, java.lang.Object user_info)
          Override the normal inform_focus_exit to deliver the drag_end().
 
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

start_w

protected int start_w
Start width of the current drag

start_h

protected int start_h
Start height of the current drag

start_x

protected int start_x
Start x position of the current drag (in global coordinates)

start_y

protected int start_y
Start y position of the current drag (in global coordinates)
Constructor Detail

grow_drag_focus_agent

public grow_drag_focus_agent()
Default constructor
Method Detail

allowable_focus

public boolean allowable_focus(focusable candidate_obj)
Method to limit the objects allowable as members of the focus set. In this case we only allow things which implement grow_draggable.
Parameters:
candidate_obj - the object we are deciding upon
Returns:
a boolean indicating if the object is acceptable
Overrides:
allowable_focus in class focus_dispatch_agent

event_is_useful

public boolean event_is_useful(event evt)
Method to determine if this agent needs to see a given event. In this case we are interested in MOUSE_DRAGGED, MOUSE_MOVED and MOUSE_RELEASED only.
Parameters:
evt - the event in question
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)
Override the normal inform_focus_enter to deliver the drag_start().
Parameters:
obj - the object we are dragging
evt - the event that "caused" the start of drag (typically a mouse button down event)
user_info - an uninterpreted object to be passed 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)
Override the normal inform_focus_exit to deliver the drag_end().
Parameters:
obj - the object we are dragging
evt - the event that "caused" the end of drag (typically a mouse button up event)
user_info - an uninterpreted object to be passed 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)
Dispatch an event under this protocol. This will send either a drag_feedback() or drag_end() to the object.
Parameters:
evt - the event being dispatched (already approved by event_is_useful())
user_info - an uninterpreted info object to be passed to the dragged object
to_obj - for focus agents this is always null
seq_num - for focus agents this is ignored
Returns:
value indicating if the event was consumed
Overrides:
dispatch_event in class focus_dispatch_agent