Class Application
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Application

public class netscape.application.Application
    extends java.lang.Object
    implements java.lang.Runnable,
               netscape.application.EventProcessor
{
    /* Fields
     */
    public final static int BOTTOM_LEFT_POSITION;  *Beta API*
    public final static int BOTTOM_RIGHT_POSITION;  *Beta API*
    public final static int TOP_LEFT_POSITION;  *Beta API*
    public final static int TOP_RIGHT_POSITION;  *Beta API*

    /* Constructors
     */
    public Application();
    public Application(Applet);

    /* Methods
     */
    public static Application application();
    public static String clipboardText(); *Beta API*
    public static String releaseName();
    public static void setClipboardText(String); *Beta API*

    public void addObserver(ApplicationObserver);
    public void appletStarted();
    public void appletStopped();
    public void chooseNextCurrentDocumentWindow(Window); *Beta API*
    public void cleanup();
    public java.net.URL codeBase();
    protected FoundationApplet createApplet();
    public Window currentDocumentWindow();
    public void didProcessEvent(Event);
    public EventLoop eventLoop();
    public Vector externalWindows();
    public void init();
    public boolean isApplet();
    public boolean isKeyboardUIEnabled(); *Beta API*
    public boolean isPaused();
    public boolean isRunning();
    public void keyDown(KeyEvent);
    public void keyUp(KeyEvent);
    public Point keyboardArrowHotSpot(int); *Beta API*
    public Image keyboardArrowImage(int); *Beta API*
    public Point keyboardArrowLocation(View, int); *Beta API*
    public int keyboardArrowPosition(View); *Beta API*
    public RootView mainRootView();
    public void makeCurrentDocumentWindow(Window); *Beta API*
    public String parameterNamed(String);
    public void performCommandAndWait(Target, String, Object);
    public void performCommandLater(Target, String, Object, boolean);
    public void performCommandLater(Target, String, Object);
    public void processEvent(Event);
    public void removeObserver(ApplicationObserver);
    public Vector rootViews();
    public void run();
    public void setKeyboardUIEnabled(boolean); *Beta API*
    public void setMainRootView(RootView);
    public void stopRunning();
    public void willProcessEvent(Event);
}
Object subclass that represents the overall IFC-based Java application. An Application instance maintains application-wide state and manages access to resources or objects that provide resources or services, such as RootViews.

Fields

TOP_LEFT_POSITION

  public final static int TOP_LEFT_POSITION
Arrow pointing to the selected view's top left corner

BOTTOM_LEFT_POSITION

  public final static int BOTTOM_LEFT_POSITION
Arrow pointing to the selected view's bottom left corner

TOP_RIGHT_POSITION

  public final static int TOP_RIGHT_POSITION
Arrow pointing to the selected view's top right corner

BOTTOM_RIGHT_POSITION

  public final static int BOTTOM_RIGHT_POSITION
Arrow pointing to the selected view's bottom right corner

Constructors

Application

  public Application()
Constructs an Application. The Application will not begin processing Events until it receives a run() message. You will almost never create an Application instance - the IFC machinery will create one for you.
See Also:
run

Application

  public Application(java.applet.Applet applet)
Constructs an Application for an existing Applet. You should only use this constructor when including IFC Views within an AWT-based component hierarchy. You must call run() on the returned Application for your Views to draw and receive events.
See Also:
FoundationPanel, run

Methods

releaseName

  public static String releaseName()

application

  public static Application application()
Returns the application instance.

init

  public void init()
Initializes the Application. Override to perform any initialization.

cleanup

  public void cleanup()
Called when the run loop has exited.

stopRunning

  public void stopRunning()
Destroys the Application, including all ExternalWindows. Stops the EventLoop and causes run() to return.

run

  public void run()
Starts the Application's EventLoop.

eventLoop

  public EventLoop eventLoop()
Returns the Application's EventLoop.
See Also:
EventLoop

isApplet

  public boolean isApplet()
Returns true if the Application was started as an Applet.

codeBase

  public java.net.URL codeBase()
Returns the Application's codebase, the URL where the Applet's class file originated.

parameterNamed

  public String parameterNamed(String name)
Returns the values for the parameter name.

mainRootView

  public RootView mainRootView()
Returns the Application's "main" RootView. In the case of an Applet, this method returns the RootView associated with the Applet. If not an Applet and never set by the Application, this method returns null.
See Also:
setMainRootView

setMainRootView

  public void setMainRootView(RootView view)
Sets the main RootView.
See Also:
mainRootView

rootViews

  public Vector rootViews()
Returns a Vector containing all the RootViews being displayed by the Application. This vector is for reading only - do not modify.

externalWindows

  public Vector externalWindows()
Returns a Vector containing all the ExternalWindows being displayed by the Application. This Vector is for reading only - do not modify.

willProcessEvent

  public void willProcessEvent(Event anEvent)
Called before the EventLoop processes anEvent. The default implementation does nothing.

didProcessEvent

  public void didProcessEvent(Event anEvent)
Called after the EventLoop has processed anEvent. The default implementation does nothing.

keyDown

  public void keyDown(KeyEvent event)
Subclassers can override to catch key down Events when there's no focused view. The default implementation handle keyboard UI. always call super if your application subclass is not processing the event.

keyUp

  public void keyUp(KeyEvent event)
Subclassers can override to catch key up Events when there's no focused view.The default implementation handle keyboard UI. always call super if your application subclass is not processing the event.

performCommandAndWait

  public void performCommandAndWait(Target target,
                                    String command,
                                    Object data)
Causes target to receive a performCommand() message with command and object, from the Application's main thread using the Application's EventLoop. This method will not return until the command has been performed. It can only be called from threads other than the main thread.
See Also:
eventLoop, mainThread

performCommandLater

  public void performCommandLater(Target target,
                                  String command,
                                  Object data,
                                  boolean ignorePrevious)
Causes target to receive a performCommand() message with command and object, after the current Event and others in the Application's EventLoop have been processed. If ignorePrevious is true, this method disposes of all pending requests with the same target and command.
See Also:
eventLoop

performCommandLater

  public void performCommandLater(Target target,
                                  String command,
                                  Object data)
Causes target to receive a performCommand() message with command and object, after the current Event and others in the Application's EventLoop have been processed. Equivalent to the code:
    performCommandLater(target, command, data, false)
See Also:
performCommandLater

createApplet

  protected FoundationApplet createApplet()
Creates and returns the Application's Applet. This method will only be called in a stand-alone application. Application subclasses can override this method to provide a custom subclass of FoundationApplet. This Applet must have been added to a java.awt.Frame and have an AppletStub.
See Also:
FoundationApplet, Frame, AppletStub

addObserver

  public void addObserver(ApplicationObserver observer)
Adds observer as an object that will receive notifications when the Application's running state changes. An observer might be interested in learning when the HTML page containing the Application is no longer visible, for example. See the ApplicationObserver interface for more information.
See Also:
ApplicationObserver, removeObserver

removeObserver

  public void removeObserver(ApplicationObserver observer)
Removes observer from the group of objects interested in notifications of changes in the Application's running state.
See Also:
addObserver

appletStarted

  public void appletStarted()
Called from an Applet's start() method. Notifies all ApplicationObservers that the Application has resumed. Normally called from FoundationApplet.

appletStopped

  public void appletStopped()
Called from an Applet's stop() method. Notifies all ApplicationObservers that the Application has paused. Normally called from FoundationApplet.

processEvent

  public void processEvent(Event event)
Processes Application-specific Events.

isRunning

  public boolean isRunning()
Returns true if the Application's EventLoop is currently running.

isPaused

  public boolean isPaused()
Returns true if the Application is currently paused. Applications pause when their Applet's HTML page becomes hidden.

makeCurrentDocumentWindow

  public void makeCurrentDocumentWindow(Window aWindow) *Beta API* 
Makes aWindow the current document for the application. aWindow should contain a document: isDocument should return true. If aWindow is null, the application will not have a current document.

currentDocumentWindow

  public Window currentDocumentWindow()
Return the current document window. Return null if there is no current document window

chooseNextCurrentDocumentWindow

  public void chooseNextCurrentDocumentWindow(Window aWindow) *Beta API* 
Find and make a new window the current document. The new window should be different than aWindow If aWindow is an external window, try to find an external window that contains a document. If not found, try an internal window in the main root view that contains a document. If aWindow is an internal window, try to find an internal window in the same root view that contains a document. If aWindow is null, try to find an external window that contains a document and then an internal window in the main root view that contains a document. Override this method if your application needs a better strategy to find a new document window. This method is called when a window containing a document is closed.

keyboardArrowPosition

  public int keyboardArrowPosition(View aView) *Beta API* 
Return the arrow position that should be used to show that aView is the selected view. Override this method and return the direction you need The default implementation will make sure that the arrow is visible. Default implementation's return value can be: TOP_LEFT_POSITION, TOP_RIGHT_POSITION, BOTTOM_LEFT_POSITION or BOTTOM_RIGHT_POSITION

keyboardArrowImage

  public Image keyboardArrowImage(int position) *Beta API* 
Return the arrow image that should be used for the position position

keyboardArrowHotSpot

  public Point keyboardArrowHotSpot(int position) *Beta API* 
Return the Point that should be used for the the keyboard arrow image for the position position

keyboardArrowLocation

  public Point keyboardArrowLocation(View aView,
                                     int position) *Beta API* 
Return the arrow location.The location is the point where the arrow hot spot should be in aView's root view coordinate system.

setKeyboardUIEnabled

  public void setKeyboardUIEnabled(boolean aFlag) *Beta API* 
Enable/Disable keyboard UI for this application. This method should be called in the init method of Application. This flag is checked once at startup, so changes to this switch will be ignored during the lifetime of the application.

isKeyboardUIEnabled

  public boolean isKeyboardUIEnabled() *Beta API* 
Return whether keyboard UI is enabled

clipboardText

  public static String clipboardText() *Beta API* 
Returns the "current" text string. This interacts with the the native clipboard on platforms where it is available

setClipboardText

  public static void setClipboardText(String text) *Beta API* 
Returns the "current" text string. This interacts with the the native clipboard on platforms where it is available

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Apr 1997