sub_arctic.contrib
Class multilist

java.lang.Object
  |
  +--sub_arctic.lib.min_interactor
        |
        +--sub_arctic.lib.base_interactor
              |
              +--sub_arctic.contrib.multilist

public class multilist
extends base_interactor
implements callback_object, simple_press_draggable, does_callback

The multilist class manages a coordinated set of lists (specifically, multilist_list instances).


Field Summary
protected  callback_object cb
           
protected  boolean coord
           
static int DOUBLE_CLICK
          An item in the list has been double-clicked.
static int DRAG
          An item in the list has been dragged.
static int LIST_DRAG
          An entire list column is being dragged.
protected  java.util.Vector mlists
           
protected  int numlists
           
protected  listbox_v_scrollbar sb
           
protected  java.util.Vector seps
           
static int SINGLE_CLICK_FINAL
          An item in the list has a final single click received.
static int SINGLE_CLICK_PENDING
          An item in the list has a single click pending.
protected  int size
           
 
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
multilist(int x, int y, int w, int h, boolean coord, java.util.Vector mlists, callback_object cb)
          Construct a new multilist.
multilist(java.util.Vector mlists)
          Create a multilist from only a vector of multilist_lists.
 
Method Summary
 void add_list(multilist_list l)
           
 callback_object callback_obj()
           
 void callback(interactor from, event evt, int cbNum, java.lang.Object ui)
          This callback method collects callbacks from multllist_lists that don't have a "private" callback object set on them and forwards to our callback object.
 boolean drag_end(event evt, java.lang.Object ui)
          drag_end
 boolean drag_feedback(event evt, java.lang.Object ui)
          drag_feedback does nothing.
 boolean drag_start(event evt, java.lang.Object ui)
          Implements dragging of entire lists.
 int first_callback_num()
          Indicate the first callback number used by this interactor (in this case DOUBLE_CLICK).
 multilist_list first_list()
          Return the first multilist_list in the multilist.
 void insert_list_at(multilist_list l, int index)
           
 int last_callback_num()
          Indicate the last callback number used by this interactor (in this case LIST_DRAG).
 multilist_list last_list()
          Return the last multilist_list in the multilist.
 multilist_list listbox_at(int index)
          Return the multilist_list at the specified position.
static void main(java.lang.String[] argv)
           
 java.util.Enumeration multilists()
          Return an enumeration of all multilist_lists.
 int numlists()
          Return the number of multilists we're currently managing.
 void pick(int ptx, int pty, pick_collector pickList)
          We override pick because we want to see if a pick occurs on any of our titles.
 void remove_all_lists()
           
 void remove_list_at(int index)
           
 void remove_list(multilist_list l)
           
 void set_callback_obj(callback_object cb)
           
 void set_list_at(multilist_list l, int index)
          Replace the multilist_list at the specified index with the provided one.
 
Methods inherited from class sub_arctic.lib.base_interactor
active_constraints, add_child, add_user_datum, attach_dependent, bound, child_index, child, clear_child_list, clear_constraint_flag_bit, clear_flag_bit, configure, constraint_flag_is_set, constraint_flag_string, constraint_on, custom_fun1, custom_fun2, damage_fixed, damage_from_child, damage_self, damage_self, damage_self, damage_self, damage_self, detach_dependent, do_action, do_action, do_callback, do_callback, drag_feature_point, draw_children, draw_self_local, draw_self, enabled_constraint, enabled, enter_local_coordinates, eval_enabled, eval_h, eval_part_a, eval_part_b, eval_visible, eval_w, eval_x, eval_y, eval, exit_local_coords, feature_point_enabled, feature_point, filter_pt, find_child, fixed_children, flag_is_set, flag_string, focus_set_enter, focus_set_exit, get_awt_component, get_external_constraint, get_part, get_top_level, get_value, global_to_local, global_to_local, h_constraint, h, handle_cycle, inform_ood, insert_child, inside_bounds, into_local, into_local, into_parent, into_parent, intrinsic_constraints, is_constrained, local_to_global, local_to_global, mark_all_ood, mark_enabled_ood, mark_h_ood, mark_ood, mark_part_a_ood, mark_part_b_ood, mark_reparented_ood, mark_visible_ood, mark_w_ood, mark_x_ood, mark_y_ood, marked_ood, move_child_downward, move_child_downward, move_child_to_bottom, move_child_to_bottom, move_child_to_top, move_child_to_top, move_child_upward, move_child_upward, move_downward, move_to_bottom, move_to_top, move_upward, new_look_configure, next_sibling, num_actions, num_children, num_feature_points, ood_inform_all, parent, part_a_constraint, part_a, part_b_constraint, part_b, pick_within_children, picked_by, pos, prev_sibling, register_resource_names, remove_child, remove_child, remove_user_datum, restyle_look_resources, restyle, set_child_index, set_child, set_constraint_flag_bit, set_constraint_flag_bit, set_constraint, set_constraint, set_enabled_constraint, set_enabled_constraint, set_enabled_constraint, set_enabled, set_flag_bit, set_flag_bit, set_h_constraint, set_h_constraint, set_h_constraint, set_h, set_intrinsic_h, set_intrinsic_size, set_intrinsic_w, set_parent, set_part_a_constraint, set_part_a_constraint, set_part_a_constraint, set_part_a, set_part_b_constraint, set_part_b_constraint, set_part_b_constraint, set_part_b, set_pos, set_pos, set_raw_enabled, set_raw_h, set_raw_part_a, set_raw_part_b, set_raw_visible, set_raw_w, set_raw_x, set_raw_y, set_size, set_style_lock, set_user_info, set_visible_constraint, set_visible_constraint, set_visible_constraint, set_visible, set_w_constraint, set_w_constraint, set_w_constraint, set_w, set_x_constraint, set_x_constraint, set_x_constraint, set_x, set_y_constraint, set_y_constraint, set_y_constraint, set_y, setup_for_children, setup_for_children, setup_for_fixed_children, size, style_change_local, style_change, supports_children, tag_str, toString, traverse_and_collect_children, traverse_and_collect_parent, traverse_and_collect, trivial_reject, trivial_reject, user_data, user_info, value_ood, visible_constraint, visible, w_constraint, w, x_constraint, x_into_local, x_into_parent, x, y_constraint, y_into_local, y_into_parent, y
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DOUBLE_CLICK

public static final int DOUBLE_CLICK
An item in the list has been double-clicked. This is the same callback as listbox. DOUBLE_CLICK.

DRAG

public static final int DRAG
An item in the list has been dragged. This is the same callback as listbox.DRAG.

SINGLE_CLICK_PENDING

public static final int SINGLE_CLICK_PENDING
An item in the list has a single click pending. This is the same callback as listbox.SINGLE_CLICK_PENDING.

SINGLE_CLICK_FINAL

public static final int SINGLE_CLICK_FINAL
An item in the list has a final single click received. This is the same callback as listbox.SINGLE_CLICK_FINAL.

LIST_DRAG

public static final int LIST_DRAG
An entire list column is being dragged.

sb

protected listbox_v_scrollbar sb

numlists

protected int numlists

mlists

protected java.util.Vector mlists

seps

protected java.util.Vector seps

coord

protected boolean coord

size

protected int size

cb

protected callback_object cb
Constructor Detail

multilist

public multilist(int x,
                 int y,
                 int w,
                 int h,
                 boolean coord,
                 java.util.Vector mlists,
                 callback_object cb)
Construct a new multilist. This is the full constructor.
Parameters:
int - x Initial X position
int - y Initial Y position
int - w Initial width
int - h Initial height
boolean - coord Indicates whether the contained lists are "coordinated" or not. Coordinated means that selecting an item in one column causes the corresponding items in other columns to be selected. It also means that all lists must contain the same number of elements, and that they will be scrolled together. Non-coordinated multilists can contain lists of different numbers of elements and can be individually-selectable. The scrollbar will only control the first list though, so this is probably not what you want.
Vector - mlists A Vector of all of the multilist_lists that this multilist will contain.

multilist

public multilist(java.util.Vector mlists)
Create a multilist from only a vector of multilist_lists. The position and size of the multilist are all initialized to 0, so you should use constraints to control these. By default the multilist is coordinated.
Method Detail

first_callback_num

public int first_callback_num()
Indicate the first callback number used by this interactor (in this case DOUBLE_CLICK).
Specified by:
first_callback_num in interface does_callback
Returns:
int the first valid callback number used by this object to make callbacks.
Overrides:
first_callback_num in class base_interactor
See Also:
sub_arctic.lib.input#callback_object

last_callback_num

public int last_callback_num()
Indicate the last callback number used by this interactor (in this case LIST_DRAG).
Specified by:
last_callback_num in interface does_callback
Returns:
int the last valid callback number used by this object to make callbacks.
Overrides:
last_callback_num in class base_interactor
See Also:
sub_arctic.lib.input#callback_object

listbox_at

public multilist_list listbox_at(int index)
Return the multilist_list at the specified position.

numlists

public int numlists()
Return the number of multilists we're currently managing.

add_list

public void add_list(multilist_list l)

insert_list_at

public void insert_list_at(multilist_list l,
                           int index)

set_list_at

public void set_list_at(multilist_list l,
                        int index)
Replace the multilist_list at the specified index with the provided one. If we're coordinated, this list must contain the same number of elements as all other lists in the multilist.

remove_list

public void remove_list(multilist_list l)

remove_list_at

public void remove_list_at(int index)

remove_all_lists

public void remove_all_lists()

first_list

public multilist_list first_list()
Return the first multilist_list in the multilist.

last_list

public multilist_list last_list()
Return the last multilist_list in the multilist.

multilists

public java.util.Enumeration multilists()
Return an enumeration of all multilist_lists.

drag_start

public boolean drag_start(event evt,
                          java.lang.Object ui)
Implements dragging of entire lists. We expect our userInfo object to be an object_holder instance that contains the multilist_list being dragged. We create a new drag_icon from that interactor and set the focus to it.

drag_feedback

public boolean drag_feedback(event evt,
                             java.lang.Object ui)
drag_feedback does nothing.

drag_end

public boolean drag_end(event evt,
                        java.lang.Object ui)
drag_end

callback

public void callback(interactor from,
                     event evt,
                     int cbNum,
                     java.lang.Object ui)
This callback method collects callbacks from multllist_lists that don't have a "private" callback object set on them and forwards to our callback object. Also, for now, we handle list item (but not entire list) dragging here.
Specified by:
callback in interface callback_object

pick

public void pick(int ptx,
                 int pty,
                 pick_collector pickList)
We override pick because we want to see if a pick occurs on any of our titles. If it does we initiate a drag of an entire list. The pick's userInfo is set to the multilist_list that is picked.
Overrides:
pick in class base_interactor

callback_obj

public callback_object callback_obj()
Specified by:
callback_obj in interface does_callback
Overrides:
callback_obj in class base_interactor

set_callback_obj

public void set_callback_obj(callback_object cb)
Specified by:
set_callback_obj in interface does_callback
Overrides:
set_callback_obj in class base_interactor

main

public static void main(java.lang.String[] argv)