sub_arctic.lib
Class listbox

java.lang.Object
  |
  +--sub_arctic.lib.min_interactor
        |
        +--sub_arctic.lib.base_interactor
              |
              +--sub_arctic.lib.base_parent_interactor
                    |
                    +--sub_arctic.lib.listbox_display
                          |
                          +--sub_arctic.lib.listbox

public class listbox
extends listbox_display
implements simple_draggable, pressable, timer, does_callback

This class implements a style-nuetral listbox. This is the input behavior which is matched with the output behavior of listbox_display.

All callbacks pass the currently focused on object as their data to the callback. Summary of the callback behavior of this object:

SINGLE_CLICK_PENDING
This callback is sent when the mouse is first released from an object. This is the "early" callback which precedes either a SINGLE_CLICK_FINAL or DOUBLE_CLICK.
SINGLE_CLICK_FINAL
This is the callback that is sent when the listbox is sure that no double click will be forthcoming. This may be sent in response to a timeout, or may be sent immediately following the SINGLE_CLICK_PENDING in cases where a double click is not allowed.
DOUBLE_CLICK
This is sent when a double click is detected on a particular object. It will always be preceeded by a SINGLE_CLICK_PENDING callback.
DRAG
This message is sent when the user depresses the mouse on the focused object and then moves the mouse some number of pixels (default of 4 pixels). This message is only sent when you have previously called set_allow_dragging(true).


Field Summary
protected  boolean _allow_dragging
          This boolean should be set to true if you want your object to be able to drag objects out of its list.
protected  callback_object _callback_obj
          This is the callback object for this listbox.
protected  int _double_click_delay
          This is how many milliseconds to wait for a double click.
protected  int _double_click_loc
          This is what the user originally clicked on, thus where we want to check to see if they are if we get a fast second click.
protected  transition _double_click_trans
          This storage is used by the interactor to know if a double click might be coming.
protected  int _focused
          This value is the value of the currently focused on object.
protected  int _last_valid
          This variable is used to allow the system to know where the last valid object was before the user's mouse went "out of bounds."
protected  int _prev
          This is the index of the object we were over the last time we got any input during a drag sequence.
protected  boolean _single_selection
          This variable holds whether or not we are allowed to have multiple selections.
protected  int _start
          This object is the current "starting point" for a drag interactor.
protected  int _synch_mask
          This mask holds what the current set of synchronization constants are.
static int DOUBLE_CLICK
          This constant holds the callback number for double click.
static int DRAG
          This constant holds the callback number for a drag.
protected  int DRAG_DISTANCE
          This is the distance that the user must drag the focused object in either X or Y before the system will send a drag message.
protected  listbox next
          This variable determines who the next listbox is in the circularly linked list of listboxes we are synchronizing together.
static int SINGLE_CLICK_FINAL
          This constant holds the callback number for a a single click.
static int SINGLE_CLICK_PENDING
          This constant holds the callback number for a tentative first click action.
static int SYNCH_CONTENT
          This use of this constant means that listboxes in this group will have their content synchronized.
static int SYNCH_FOCUSED
          This use of this constant means that listboxes in this group will have their focused objects synchronized.
protected  boolean synch_in_progress
          This boolean is true when we are in the process of performing a synchronization activity.
static int SYNCH_SELECTION
          This use of this constant means that listboxes in this group will have their selections synchronized.
static int SYNCH_X_COORD
          This use of this constant means that listboxes in this group will have their displayed x coordinates synchronized.
static int SYNCH_Y_COORD
          This use of this constant means that listboxes in this group will have their displayed y coordinates synchronized.
 
Fields inherited from class sub_arctic.lib.listbox_display
_child_display, _display_parent, _external_h_scrollbar, _external_v_scrollbar, _horiz, _horiz_status, _vert, _vert_status, SCROLLBAR_ALWAYS, SCROLLBAR_AS_NECESSARY, SCROLLBAR_NEVER
 
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
listbox(int w, int h, boolean s, callback_object co)
          Construct a listbox of a given size.
 
Method Summary
 void add_to_group(listbox l)
          Add this listbox to a group of listboxes which have (possibly) synchronized input and output.
 boolean allow_dragging()
          Retreive the current state of draggability.
 callback_object callback_obj()
          Retreive the callback object for this listbox.
protected  void double_click_hook(event evt, java.lang.Object user_info)
          This function is called by the listbox if it detects a second click in a short period of time on the object just released on.
 boolean drag_end_multiple(event evt, java.lang.Object user_info)
          End a drag for a listbox which is in multiple selection mode.
 boolean drag_end_one(event evt, java.lang.Object user_info)
          End a drag for a listbox which is in single selection mode.
 boolean drag_end(event evt, java.lang.Object user_info)
          End a drag.
 boolean drag_feedback_multiple(event evt, java.lang.Object user_info)
          Continue a drag for a listbox which is in multiple selection mode.
 boolean drag_feedback_one(event evt, java.lang.Object user_info)
          Continue a drag for a listbox which is in single selection mode.
 boolean drag_feedback(event evt, java.lang.Object user_info)
          Continue a drag.
protected  void drag_hook(event evt, java.lang.Object user_info)
          This function is called by the listbox code when it detects that the currently focused item has been pressed on.
 boolean drag_ready(int local_x, int local_y)
          This function is called to determine if a drag is now beginning.
 boolean drag_start_multiple(event evt, java.lang.Object user_info)
          Start a drag for a listbox which is in multiple selection mode.
 boolean drag_start_one(event evt, java.lang.Object user_info)
          Start a drag for a listbox which is in single selection mode.
 boolean drag_start(event evt, java.lang.Object user_info)
          Start a drag.
protected  listbox find_sibling_of(listbox target)
          This is a utility function which finds the object in a linked list which points to some target listbox.
 int first_callback_num()
          First valid callback code
 list_element focused_raw()
          Return the currently focused on object as a list_element.
 java.lang.Object focused()
          Return the currently focused on object.
 int index_for_event(event evt)
          This function can derive an index position of a list_element from an event in this object's coordinate system.
 int last_callback_num()
          Last valid callback code
 void pick(int pt_x, int pt_y, pick_collector pick_list)
          We don't allow ourselves to ever be picked directly.
 boolean press(event evt, java.lang.Object user_info)
          Handle the mouse button being depressed on our area.
 boolean release(event evt, java.lang.Object user_info)
          Handle the mouse button being released on our area.
 void remove_from_group()
          This function will cause a listbox to be removed from the group it is currently in and return to its own group (of one).
 void set_allow_dragging(boolean a)
          Set the current state of dragging.
 void set_callback_obj(callback_object co)
          Set the callback object for this listbox.
 void set_contents(java.util.Vector contents)
          If the user is in the middle of a double click and the contents change we don't want the double click to happen.
 void set_focused(int indx)
          This function sets the focused on object to a given object index.
 void set_scrolled_x(int x)
          We override this function to allow synchronization of the listboxes.
 void set_scrolled_y(int y)
          We override this function to allow synchronization of the listboxes.
 void set_selected_by_index(java.util.Vector selected)
          We override this method to make sure that we keep the listbox selection state synchronized.
 void set_selected(java.util.Vector selected)
          We override the set selected method so we can synchronize listboxes.
 void set_single_selection(boolean s)
          This function changes the selection mode for this object.
 void set_synch_mask(int mask)
          Set the synchronization mask to a new value.
protected  void single_click_final_hook(event evt)
          This function is called when the listbox is sure that no further click is forthcoming and that the callback code for the SINGLE_CLICK_FINAL can be safely called. Most users shouldn't need to override this method, as they can put their code to handle the single click in the callback object. The object passed as the parameter to the callback function when this callback is run is the currently focused on object.
protected  void single_click_pending_hook(event evt)
          This function is called when the user clicks the mouse button on an item.
 boolean single_selection()
          Return whether or not we are only allowing single selections.
 int synch_mask()
          Retreive the current mask of synchronization values.
 void time_expired(event evt)
          This method gets called when the double click timer expires.
 java.lang.String toString()
          Generate a little different string for the listbox.
 
Methods inherited from class sub_arctic.lib.listbox_display
above_space, add_to_selected_set, below_space, callback, child_size_changed, clear_selected, clear, configure, contents_raw, contents, ensure_thumb_size, ensure_visible, have_v_scrollbar, horizontal_scrollbar, horizontal_status, index_for_screen_point, left_space, move_down, move_up, reconfigure_children, remove_from_selected_set, right_space, selected_set_raw, selected_set, set_above_space, set_below_space, set_external_h_scrollbar, set_external_v_scrollbar, set_horizontal_status, set_left_space, set_right_space, set_vertical_status, setup_children, vertical_scrollbar, vertical_status
 
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, 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, 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

SYNCH_CONTENT

public static final int SYNCH_CONTENT
This use of this constant means that listboxes in this group will have their content synchronized.

SYNCH_SELECTION

public static final int SYNCH_SELECTION
This use of this constant means that listboxes in this group will have their selections synchronized.

SYNCH_FOCUSED

public static final int SYNCH_FOCUSED
This use of this constant means that listboxes in this group will have their focused objects synchronized.

SYNCH_X_COORD

public static final int SYNCH_X_COORD
This use of this constant means that listboxes in this group will have their displayed x coordinates synchronized.

SYNCH_Y_COORD

public static final int SYNCH_Y_COORD
This use of this constant means that listboxes in this group will have their displayed y coordinates synchronized.

_synch_mask

protected int _synch_mask
This mask holds what the current set of synchronization constants are. This defaults to synchronizing the y coordinates, the selected set and the focused object; this set of synchronizations is good for viewing database records.

_single_selection

protected boolean _single_selection
This variable holds whether or not we are allowed to have multiple selections.

DOUBLE_CLICK

public static final int DOUBLE_CLICK
This constant holds the callback number for double click. When you get a double click callback the parameter passed to the callback function is the element which was double clicked on. It is returned via the convert_to_object() part of the list_element interface.

DRAG

public static final int DRAG
This constant holds the callback number for a drag. When you get a drag callback the parameter passed to the callback function is the element which was dragged. It is returned via the convert_to_object() part of the list_element interface.

SINGLE_CLICK_PENDING

public static final int SINGLE_CLICK_PENDING
This constant holds the callback number for a tentative first click action. When this callback is received, it may be the case that a double click will follow this callback. If no double click actually occurs, then a SINGLE_CLICK_FINAL call will be forthcoming.

The object passed to the callback function is the currently focused on item.


SINGLE_CLICK_FINAL

public static final int SINGLE_CLICK_FINAL
This constant holds the callback number for a a single click. When this call is made, there is no chance that a double click will result from this first click, thus actions which need to be sure that no double click can occur should handle this callback rather than SINGLE_CLICK_PENDING.

The object passed as the parameter to the callback function when this callback is run is the currently focused on object. The event field of the callback may be an animation event when this callback is run because this callback can be run not response to a user event, but rather a timeout.


_double_click_trans

protected transition _double_click_trans
This storage is used by the interactor to know if a double click might be coming. If this variable is null, there is no transition scheduled, and thus we are not waiting on a possible double click.

_double_click_delay

protected int _double_click_delay
This is how many milliseconds to wait for a double click.

_double_click_loc

protected int _double_click_loc
This is what the user originally clicked on, thus where we want to check to see if they are if we get a fast second click.

next

protected listbox next
This variable determines who the next listbox is in the circularly linked list of listboxes we are synchronizing together. If you don't use groups, this will always point to this object.

_focused

protected int _focused
This value is the value of the currently focused on object. This object may or may not be in the selected set.

DRAG_DISTANCE

protected int DRAG_DISTANCE
This is the distance that the user must drag the focused object in either X or Y before the system will send a drag message.

_callback_obj

protected callback_object _callback_obj
This is the callback object for this listbox.

_allow_dragging

protected boolean _allow_dragging
This boolean should be set to true if you want your object to be able to drag objects out of its list. This defaults to false.

_last_valid

protected int _last_valid
This variable is used to allow the system to know where the last valid object was before the user's mouse went "out of bounds."

_start

protected int _start
This object is the current "starting point" for a drag interactor. This start point is the one around which all drags occur; it is the balancing point for a drag. It is only valid during a drag and only when the selection mode allows multiple selections.

_prev

protected int _prev
This is the index of the object we were over the last time we got any input during a drag sequence. This value may be -1 if we weren't over any object before (we were out of bounds).

synch_in_progress

protected boolean synch_in_progress
This boolean is true when we are in the process of performing a synchronization activity. This prevents us from getting confused because of the circularly linked list.
Constructor Detail

listbox

public listbox(int w,
               int h,
               boolean s,
               callback_object co)
Construct a listbox of a given size. We default to always having a vertical scrollbar and never having a horizontal one.
Parameters:
int - w the width of the listbox in pixels
int - h the height of the listbox in pixels
boolean - s true if you want to allow only single selections
callback_object - co the callback object for this listbox
Method Detail

first_callback_num

public int first_callback_num()
First valid callback code
Specified by:
first_callback_num in interface does_callback
Overrides:
first_callback_num in class base_interactor

last_callback_num

public int last_callback_num()
Last valid callback code
Specified by:
last_callback_num in interface does_callback
Overrides:
last_callback_num in class base_interactor

single_selection

public boolean single_selection()
Return whether or not we are only allowing single selections.
Returns:
boolean true if this listbox will only allow single selections

set_single_selection

public void set_single_selection(boolean s)
This function changes the selection mode for this object. Calling this function will result in set of selections being cleared.
Parameters:
boolean - s true if you want to allow only single selections

callback_obj

public callback_object callback_obj()
Retreive the callback object for this listbox.
Specified by:
callback_obj in interface does_callback
Returns:
callback_object the object handling callbacks from this listbox
Overrides:
callback_obj in class base_interactor

set_callback_obj

public void set_callback_obj(callback_object co)
Set the callback object for this listbox.
Specified by:
set_callback_obj in interface does_callback
Parameters:
callback_object - co the new callback object
Overrides:
set_callback_obj in class base_interactor

allow_dragging

public boolean allow_dragging()
Retreive the current state of draggability. If this is true, then objects may be dragged out of this list.
Returns:
boolean true if objects may be dragged

set_allow_dragging

public void set_allow_dragging(boolean a)
Set the current state of dragging. If you set this to true, you should be prepared to receive DRAG callbacks and further you should act on them when they are received. In particular, you should remove this listbox from the focus set of the simple_drag_object.

Although we are allowing you to not really handle a drag from the list (based on some condition of your choosing), users may become confused when they attempt to change their selection in the listbox and nothing happens. This is because the state machine for doing selection is not "turned on" when the listbox is expecting you to respond to a DRAG callback.

Parameters:
boolean - a the new state of dragging

focused

public java.lang.Object focused()
Return the currently focused on object. This object may or may not be in the set of selected objects. This object will be returned to you via the "convert_to_object" method of the list element. You will get a value of null if no object currently is focused.
Returns:
int the index of the currently focused object

focused_raw

public list_element focused_raw()
Return the currently focused on object as a list_element. This object may or may not be in the set of selected objects. You will get a value of null if no object currently is focused.
Returns:
int the index of the currently focused object

set_focused

public void set_focused(int indx)
This function sets the focused on object to a given object index. If you give a bad index value, no object ends up being the focus.
Parameters:
int - indx the index of the object that you wish to become the focus

index_for_event

public int index_for_event(event evt)
This function can derive an index position of a list_element from an event in this object's coordinate system.
Parameters:
event - evt the event we are interested in
Returns:
int the index number of the element or -1 if not on any element

drag_start

public boolean drag_start(event evt,
                          java.lang.Object user_info)
Start a drag. This just sends the start drag message to one of the appropriate handlers for the selection mode this box is in.
Specified by:
drag_start in interface simple_draggable
Parameters:
event - evt the event in question
Object - user_info (not used)

drag_feedback

public boolean drag_feedback(event evt,
                             java.lang.Object user_info)
Continue a drag. This just sends the drag_feedback message to one of the appropriate handlers for the selection mode this box is in.
Specified by:
drag_feedback in interface simple_draggable
Parameters:
event - evt the event in question
Object - user_info (not used)

drag_end

public boolean drag_end(event evt,
                        java.lang.Object user_info)
End a drag. This just sends the drag_end message to one of the appropriate handlers for the selection mode this box is in.
Specified by:
drag_end in interface simple_draggable
Parameters:
event - evt the event in question
Object - user_info (not used)

drag_start_one

public boolean drag_start_one(event evt,
                              java.lang.Object user_info)
Start a drag for a listbox which is in single selection mode.
Parameters:
event - evt the event in question
Object - user_info (not used)

drag_feedback_one

public boolean drag_feedback_one(event evt,
                                 java.lang.Object user_info)
Continue a drag for a listbox which is in single selection mode.
Parameters:
event - evt the event in question
Object - user_info (not used)

drag_end_one

public boolean drag_end_one(event evt,
                            java.lang.Object user_info)
End a drag for a listbox which is in single selection mode.
Parameters:
event - evt the event in question
Object - user_info (not used)

drag_start_multiple

public boolean drag_start_multiple(event evt,
                                   java.lang.Object user_info)
Start a drag for a listbox which is in multiple selection mode.
Parameters:
event - evt the event in question
Object - user_info (not used)

drag_feedback_multiple

public boolean drag_feedback_multiple(event evt,
                                      java.lang.Object user_info)
Continue a drag for a listbox which is in multiple selection mode.
Parameters:
event - evt the event in question
Object - user_info (not used)

drag_end_multiple

public boolean drag_end_multiple(event evt,
                                 java.lang.Object user_info)
End a drag for a listbox which is in multiple selection mode.
Parameters:
event - evt the event in question
Object - user_info (not used)

press

public boolean press(event evt,
                     java.lang.Object user_info)
Handle the mouse button being depressed on our area.
Specified by:
press in interface pressable
Parameters:
event - evt the event in question
Object - user_info (not used)

release

public boolean release(event evt,
                       java.lang.Object user_info)
Handle the mouse button being released on our area. This never happens, as we use a focus based agent which short circuits the input.
Specified by:
release in interface pressable
Parameters:
event - evt the event in question
Object - user_info (not used)

pick

public void pick(int pt_x,
                 int pt_y,
                 pick_collector pick_list)
We don't allow ourselves to ever be picked directly. The listbox_helper object will put us in the pick list only in the case where the main display area was picked on.
Parameters:
int - pt_x the x coordinate of the point
int - pt_y the y coordinate of the point
pick_collector - the object to put yourself in if you are picked
Overrides:
pick in class base_interactor

toString

public java.lang.String toString()
Generate a little different string for the listbox.
Returns:
String a simple dump of this object
Overrides:
toString in class base_interactor

add_to_group

public void add_to_group(listbox l)
Add this listbox to a group of listboxes which have (possibly) synchronized input and output.
Parameters:
listbox - a listbox in the group you wish this listbox to be added to

find_sibling_of

protected listbox find_sibling_of(listbox target)
This is a utility function which finds the object in a linked list which points to some target listbox.
Parameters:
listbox - target the listbox whose sibling you want to find
Returns:
listbox the listbox that points to the target

remove_from_group

public void remove_from_group()
This function will cause a listbox to be removed from the group it is currently in and return to its own group (of one).

synch_mask

public int synch_mask()
Retreive the current mask of synchronization values.
Returns:
int a bitmask representing the state of the synchronization for this listbox

set_synch_mask

public void set_synch_mask(int mask)
Set the synchronization mask to a new value. You should OR together the set of flags that you want to be in the mask from the set of SYNCH_X_COORD, SYNCH_Y_COORD, SYNCH_FOCUSED, SYNCH_SELECTION, and SYNCH_CONTENT.
Parameters:
int - mask the new synchronization mask

set_selected

public void set_selected(java.util.Vector selected)
We override the set selected method so we can synchronize listboxes. Be that synchronized selected objects are synchronized in number not in content. If you want synchronized content you have to use SYNCH_CONTENT.
Parameters:
Vector - selected the objects which are now to be selected
Overrides:
set_selected in class listbox_display

set_selected_by_index

public void set_selected_by_index(java.util.Vector selected)
We override this method to make sure that we keep the listbox selection state synchronized.
Parameters:
Vector - selected a vector of Integer objects
Overrides:
set_selected_by_index in class listbox_display

set_scrolled_y

public void set_scrolled_y(int y)
We override this function to allow synchronization of the listboxes.
Parameters:
int - y the coordinate to display
Overrides:
set_scrolled_y in class listbox_display

set_scrolled_x

public void set_scrolled_x(int x)
We override this function to allow synchronization of the listboxes.
Parameters:
int - x the x coordinate to display
Overrides:
set_scrolled_x in class listbox_display

time_expired

public void time_expired(event evt)
This method gets called when the double click timer expires. This method clears the state variable so we know that subsequent clicks are not part of a double click. It also fires the callback to inform the userlevel code what happened.
Specified by:
time_expired in interface timer
Parameters:
event - e the animation event which caused time to expire

double_click_hook

protected void double_click_hook(event evt,
                                 java.lang.Object user_info)
This function is called by the listbox if it detects a second click in a short period of time on the object just released on.

The user should be aware that the default behavior of this code is to run a callback (DOUBLE_CLICK). If you override this method, you will not get the call to the callback unless you call super. Further, most users shouldn't need to override this as the can put their response in the callback object.

When you get a double click the parameter passed to the callback function is the element which was double clicked on. It is returned via the convert_to_object() part of the list_element interface.

Parameters:
event - evt the event in question
Object - user_info (not currently used)

drag_hook

protected void drag_hook(event evt,
                         java.lang.Object user_info)
This function is called by the listbox code when it detects that the currently focused item has been pressed on.

The user should be aware that the default behavior of this code is to run a callback (DRAG). If you override this method, you will not get the call to the callback unless you call super. Further, most users shouldn't need to override this as the can put their response in the callback object.

When you get a drag callback the parameter passed to the callback function is the element which was dragged. It is returned via the convert_to_object() part of the list_element interface.

Parameters:
event - evt the event in question
Object - user_info (not currently used)

set_contents

public void set_contents(java.util.Vector contents)
If the user is in the middle of a double click and the contents change we don't want the double click to happen.
Parameters:
Vector - contents the new contents of this object (all the objects in this vector must be list_elements)
Overrides:
set_contents in class listbox_display

single_click_final_hook

protected void single_click_final_hook(event evt)
This function is called when the listbox is sure that no further click is forthcoming and that the callback code for the SINGLE_CLICK_FINAL can be safely called.

Most users shouldn't need to override this method, as they can put their code to handle the single click in the callback object.

The object passed as the parameter to the callback function when this callback is run is the currently focused on object. The event field of the callback may be animation event if this callback is run in response to a timeout rather than a user input.

Parameters:
event - evt the event causing this hook to be run

single_click_pending_hook

protected void single_click_pending_hook(event evt)
This function is called when the user clicks the mouse button on an item. It is called at the time the user clicks, so there may be a double click coming down the pipe.

The parameter passed to callback function is the currently focused on item.


drag_ready

public boolean drag_ready(int local_x,
                          int local_y)
This function is called to determine if a drag is now beginning. It makes that determination based on how far the mouse has moved from the drag origin. It is called by the drag_feedback functions.
Parameters:
int - local_x current x coordinate
int - local_y current y coordinate