|
|||||||||
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.text_list_element
This class implements a list item which can display a text string. It is basically a label which knows how to change its display based being selected.
Field Summary | |
protected boolean |
_focus
This variable holds our state of focusedness. |
protected boolean |
_highlighted
We store whether we are highlighted or not. |
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 | |
text_list_element(java.lang.String text)
Create a text_list_element with a string. |
|
text_list_element(java.lang.String text,
java.awt.Font font)
Create a text_list_element with a string & a font. |
Method Summary | |
void |
become_focus()
This method is used to inform the object that it has become the focus of a listbox. |
java.lang.Object |
convert_to_object()
Return the convenient representation of this object. |
void |
draw_self_local(drawable d)
Draw this object on the drawable provided. |
boolean |
focused()
This method is used to query the object about whether or not it is the focus. |
void |
highlight()
Implement the highlight behavior for this list element. |
boolean |
highlighted()
Return if the object is highlighted right now. |
void |
lost_focus()
This method is used to inform the object that it is not the focus any longer. |
static java.util.Vector |
make_contents_vector(java.lang.String[] contents,
java.awt.Font font)
This static function is a convenience for creating a Vector text_list_elements from an array of strings. |
static java.util.Vector |
make_contents_vector(java.util.Vector contents,
java.awt.Font font)
This static function is a convenience for creating a Vector text_list_elements from a Vector of strings. |
int |
preferred_width()
Compute the preferred width for the parent. |
void |
unhighlight()
Implement the unhighlight behavior for this list element. |
Methods inherited from class sub_arctic.lib.label |
above_spacing,
autosize,
below_spacing,
calculate_size,
draw_colors,
intrinsic_constraints,
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 _highlighted
protected boolean _focus
Constructor Detail |
public text_list_element(java.lang.String text)
String
- text the text display.public text_list_element(java.lang.String text, java.awt.Font font)
String
- text the text display.Font
- font the font to use (or null for the system default font).Method Detail |
public void highlight()
public void unhighlight()
public java.lang.Object convert_to_object()
This is a convenient way to use subclassing with listboxes. If you return an object of your own from this method, you will receive it when you ask for listbox contents or selected sets. This lets you easily get at application semantics in your code when using listboxes that display "strings". E.g. if you are displaying a list of filenames in the listbox, you might want to return File objects from this method so when the user selects a file, you won't have to go looking for that File object again.
public void draw_self_local(drawable d)
drawable
- d the drawable to draw on.public boolean highlighted()
public static java.util.Vector make_contents_vector(java.lang.String[] contents, java.awt.Font font)
String[]
- contents the strings to make elements out of.Font
- font the font to use (or pass null for a default font).public static java.util.Vector make_contents_vector(java.util.Vector contents, java.awt.Font font)
Vector
- contents the strings to make elements out of.Font
- font the font to use (or pass null for a default font).public int preferred_width()
public void become_focus()
public void lost_focus()
public boolean focused()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |