|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sub_arctic.input.dispatch_agent | +--sub_arctic.input.focus_dispatch_agent | +--sub_arctic.input.single_focus_agent | +--sub_arctic.input.move_drag_focus_agent
Focus agent that implements move-drag. Move drag is a drag designed for moving objects around and is the most sophisticated of the drag protocols. The move_drag protocol provides for drag_start(), drag_feedback(), and drag_end() methods. The parameters passed to these supply an x,y position in the parent's coordinate system which can be used to directly set the position of the object being dragged.
Move-drag also implements a filtering (or limiting) process based on feature points of an object. Each object implements a set of feature points that represent interesting locations within it (by default these include the four corners and the center, plus the point at which the object was "grabbed" at the beginning of the drag). Move_drag_filters objects can can be used to modify the set of point that a designated feature point passes through. This is most often used to limit the allowable drag locations. For example, to limit the drag of an object to stay within the bounds of its parent. Note: base_interactor implements move_drag_filter, so often objects act as their own drag filter. std_drag_filters provides a useful collection of filter functions for this purpose.
move_draggable
,
move_drag_filter
,
base_interactor.filter_pt(java.awt.Point, sub_arctic.lib.interactor, java.awt.Point)
,
std_drag_filters
Field Summary | |
protected int |
_drag_feature_point
Index of the feature point we are dragging based on. |
protected move_drag_filter |
_filter_obj
Object which acts as drag filter. |
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 |
grab_x
Grab x position (start position in local coordinates). |
protected int |
grab_y
Grab y position (start position in local coordinates). |
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 | |
move_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. |
int |
drag_feature_point()
Index of the feature point we are dragging based on. |
boolean |
event_is_useful(event evt)
Method to determine if this agent needs to see a given event. |
protected java.awt.Point |
filter_drag_pt(interactor for_obj,
java.awt.Point pt)
Filter a drag point. |
move_drag_filter |
filter_obj()
Object which acts as drag filter. |
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(). |
void |
set_drag_feature_point(int indx)
Set the index of the feature point we are dragging based on. |
void |
set_filter_obj(move_drag_filter fo)
Set the object which acts as drag filter. |
void |
set_focus_to(focusable to_obj,
event evt,
java.lang.Object user_info)
Override set_focus_to to record the focus object as the filter object. |
void |
set_focus_to(focusable to_obj,
move_drag_filter filt_obj,
event evt,
java.lang.Object user_info)
Version of set_focus_to which allows separate move_drag_filter object. |
void |
set_focus_to(focusable to_obj,
move_drag_filter filt_obj,
int f_pt,
event evt,
java.lang.Object user_info)
Version of set_focus_to which allows separate move_drag_filter object and feature point specification. |
Methods inherited from class sub_arctic.input.single_focus_agent |
add_to_focus,
clear_focus,
remove_from_focus |
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 |
protected java.lang.reflect.Method drag_start
protected java.lang.reflect.Method drag_feedback
protected java.lang.reflect.Method drag_end
protected int _drag_feature_point
interactor_consts
,
base_interactor.feature_point(int)
,
base_interactor.drag_feature_point()
protected move_drag_filter _filter_obj
drag_feature_point()
protected int start_x
protected int start_y
protected int grab_x
protected int grab_y
Constructor Detail |
public move_drag_focus_agent()
Method Detail |
public boolean allowable_focus(focusable candidate_obj)
candidate_obj
- the object we are deciding uponpublic boolean event_is_useful(event evt)
evt
- the event in questionpublic int drag_feature_point()
public void set_drag_feature_point(int indx)
indx
- the new feature point indexpublic move_drag_filter filter_obj()
public void set_filter_obj(move_drag_filter fo)
fo
- the new filter objectpublic void set_focus_to(focusable to_obj, event evt, java.lang.Object user_info)
to_obj
- the object which is the new drag focusevt
- the event which "caused" the focus to occuruser_info
- information that is to be passed to the object whenever
input is dispatched to itpublic void set_focus_to(focusable to_obj, move_drag_filter filt_obj, event evt, java.lang.Object user_info)
to_obj
- the object which is the new drag focusfilt_obj
- the filter to be applied to the dragevt
- the event which "caused" the focus to occuruser_info
- information that is to be passed to the object whenever
input is dispatched to itpublic void set_focus_to(focusable to_obj, move_drag_filter filt_obj, int f_pt, event evt, java.lang.Object user_info)
to_obj
- the object which is the new drag focusfilt_obj
- the filter to be applied to the dragf_pt
- the index of the feature point to be used for this dragevt
- the event which "caused" the focus to occuruser_info
- information that is to be passed to the object whenever
input is dispatched to itprotected java.awt.Point filter_drag_pt(interactor for_obj, java.awt.Point pt)
for_obj
- The object we are filtering the point forpt
- The actual point being filtered (in parent's coordinates)protected void inform_focus_enter(focusable obj, event evt, java.lang.Object user_info)
obj
- the object we are draggingevt
- the event that "caused" the start of drag (typically
a mouse button down event)user_info
- an uninterpreted object to be passed to the objectprotected void inform_focus_exit(focusable obj, event evt, java.lang.Object user_info)
obj
- the object we are draggingevt
- the event that "caused" the end of drag (typically
a mouse button up event)user_info
- an uninterpreted object to be passed to the objectpublic boolean dispatch_event(event evt, java.lang.Object user_info, interactor to_obj, int seq_num)
evt
- the event being dispatched (already approved by
event_is_useful())user_info
- an uninterpreted info object to be passed to the
dragged objectto_obj
- for focus agents this is always nullseq_num
- for focus agents this is ignored
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |