|
|||||||||
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.menubar
This class implements a style-neutral menu bar. It should be able to handle mac, windoze, and motif/unix style menu bars, but not NextStep style.
Field Summary | |
protected boolean |
_current_is_left
This is a boolean which says if the selected item is in the right or the left hand set. |
protected int |
_currently_depressed
This is the number of the currently depressed item. |
protected loaded_image |
bar_image
Our current menubar image. |
protected java.util.Hashtable |
button_to_menu
This hashtable keeps track of the mapping from the menu items to the buttons on the menu. |
protected int |
cached_width
This is where we store the cached value of our width |
protected java.util.Vector |
left_hotspots
This is where we hold the hotspots for the menubar's left objects |
protected java.util.Vector |
left_images
Left hand set of images |
protected java.util.Vector |
left_items
Left hand set of items. |
protected java.util.Vector |
right_hotspots
This is where we hold the hotspots for the menubar's right objects |
protected java.util.Vector |
right_images
Right hand set of images |
protected java.util.Vector |
right_items
Right hand set of items. |
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 | |
menubar(java.util.Vector left,
java.util.Vector right,
int w)
Create a menubar from two Vectors of Strings. |
Method Summary | |
void |
associate_menu(java.lang.Object obj,
menu m)
Set the menu associated with a particular item (String or loaded_image). |
java.awt.Point |
compute_menu_location(java.awt.Rectangle r,
menu m)
This function computes the menu location given a hotspot rectangle in our coordinate system. |
void |
configure()
Configure the object to ensure it has its proper bounds and has declared all its damage. |
boolean |
current_is_left()
Retrieve a boolean indicating if the currently selected item is on the left. |
int |
currently_depressed()
Which item is currently depressed? This returns -1 if there is no currently depressed item. |
java.awt.Font |
derive_font(java.awt.Font f)
This function is called to derive the font from the default font. |
void |
draw_self_local(drawable d)
Draw the object on a given drawable. |
int |
intrinsic_constraints()
Indicate that we intrinsically constrain height. |
void |
menu_done()
This function gets called when the menubar's popped down menu gets finished. |
boolean |
menu_modify(int x,
int y,
event evt)
This function is called to alert the notifier that the interaction is now over their area. |
boolean |
press(event evt,
java.lang.Object user_info)
Dispatch mouse button press input to the object. |
boolean |
release(event evt,
java.lang.Object user_info)
Dispatch mouse button release to the object. |
void |
set_current_is_left(boolean n)
Set the flag indicating if the currently selected item is on the left. |
void |
set_currently_depressed(int i,
boolean t,
event evt)
Set the currently depressed item. |
void |
style_changed()
Make the menubar images, given a set of left and right objects. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected int cached_width
protected java.util.Vector left_hotspots
protected java.util.Vector right_hotspots
protected loaded_image bar_image
protected java.util.Hashtable button_to_menu
protected java.util.Vector left_items
protected java.util.Vector right_items
protected java.util.Vector left_images
protected java.util.Vector right_images
protected int _currently_depressed
protected boolean _current_is_left
Constructor Detail |
public menubar(java.util.Vector left, java.util.Vector right, int w)
Vector
- left the strings to start the menus with from the left.Vector
- right the strings to start the menus with from the right.int
- w width of the menu bar.Method Detail |
public int currently_depressed()
public void set_currently_depressed(int i, boolean t, event evt)
int
- i the item number you want depressed.boolean
- t true if the item is in the left hand set of objects.event
- evt the event which is causing this button to be depressed.public boolean current_is_left()
public void set_current_is_left(boolean n)
boolean
- n the new value.public java.awt.Font derive_font(java.awt.Font f)
Font
- f the default font.public void style_changed()
Vector
- left the array of strings or images for the left menusVector
- right the array of strings or images for the right menusint
- w the width of the barpublic void draw_self_local(drawable d)
drawable
- d the surface to draw onpublic int intrinsic_constraints()
public boolean press(event evt, java.lang.Object user_info)
event
- evt the event to dispatch.Object
- user_info the pick-time value.public boolean release(event evt, java.lang.Object user_info)
event
- evt the event to dispatch.Object
- user_info the pick-time value.public void associate_menu(java.lang.Object obj, menu m)
Object
- obj the menu item's string or image.menu
- m the menu to associate with that item.public java.awt.Point compute_menu_location(java.awt.Rectangle r, menu m)
Rectangle
- r the rectangle of the hotspot the user moused on.menu
- m the menu to pop up.public void menu_done()
public boolean menu_modify(int x, int y, event evt)
int
- x the x coordinate (in the notifiers coordinate system) of
the cursor.int
- y the y coordinate (in the notifiers coordinate system) of
the cursor.event
- evt the event we are testing.public void configure()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |