|
|||||||||
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.navigation_agent
Focus based dispatch agent for catching keyboard based input and turning it into tree navigation input (under the navigable input protocol). This is driven from a table of key to action translations which define which keys do what (in terms calls under the dispatch protocol). A default table is provided, but this can be reset. Actions which can be listed in the table include:
To work properly this should sit in front of the text_acceptor agent so it gets first crack at text input.
sub_arctic.input.navigation_acceptor
Field Summary | |
protected int[] |
_action_table
The action table which controls translation from events to calls under the navigable protocol. |
protected static int[] |
_default_table
The default action table. |
protected boolean |
_in_text_mode
Are we currently in text entry mode |
static int |
DO_ACTION_0
Action code for "perform the primary action associated with location" |
static int |
DO_ACTION_1
Action code for "perform the secondary action associated with location" |
static int |
DO_ACTION_2
Action code for "perform the 3rd action associated with location" |
static int |
DO_ACTION_3
Action code for "perform the 4th action associated with location" |
protected java.lang.reflect.Method |
down
Hold a reference to the Method for down. |
static int |
END_TEXT_MODE
Action code for "end text entry mode" |
protected java.lang.reflect.Method |
enter_text
Hold a reference to the Method for entering text mode. |
protected java.lang.reflect.Method |
exit_text
Hold a reference to the Method for exiting text mode; |
static int |
LAST_VALID_ACTION_CODE
Last valid action code (valid codes run from 0 to this value) |
protected java.lang.reflect.Method |
left
Hold a reference to the Method for left; |
static int |
NAV_DOWN
Action code for "move down to the first child" |
static int |
NAV_LEFT
Action code for "move left to the previous sibling" |
static int |
NAV_RIGHT
Action code for "move right to the next sibling" |
static int |
NAV_TOP
Action code for "move to the top of the tree" |
static int |
NAV_UP
Action code for "move up one level in the tree" |
protected java.lang.reflect.Method |
perform_action
Hold a reference to the Method for performing actions. |
static int |
PREV_DOWN
Action code for "preview a move down" |
static int |
PREV_LEFT
Action code for "preview a move left" |
static int |
PREV_RIGHT
Action code for "preview a move right" |
static int |
PREV_TOP
Action code for "preview a move to the top of the tree" |
static int |
PREV_UP
Action code for "preview a move up" |
protected java.lang.reflect.Method |
preview_down
Hold a reference to the Method for preview_down. |
protected java.lang.reflect.Method |
preview_left
Hold a reference to the Method for preview_left; |
protected java.lang.reflect.Method |
preview_right
Hold a reference to the Method for preview_right. |
protected java.lang.reflect.Method |
preview_to_top
Hold a reference to the Method for preview_to_top. |
protected java.lang.reflect.Method |
preview_up
Hold a reference to the Method for previw_up. |
protected java.lang.reflect.Method |
right
Hold a reference to the Method for right. |
static int |
START_TEXT_MODE
Action code for "start text entry mode" |
protected java.lang.reflect.Method |
to_top
Hold a reference to the Method for to_top. |
protected java.lang.reflect.Method |
up
Hold a reference to the Method for up. |
Fields inherited from class sub_arctic.input.focus_dispatch_agent |
_focus_set,
_user_info_set |
Constructor Summary | |
navigation_agent()
Constructor that provides a default action table. |
|
navigation_agent(int[] action_tab)
Full constructor. |
Method Summary | |
int[] |
action_table()
The action table which controls translation from events to calls under the navigable protocol. |
boolean |
allowable_focus(focusable candidate_obj)
Indicate whether the given object is suitable to be our focus. |
boolean |
dispatch_event(event evt,
java.lang.Object user_info,
interactor to_obj,
int seq_num)
Attempt to dispatch the given event as text input. |
boolean |
event_is_useful(event evt)
Indicate if the given event is (possibly) wanted by this agent. |
void |
set_action_table(int[] new_tab)
Set the action table which controls translation from events to calls under the navigable protocol. |
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,
inform_focus_enter,
inform_focus_exit,
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 up
protected java.lang.reflect.Method down
protected java.lang.reflect.Method left
protected java.lang.reflect.Method right
protected java.lang.reflect.Method to_top
protected java.lang.reflect.Method preview_up
protected java.lang.reflect.Method preview_down
protected java.lang.reflect.Method preview_left
protected java.lang.reflect.Method preview_right
protected java.lang.reflect.Method preview_to_top
protected java.lang.reflect.Method enter_text
protected java.lang.reflect.Method exit_text
protected java.lang.reflect.Method perform_action
public static final int NAV_UP
public static final int NAV_DOWN
public static final int NAV_RIGHT
public static final int NAV_LEFT
public static final int NAV_TOP
public static final int PREV_UP
public static final int PREV_DOWN
public static final int PREV_RIGHT
public static final int PREV_LEFT
public static final int PREV_TOP
public static final int START_TEXT_MODE
public static final int END_TEXT_MODE
public static final int DO_ACTION_0
public static final int DO_ACTION_1
public static final int DO_ACTION_2
public static final int DO_ACTION_3
public static final int LAST_VALID_ACTION_CODE
protected static int[] _default_table
protected int[] _action_table
If this table is null, no events are accepted.
protected boolean _in_text_mode
Constructor Detail |
public navigation_agent(int[] action_tab)
int[]
- action_table an array containing sets of 5 integers. These
integers encode how keyboard (or other) input
is translated into calls in the navagable input
protocol. Each set of 5 integers includes:
code, key_code, character,
modifiers, and action. Where code
is an event code (typically KEY_PRESSED for
character, or MOUSE_PRESSED for a mouse button
down event), key_code is a value to match
against the key_code field of an event (or
VK_UNDEFINED if any value is ok), character
indicates an expected unicode character (or
CHAR_UNDEFINED if any character code is ok),
modifiers is zero or more of the values:
ALT_MASK, CTRL_MASK, META_MASK, or SHIFT_MASK
ORed together (matching events must
contain all the listed modifier bits), and
finally action is one of the action code
constants declared in this class. Note: the
table is searched in order, so if you have
overlapping but more specific entries (e.g.,
using the same key as another, but with a
modifier) the more specific entry must come
first.public navigation_agent()
_default_table
Method Detail |
public int[] action_table()
If this table is null, no events are accepted. If you need to change this array, be certain to pass it back to set_action_table() after the change in order to update internal bookkeeping.
public void set_action_table(int[] new_tab)
int[]
- the new action tableaction_table()
public boolean allowable_focus(focusable candidate_obj)
focusable
- candidate_obj the object being inquired about.public boolean event_is_useful(event evt)
event
- evt the event being inquired about.public boolean dispatch_event(event evt, java.lang.Object user_info, interactor to_obj, int seq_num)
event
- evt the event to dispatch.Object
- user_info ignored (since we are focus agent).interactor
- to_obj ignored (since we are focus agent).int
- seq_num ignored (since we are focus agent).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |