Chapter 8.
Methods


addPerspectiveListener()

This method adds a Perspective Listener. In the Java environment, a listener is an object that has defined the listener interface for a specific event (in this case, a Perspective event such as the user interface to the chart). See the perspectiveEvent() method later in this chapter for a list of events that are currently provided by Perspective to the listener interface. Also see Chapter 3 for an overview of how events are handled in the Perspective environment.

Syntax:

void addPerspectiveListener (TDGListener);

Input:

TDGListener: a listener object that has defined the listener interface

Return:

void;

Example:

See FullMetalListen in Appendix G

Also See:

perspectiveEvent(), removePerspectiveListener()

announceLicense()

This method directs the product licensing information to SysOut.

Syntax:

static void announceLicense ();

Input:

None

Return:

void;

Example:

perspective1.announceLicense();

askForRelease()

In some cases, not all of the memory associated with Perspective is reclaimed when the Perspective is no longer in use. Under these circumstances, you can give the Java garbage collector a better chance to do its job by calling askForRelease() immediately before setting the instance of Perspective to null.

Syntax:

void askForRelease();

Input:

None

Return:

void;

Example:

public void destroy()
{
    /* Called by the browser or applet viewer to
    inform this applet that it is being reclaimed
    and that it should destroy any resources that it
    has allocated. The stop method will always be
    called before destroy.
    */
    // remove references to m_Chart by its sub-objects
    m_Chart.askForRelease();
    remove(m_Chart);
    m_Chart = null;
    System.gc();// now ask for garbage collection
}