|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sub_arctic.lib.min_interactor | +--sub_arctic.lib.base_interactor | +--sub_arctic.lib.base_parent_interactor | +--sub_arctic.lib.column | +--sub_arctic.lib.menu
This class implements a columnar menu. It expects to popped up and down based on input from the menu_focus_agent. This object also holds the reference to the menu_focus_agent in a static variable.
You can put any interactor in this object as a child, but only things which are subclasses of menu_item will get the highlight behavior and get notified when they are selected. Thus it is useful to put labels or spacers in this object to decorate your menu.
Field Summary | |
protected callback_object |
_callback_obj
This holds the callback object. |
protected int |
_selected_item
Value, get & set functions for the selected item. |
static int |
MENU_SELECT_CALLBACK
Callback constant number for menu selection callback |
Fields inherited from class sub_arctic.lib.column |
_border,
_boxed,
_colors,
_interchild_space,
_layout_type,
_opaque,
_size_by_children,
CENTER_JUSTIFIED,
LEFT_JUSTIFIED,
RIGHT_JUSTIFIED |
Fields inherited from class sub_arctic.lib.base_interactor |
_child_index,
_child_list,
_clip_bounds,
_constraint_flags,
_enabled_constraint,
_flags,
_h,
_h_constraint,
_parent,
_part_a_constraint,
_part_b_constraint,
_user_data,
_visible_constraint,
_w,
_w_constraint,
_x,
_x_constraint,
_y,
_y_constraint,
default_child_hint |
Constructor Summary | |
menu()
Construct a menu. |
|
menu(callback_object co)
Construct a menu. |
|
menu(int x,
int y)
Construct a menu. |
|
menu(int x,
int y,
callback_object co)
Construct a menu. |
Method Summary | |
static menu_focus_agent |
agent()
Return the menu_focus_agent. |
callback_object |
callback_obj()
Get the value of the current callback object. |
static menu |
create_text_menu(java.lang.String[] value,
java.awt.Font f,
callback_object co)
This is a convenience function for creating a simple menu from text strings in some font. |
void |
draw_self_local(drawable d)
This is a special version of draw self local to allow us to give the object a raised look. |
int |
first_callback_num()
First valid callback number |
void |
focus_set_enter(event cause_evt,
focus_dispatch_agent of_agent,
java.lang.Object user_info)
This function gets called to inform you that you have been put into the focus set (in this case the menu_focus_agent is the agent whose set you are in). |
void |
focus_set_exit(event cause_evt,
focus_dispatch_agent of_agent,
java.lang.Object user_info)
This is called when the menu leaves the focus set. |
int |
last_callback_num()
Last valid callback number |
boolean |
menu_exit(event evt,
java.lang.Object user_info)
This gets called to tell us that the pointer has left us. |
boolean |
menu_feedback(event evt,
java.lang.Object user_info)
This function gets called during the process of the user dragging around on the menu. |
menu |
menu_generates_submenu(int local_x,
int local_y)
This gets called to ask us what child would result from this point. |
boolean |
menu_release(event evt,
java.lang.Object user_info)
This function gets called to inform you that the mouse button was released over your menu. |
int |
selected_item()
Return the currently selected item's number. |
void |
set_callback_obj(callback_object c)
Change the value of the current callback object. |
void |
set_selected_item(int v)
Change the currently selected item. |
Methods inherited from class sub_arctic.lib.column |
add_child,
border,
boxed,
colors,
insert_child,
interchild_space,
layout_type,
opaque,
remove_child,
remove_child,
set_border,
set_boxed,
set_child_constraints,
set_child,
set_colors,
set_interchild_space,
set_layout_type,
set_local_constraints,
set_opaque,
set_size_by_children,
size_by_children |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected callback_object _callback_obj
public static final int MENU_SELECT_CALLBACK
protected int _selected_item
Constructor Detail |
public menu(int x, int y)
int
- xv x position of this interactorint
- yv y position of this interactorpublic menu(int x, int y, callback_object co)
int
- xv x position of this interactorint
- yv y position of this interactorcallback_object
- co the object to send callbacks topublic menu(callback_object co)
callback_object
- co the object to send callbacks topublic menu()
Method Detail |
public callback_object callback_obj()
public void set_callback_obj(callback_object c)
callback_object
- c the new callback object.public boolean menu_feedback(event evt, java.lang.Object user_info)
event
- evt the event causing the feedback.Object
- user_info (not used) this is the object we passed to the
menu_focus_agent when we made ourselves the focus.public int first_callback_num()
public int last_callback_num()
public boolean menu_release(event evt, java.lang.Object user_info)
event
- evt the event which terminated the interactor
(probably a mouse up).Object
- user_info (not used) the object we passed to the
menu_focus_agent when we put ourselves into the
menu focus.public void focus_set_enter(event cause_evt, focus_dispatch_agent of_agent, java.lang.Object user_info)
event
- cause_event the event that caused you to enter the focus setfocus_dispatch_agent
- of_agent this is the agent whose set you have
been added to (we ignore this right
now).Object
- user_info the object you passed to the agent
when you asked to enter the set (we
ignore this right now).public void focus_set_exit(event cause_evt, focus_dispatch_agent of_agent, java.lang.Object user_info)
event
- cause_event the event that caused you to exit
the focus set.focus_dispatch_agent
- of_agent this is the agent whose set you
have just left (we ignore this
right now).Object
- user_info the object you passed to the agent
when you asked to enter the set
(we ignore this right now).public int selected_item()
public void set_selected_item(int v)
int
- v the new selected item (use -1 for no selected item)public static menu_focus_agent agent()
menu_focus_agent
- the system's menu_focus_agent.public boolean menu_exit(event evt, java.lang.Object user_info)
event
- evt the event that caused us to be exited (probably a
mouse movement).Object
- user_info the object you passed to the agent when you asked
to enter the set (we ignore this right now).public menu menu_generates_submenu(int local_x, int local_y)
int
- local_x the x coordinate in question in our coordinate systemint
- local_y the y coordinate in question in our coordinate systempublic void draw_self_local(drawable d)
drawable
- d the surface to draw on.public static menu create_text_menu(java.lang.String[] value, java.awt.Font f, callback_object co)
String[]
- value the array of strings to place on the menuFont
- f the font to build the menu items in (if you
pass null you will get the system default
font).callback_object
- co the object to send the callbacks to
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |