|
|||||||||
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.oneline_text_display | +--sub_arctic.lib.label | +--sub_arctic.lib.press_label
This is just a little object which makes labels have a callback and keep track of their state. Its useful in things like menus and what not when someone else needs to stay informed of state changes. This object sends a callback to its callback object with a boolean as the info indicating its new state.
This object allows its width to be anything the parent (or anyone else) wishes (unlike more traditional labels).
Field Summary | |
protected boolean |
_active
Keep track of the active state. |
protected callback_object |
_callback_obj
The object to whom we are sending our callback. |
static int |
LABEL_ACTION_CALLBACK
Callback number constant for callbeack when we are pressed. |
Fields inherited from class sub_arctic.lib.label |
_above_spacing,
_autosize,
_below_spacing,
_draw_colors,
_opaque |
Fields inherited from class sub_arctic.lib.oneline_text_display |
_colors,
_end_of_selection,
_font,
_h_spacing,
_metric,
_start_of_selection,
_text,
_v_spacing,
_x_adjust,
BOXED,
have_focus,
NO_SELECTION,
SELECT_END |
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 | |
press_label(java.lang.String s,
java.awt.Font f,
boolean opacity,
callback_object obj)
Construct a new press_label. |
Method Summary | |
boolean |
active()
Return whether the object is active or not. |
callback_object |
callback_obj()
Access the current callback object. |
int |
first_callback_num()
First valid callback number |
int |
intrinsic_constraints()
Fake out our superclass with a new implementation of intrinsic constraints which returns only a height constraint. |
void |
invert_active()
Make the active state the opposite of what it is now. |
int |
last_callback_num()
Last valid callback number |
boolean |
press(event evt,
java.lang.Object user_info)
Respond to the press method from the agent. |
boolean |
release(event evt,
java.lang.Object user_info)
Respond to the release method from the agent. |
void |
set_active(boolean b)
Set the active state to either true or false. |
void |
set_callback_obj(callback_object cb_obj)
Set the object we are making callbacks to. |
int |
string_width()
Respond to questions about how wide our string is. |
Methods inherited from class sub_arctic.lib.label |
above_spacing,
autosize,
below_spacing,
calculate_size,
draw_colors,
draw_self_local,
natural_size,
opaque,
set_above_spacing,
set_autosize,
set_below_spacing,
set_draw_colors,
set_font,
set_intrinsic_h,
set_opaque,
set_text |
Methods inherited from class sub_arctic.lib.oneline_text_display |
boxed,
colors,
end_of_selection,
ensure_inside,
font,
h_spacing,
set_boxed,
set_colors,
set_h_spacing,
set_selection,
set_v_spacing,
start_of_selection,
text,
v_spacing,
x_adjust |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected boolean _active
protected callback_object _callback_obj
public static final int LABEL_ACTION_CALLBACK
Constructor Detail |
public press_label(java.lang.String s, java.awt.Font f, boolean opacity, callback_object obj)
String
- s the string to display in the label.boolean
- opacity true if the object should be opaque (paint
its background).callback_object
- obj the object to send the callback's to.Method Detail |
public boolean active()
public void invert_active()
public void set_active(boolean b)
boolean
- b the new active statepublic callback_object callback_obj()
public void set_callback_obj(callback_object cb_obj)
callback_obj
- cb_obj the object we will make callbacks to.public int first_callback_num()
public int last_callback_num()
public boolean press(event evt, java.lang.Object user_info)
event
- evt the press event (usually mouse down).Object
- user_info the object passed the pick_collector at pick-time.public boolean release(event evt, java.lang.Object user_info)
event
- evt the press event (usually mouse up).Object
- user_info the object passed the pick_collector at pick-time.public int string_width()
public int intrinsic_constraints()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |