sub_arctic.input
Interface does_callback

All Known Implementing Classes:
GrowDragContainer, multi_button, multilist, multilist_list, rgb_color_picker, simple_color_picker, h_slider, drag_container, sliding_text, h_range_slider, press_label, backdrop_drag_container, v_slider, listbox, v_range_slider, anim_mover_container, menu, multi_button, v_slider

public abstract interface does_callback

Interface for objects that support standard callbacks. This interface defines methods for seting and retrieving the callback object, for querying the interactor about the callbacks it supports, and for invoking a callback from the object.

Note that a default implementation of this interface is provided in base_interactor. However, storage for callbacks is not provided by base_interactor. So, for full callback functionallity, some or all of the methods declared here will need to be implemented in various subclasses.

See Also:
callback_object

Method Summary
 callback_object callback_obj()
          Return the callback object associated with this object (or null if there is none).
 void do_callback(event evt)
          Perform the default callback action for this object.
 void do_callback(event evt, int callback_num, java.lang.Object callback_info)
          Perform a callback from this object, passing the given parameters as part of the callback parameters.
 int first_callback_num()
          Indicate the first callback number used by this interactor.
 int last_callback_num()
          Indicate the last callback number used by this interactor.
 void set_callback_obj(callback_object callbk)
          Set the callback object associated with this object (use null if there should be no callbacks).
 

Method Detail

callback_obj

public callback_object callback_obj()
Return the callback object associated with this object (or null if there is none). This object may be sent the message "callback()" in response to actions performed on this interactor.
Returns:
callback_object the object to which callbacks from this interactor are made.
See Also:
sub_arctic.lib.input#callback_object

set_callback_obj

public void set_callback_obj(callback_object callbk)
Set the callback object associated with this object (use null if there should be no callbacks). This object may be sent the message "callback()" in * response to future actions performed on this interactor.
Parameters:
callback_object - callbk the object to which callbacks from this interactor will be made.
See Also:
sub_arctic.lib.input#callback_object

first_callback_num

public int first_callback_num()
Indicate the first callback number used by this interactor. This is typically 0. (Callback numbers are passed as the the 3rd parameter to callback() messages.)
Returns:
int the first valid callback number used by this object to make callbacks.
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. (Callback numbers are passed as the the 3rd parameter to callback() messages.)
Returns:
int the last valid callback number used by this object to make callbacks.
See Also:
sub_arctic.lib.input#callback_object

do_callback

public void do_callback(event evt)
Perform the default callback action for this object. This should invoke the callback corresponding to the primary or most common action associated with this object. (If possible this should be the action whose callback number is first_callback_num(), since that is used as a default in base_interactor.) The event passed here is the one which should be considered to have "caused" the input. However, the object is allowed to modifify (a copy of) this event before passing it on in order to make it meet preconditions necessary for proper operation. For example, button objects might force the x,y position of the event to be within their bounds.
Parameters:
event - evt the event which "caused" the callback.

do_callback

public void do_callback(event evt,
                        int callback_num,
                        java.lang.Object callback_info)
Perform a callback from this object, passing the given parameters as part of the callback parameters. The event passed here is the one which should be considered to have "caused" the input. However, the object is allowed to modifify (a copy of) this event before passing it on in order to make it meet preconditions necessary for proper operation. For example, button objects might force the x,y position of the event to be within their bounds. Type checking should be performed to ensure that the callback_num given is within range for this interactor, and that the callback_info object (if any) is of the proper type for the callback.
Parameters:
event - evt the event which "caused" the callback.
int - callback_num which callback type this is.
Object - callback_info additional information about this callback (the exact type of this information is determined by the callback type).