|
|||||||||
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.text_toggle_collection
This object builds a collection of labeled toggle switches. This useful when you want to create a set of exclusive or non-exclusive choices from a set of strings.
The reason the 0th child is special is that all other children get added to his group. Groups are circularly linked lists of toggles who need to be exclusive of each other. The functions which manipulate "groups" with respect to toggles are defined in the toggle class.
toggle
Field Summary | |
protected callback_object |
_callback_obj
The callback object to send callbacks to. |
protected java.util.Vector |
_data
vector of the strings for this collection |
protected static int |
_default_offset
How much space around the edges and between the items. |
protected int |
_fixed_width
This controls if you want a fixed width for the labels. |
protected java.awt.Font |
_font
This is where the font lives for drawing the labels. |
protected boolean |
_use_group
Use group tells the collection if its collection forms one group or not. |
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_toggle_collection(java.lang.String[] s,
boolean use_a_group,
int fw,
callback_object cb)
Build a new text/toggle collection object. |
Method Summary | |
callback_object |
callback_obj()
Access the object we send callbacks to. |
void |
clear_items()
Get rid of all items |
java.util.Vector |
data()
Access the vector of strings in this collection. |
protected static int |
default_offset()
Return the default distance around the edges of items. |
protected int |
fixed_width()
Get the width of all items in this collection. |
java.awt.Font |
font()
Return the font we are drawing labels in. |
protected toggle |
make_toggle(int i)
Make a toggle. |
java.lang.String |
nth_string(int n)
Get the String value for that an index. |
toggle |
nth_toggle(int n)
Indexing from 0, get the toggle associated with that index. |
void |
set_callback_obj(callback_object cb)
Modify the current callback object. |
void |
set_data(java.lang.String[] s)
Set the data in this collection to be (and its toggles to display) an array of strings. |
protected void |
set_fixed_width(int f)
Set the value of the width of all items in the collection. |
void |
set_font(java.awt.Font f)
Set the font to use for this collection. |
void |
set_item(int i,
java.lang.String s)
Set the ith item in the collection to display a certain string. |
protected void |
set_toggle_constraints(toggle t,
int i)
Put the constraints on for the the toggle. |
protected void |
set_use_group(boolean b)
Change the state of the use_group variable. |
protected boolean |
use_group()
Is the collection using a group (exclusive choices)? |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.util.Vector _data
protected callback_object _callback_obj
protected boolean _use_group
protected int _fixed_width
protected static int _default_offset
protected java.awt.Font _font
Constructor Detail |
public text_toggle_collection(java.lang.String[] s, boolean use_a_group, int fw, callback_object cb)
String[]
- s the initial set of strings to display.boolean
- use_a_group pass true here if you want the set of
toggles to be exclusive, pass false if
you want them to be non-exclusive.int
- fw the 'forced width' of the objects in
the collection in pixels (if you use
-1 the objects don't get forced to
particular width).callback_object
- cb the object you want callbacks
delivered to.Method Detail |
public java.util.Vector data()
public void set_data(java.lang.String[] s)
String[]
- s the array of strings you want the user to choose from.public callback_object callback_obj()
public void set_callback_obj(callback_object cb)
callback_object
- cb the new object to receive callbacks.public void clear_items()
protected boolean use_group()
protected void set_use_group(boolean b)
boolean
- b whether or not this collection should use a group or
not (if this is true, then choices are exclusive).protected int fixed_width()
protected void set_fixed_width(int f)
int
- f the new fixed width for this collection (use -1 for no fixed
width)protected toggle make_toggle(int i)
int
- i which toggle (which possible) you want this new toggle to bepublic void set_item(int i, java.lang.String s)
Items begin numbering at zero.
int
- i the number of the item you want to change.String
- s the new string to display.protected void set_toggle_constraints(toggle t, int i)
toggle
- t the toggle we are constraining.int
- i the position in the toggle of this collection.protected static int default_offset()
public toggle nth_toggle(int n)
int
- i the index in questionpublic java.lang.String nth_string(int n)
int
- i the index in questionpublic java.awt.Font font()
public void set_font(java.awt.Font f)
Font
- f the new font to draw the labels in
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |