|
|||||||||
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.click_agent
A positional dispatch agent responsible for managing press/release, click, and double click interactions. This agent dispatches under three different input protocols: pressable (which does single presses and releases of a mouse button), clickable (which is a press and a release of a mouse button), and double_clickable (which is two rapid clicks in a small area). Note: that if the dispatch of a click is consumed, this resets the internal finite state controller and precludes delivery of a subsequent click as a double click. Similarly, if a press or release is consumed, those events will not form part of a click dispatch.
pressable
,
clickable
,
double_clickable
Field Summary | |
protected java.lang.reflect.Method |
click
The method object that represents click |
protected static int |
CLICK_CLOSE
Constant indicating how close together (in both x and y) events have to be to qualify as parts of the same click/double-click. |
protected java.lang.reflect.Method |
doubleclick
The method object that represents double click |
protected int |
first_x
X location of first press in sequence (in global coordinates). |
protected int |
first_y
Y location of first press in sequence (in global coordinates). |
protected int |
last_evt_seq
Sequence number of last event processed |
protected int |
last_press_release_anywhere
Sequence number of last press or release we monitored |
protected java.lang.reflect.Method |
press
The method object that represents press |
protected java.lang.reflect.Method |
release
The method object that represents release |
protected int |
state
State for finite state controller. |
Constructor Summary | |
click_agent()
Default constructor |
Method Summary | |
boolean |
dispatch_event(event evt,
java.lang.Object user_info,
interactor to_obj,
int seq_num)
Accept an event from the positional policy and attempt to dispatch it to an object. |
protected boolean |
do_dispatches(interactor to_obj,
event evt,
java.lang.Object user_info)
Attempt to perform event dispatch(es) to the given object, resetting the state to the start state when appropriate (see comments for make_transition). |
boolean |
event_is_useful(event evt)
We are only interested in press and release of the mouse button. |
void |
focus_set_enter(event evt,
focus_dispatch_agent agnt,
java.lang.Object user_info)
Part of protocol for click_tracking which we use to be informed about button presses or releases that occur and are consumed elsewhere. |
void |
focus_set_exit(event evt,
focus_dispatch_agent agnt,
java.lang.Object user_info)
Part of protocol for click_tracking which we use to be informed about button presses or releases that occur and are consumed elsewhere. |
protected void |
make_transition(event evt)
This method makes state transitions for a finite state machine controlling the interaction. |
protected boolean |
matches_first(event next_event)
Determine if event qualifies as close enough to match first event in a sequence. |
boolean |
track_click(event evt,
java.lang.Object user_info)
Track press and release events everywhere that are dispatched to us from the click_track monitoring agent. |
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 int state
protected int last_evt_seq
protected int last_press_release_anywhere
protected int first_x
protected int first_y
protected java.lang.reflect.Method press
protected java.lang.reflect.Method release
protected java.lang.reflect.Method click
protected java.lang.reflect.Method doubleclick
protected static final int CLICK_CLOSE
Constructor Detail |
public click_agent()
Method Detail |
public void focus_set_enter(event evt, focus_dispatch_agent agnt, java.lang.Object user_info)
public void focus_set_exit(event evt, focus_dispatch_agent agnt, java.lang.Object user_info)
public boolean event_is_useful(event evt)
event
- evt the event we are indicating interest or non-interest in.protected boolean matches_first(event next_event)
event
- next_event event whose position we are testingpublic boolean track_click(event evt, java.lang.Object user_info)
event
- evt the press or release event.Object
- user_info user_info associated with the even dispatch
(ignored here).protected void make_transition(event evt)
event
- evt the event potentially causing the transition.protected boolean do_dispatches(interactor to_obj, event evt, java.lang.Object user_info)
interactor
- to_obj the object we are trying to dispatch to.event
- evt the event to pass to the object.Object
- user_info uninterpreted user info to pass to the object.make_transition(sub_arctic.input.event)
public boolean dispatch_event(event evt, java.lang.Object user_info, interactor to_obj, int seq_num)
event
- evt the event being dispatched.Object
- user_info uninterpreted information to be passed to
the object.interactor
- to_obj the object we should attempt to dispatch to.int
- seq_num the sequence number of this event (so we can
tell if we have seen this before in a failed
attempt to dispatch it to another object).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |