|
GLG Toolkit, Java Class Library
Version 4.6
|
Functions | |
| Object | AddListener (int listener_type, Object listener) |
| Adds an event listener to the bean. More... | |
| void | HCallback (GlgObject viewport) |
| H callback. More... | |
| void | HierarchyCallback (GlgObject top_viewport, GlgHierarchyData hierarchy_info) |
| Hierarchy callback. More... | |
| void | InputCallback (GlgObject vp, GlgObject message_obj) |
| Input callback. More... | |
| void | ReadyCallback (GlgObject viewport) |
| Ready callback. More... | |
| void | SelectCallback (GlgObject vp, Object[] name_array, int button) |
| Select callback. More... | |
| void | Trace2Callback (GlgObject top_viewport, GlgTraceData trace_info) |
| This method is invoked to handle any events in the bean's drawing and may be overridden by bean's subclasses to implement custom event handling logic. More... | |
| void | TraceCallback (GlgObject top_viewport, GlgTraceData trace_info) |
| Trace callback. More... | |
| void | VCallback (GlgObject viewport) |
| V callback. More... | |
| Object AddListener | ( | int | listener_type, |
| Object | listener | ||
| ) |
Adds an event listener to the bean.
Only a single event listener for each listener type is enabled. Setting a new event listener overrides any previous settings. Hierarchy listener must be attached before loading the bean's drawing.
By default, the bean itself is used as a listener for all GLG events; adding a listener disables the corresponding event-handling callback of the bean (for example, adding the INPUT_CB listener disables the bean's InputCallback). Therefore, the application must use only one type of the event handling: either a bean's callback or a listener.
The bean's callback method is usually used for applications which subclass the bean to provide different event-handling functionality for derived classes.
| listener_type | The type of listener to add. May be one of the following: |
| listener | The listener to be added. Must implement one of the following interfaces that match the listener_type parameter:
A null value may be used to remove a listener for the events specified by the listener_type parameter. |
| void HCallback | ( | GlgObject | viewport | ) |
H callback.
This method is invoked after the bean's drawing has been loaded, but before its object hierarchy has been setup.
The method can be used for setting initial parameters of the loaded drawing before its hierarchy has been setup.
| viewport | The top viewport object of the bean's drawing. |
Implements GlgHListener.
| void HierarchyCallback | ( | GlgObject | top_viewport, |
| GlgHierarchyData | hierarchy_info | ||
| ) |
Hierarchy callback.
is used to get access to the drawing to be displayed in the SubWindow and SubDrawing objects before the drawing is displayed.
This method is invoked when a SubWindow object in the bean's drawing loads its template drawing, or when a SubDrawing loads its template. The method is invokes several times at different stages of the template setup and may used to configure the SubWindow and SubDrawing instances before they are displayed.
The method may be overridden by bean's subclasses to implement custom instance setup logic.
A Hierarchy listener can be added using AddListener as an alternative to subclassing.
| top_viewport | The top-level viewport object. |
| hierarchy_info | GlgHierarchyData object containing information about the subdrawing that triggered the callback. See GlgHierarchyData for more information. |
The method is invoked with the same parameters as the HierarchyCallback method of GlgHierarchyListener. See HierarchyCallback for more information.
Implements GlgHierarchyListener.
Input callback.
This method is invoked to handle user interaction with input objects, as well as to perform object selection and action processing, and may be overridden by bean's subclasses to implement custom interaction logic.
An Input listener can be added using AddListener as an alternative to subclassing.
| vp | The top-level viewport object. |
| message_obj | Message object containing input event information. |
The method is invoked with the same parameters as the InputCallback method of GlgInputListener. See InputCallback for more information.
Implements GlgInputListener.
| void ReadyCallback | ( | GlgObject | viewport | ) |
Ready callback.
This method is invoked when the bean has finished initializing, loading and displaying its drawing. This method may be overridden by bean's subclasses to provide a custom bean initialization logic.
The IsReady method can also be used to query the bean's readiness.
| viewport | The top viewport object of the loaded drawing. |
Implements GlgReadyListener.
| void SelectCallback | ( | GlgObject | vp, |
| Object[] | name_array, | ||
| int | button | ||
| ) |
Select callback.
This method provides a simplified name-based interface to handle object selection. It is invoked when objects are selected with the mouse and may be overridden by bean's subclasses to implement custom selection logic.
A Select listener can be added using AddListener as an alternative to subclassing.
InputCallback provides an alternative callback that provides more elaborate selection information.
| vp | The top-level viewport object. |
| name_array | A null-terminated list of names of all named objects selected with the mouse, or null if no objects were selected. |
| button | The mouse button that was pressed to select objects. |
The method is invoked with the same parameters as the SelectCallback method of GlgSelectListener. See SelectCallback for more information.
Implements GlgSelectListener.
| void Trace2Callback | ( | GlgObject | top_viewport, |
| GlgTraceData | trace_info | ||
| ) |
This method is invoked to handle any events in the bean's drawing and may be overridden by bean's subclasses to implement custom event handling logic.
The method is similar to the TraceCallback, but is invoked after the event has been processed.
A Trace2 listener can be added using AddListener as an alternative to subclassing.
| top_viewport | The top-level viewport object. |
| trace_info | A GlgTraceData object containing detailed event information. See GlgTraceData for more information. |
The method is invoked with the same parameters as the TraceCallback method of GlgTraceListener. See TraceCallback for more information.
| void TraceCallback | ( | GlgObject | top_viewport, |
| GlgTraceData | trace_info | ||
| ) |
Trace callback.
This method is invoked to handle any events in the bean's drawing and may be overridden by bean's subclasses to implement custom event handling logic. The method is invoked before the event has been processed.
A Trace listener can be added using AddListener as an alternative to subclassing.
| top_viewport | The top-level viewport object. |
| trace_info | A GlgTraceData object containing detailed event information. See GlgTraceData for more information. |
The method is invoked with the same parameters as the TraceCallback method of GlgTraceListener. See TraceCallback for more information.
Implements GlgTraceListener.
| void VCallback | ( | GlgObject | viewport | ) |
V callback.
This method is invoked after the object hierarchy of the bean's drawing has been setup.
The method can be used for setting initial parameters of the loaded drawing after its hierarchy has been setup, but before the drawing is displayed.
| viewport | The top viewport object of the bean's drawing. |
Implements GlgVListener.