|
|||||||||
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.new_lib.multi_button | +--sub_arctic.new_lib.toggle
This class is a common superclass for checkbox and radio_button. Here in the base class we do nothing about the style system and how things look, but provide the common behavior.
Toggles may be put into groups in by selecting some toggle (some instance of this class or its subclasses) as the "leader" of the group. Having done this, you should create the leader object with no other toggle as its "group_with" parameter when you create it. When you create all the other members of the group however, they should be "linked" to the leader either by naming the leader in the constructor or by using the add_to_group_of with the leader as the "name" of the group. You can drop any items from the group by using the drop_from_group. A toggle may be in only one group at a time. If you drop the leader from a group, the remaining members stay in the group and "elect" a new leader (although it doesn't matter, since they are already in the group).
Frequently, people can use the text_toggle_collection object and get the behaviors they need for forming groups without understanding the above.
text_toggle_collection
,
checkbox
,
radio_button
Field Summary | |
protected toggle |
_group_link
Link for circular list of radio button group. |
Fields inherited from class sub_arctic.new_lib.multi_button |
_callback_obj,
_cur_state,
_in_transition,
_state_looks,
_transition_looks,
BUTTON_ACTION_CALLBACK |
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 | |
|
toggle(int x,
int y,
loaded_image[] st_looks,
loaded_image[] trans_looks,
toggle group_with,
callback_object call_obj)
Full constructor. |
protected |
toggle(int x,
int y,
toggle group_with,
callback_object call_obj)
Partial constructor for use by subclasses. |
|
toggle(loaded_image[] st_looks,
loaded_image[] trans_looks,
callback_object call_obj)
Constructor that defaults to a 0,0 position and no group. |
|
toggle(loaded_image[] st_looks,
loaded_image[] trans_looks,
toggle group_with,
callback_object call_obj)
Constructor that defaults to a 0,0 position. |
Method Summary | |
void |
add_to_group_of(toggle other)
Add us to the group the given toggle is in. |
void |
drop_from_group()
Drop us from our current group |
toggle |
group_link()
Link for circular list of radio button group. |
protected toggle |
group_prev()
Return the previous toggle in our circular group list. |
int |
next_state()
Override next_state to provide group behavior. |
void |
set_cur_state(int st)
Override set_cur_state to reset other group members (if any) if we are being set (put in state 1). |
Methods inherited from class sub_arctic.new_lib.multi_button |
calc_size,
callback_obj,
cur_state,
do_action,
do_callback,
draw_self_local,
find_current_style,
first_callback_num,
get_state_look,
get_transition_look,
inout_drag_end,
inout_drag_enter,
inout_drag_exit,
inout_drag_start,
intrinsic_constraints,
last_callback_num,
new_look_configure,
part_a,
press,
release,
restyle_look_resources,
set_callback_obj,
set_looks,
set_part_a,
set_raw_part_a,
set_state_look,
set_transition_look,
state_looks,
transition_looks |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected toggle _group_link
Constructor Detail |
public toggle(int x, int y, loaded_image[] st_looks, loaded_image[] trans_looks, toggle group_with, callback_object call_obj)
int
- x x position of the toggle.int
- y y position of the toggle.loaded_image[]
- st_looks set of images for normal looks.loaded_image[]
- trans_looks set of images for looks during
transitions between states (can be
null to denote not special transition
appearances).toggle
- group_with toggle to group this with to get
radio_button semantics (or null for
no grouping).callback_object
- call_obj object that gets callbacks about
state changes.public toggle(loaded_image[] st_looks, loaded_image[] trans_looks, toggle group_with, callback_object call_obj)
loaded_image[]
- st_looks set of images for normal looks.loaded_image[]
- trans_looks set of images for looks during
transitions between states (can be
null to denote not special transition
appearances).toggle
- group_with toggle to group this with to get
radio_button semantics (or null for
no grouping).callback_object
- call_obj object that gets callbacks about
state changes.public toggle(loaded_image[] st_looks, loaded_image[] trans_looks, callback_object call_obj)
loaded_image[]
- st_looks set of images for normal looks.loaded_image[]
- trans_looks set of images for looks during
transitions between states (can be
null to denote not special transition
appearances).callback_object
- call_obj object that gets callbacks about
state changes.protected toggle(int x, int y, toggle group_with, callback_object call_obj)
int
- x x position of the toggle.int
- y y position of the toggle.loaded_image[]
- st_looks set of images for normal looks.loaded_image[]
- trans_looks set of images for looks during
transitions between states (can be
null to denote not special transition
appearances).toggle
- group_with toggle to group this with to get
radio_button semantics (or null for
no grouping).callback_object
- call_obj object that gets callbacks about
state changes.Method Detail |
public toggle group_link()
public void set_cur_state(int st)
int
- st new state.public int next_state()
protected toggle group_prev()
public void drop_from_group()
public void add_to_group_of(toggle other)
toggle
- other the toggle whose group we are joining.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |