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;
public final static int BOTTOM_RIGHT_POSITION;
public final static int TOP_LEFT_POSITION;
public final static int TOP_RIGHT_POSITION;
/* Constructors
*/
public Application();
public Application(Applet);
/* Methods
*/
public static Application application();
public static String clipboardText();
public static String releaseName();
public static void setClipboardText(String);
public void addObserver(ApplicationObserver);
public void appletStarted();
public void appletStopped();
public void chooseNextCurrentDocumentWindow(Window);
public Class classForName(String);
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 boolean handleExtendedKeyEvent();
public boolean handleJDK11MouseEvents();
public void init();
public boolean isApplet();
public boolean isKeyboardUIEnabled();
public boolean isPaused();
public boolean isRunning();
public void keyDown(KeyEvent);
public void keyTyped(KeyEvent);
public void keyUp(KeyEvent);
public Point keyboardArrowHotSpot(int);
public Image keyboardArrowImage(int);
public Point keyboardArrowLocation(View, int);
public int keyboardArrowPosition(View);
public RootView mainRootView();
public void makeCurrentDocumentWindow(Window);
public View modalView();
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 setHandleJDK11MouseEvents(boolean);
public void setKeyboardUIEnabled(boolean);
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
public static String releaseName()
public static Application application()
- Returns the application instance.
public void init()
- Initializes the Application. Override to perform any initialization.
public void cleanup()
- Called when the run loop has exited.
public void stopRunning()
- Destroys the Application, including all ExternalWindows.
Stops the EventLoop and causes run() to return.
public void run()
- Starts the Application's EventLoop.
public EventLoop eventLoop()
- Returns the Application's EventLoop.
- See Also:
- EventLoop
public boolean isApplet()
- Returns true if the Application was started as an Applet.
public java.net.URL codeBase()
- Returns the Application's codebase, the URL where the Applet's class
file originated.
public String parameterNamed(String name)
- Returns the values for the parameter name.
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
public void setMainRootView(RootView view)
- Sets the main RootView.
- See Also:
- mainRootView
public Vector rootViews()
- Returns a Vector containing all the RootViews being displayed
by the Application. This vector is for reading only - do not
modify.
public Vector externalWindows()
- Returns a Vector containing all the ExternalWindows being displayed
by the Application. This Vector is for reading only - do not
modify.
public void willProcessEvent(Event anEvent)
- Called before the EventLoop processes anEvent.
The default implementation does nothing.
public void didProcessEvent(Event anEvent)
- Called after the EventLoop has processed anEvent.
The default implementation does nothing.
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.
public void keyTyped(KeyEvent event)
- Subclassers can override to catch key typed 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. This method is called only when running with a 1.1 virtual machine
and Application.application().handleExtendedKeyEvent
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.
public View modalView()
- Returns the top level view that has started a modal session.
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
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
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
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
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
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
public void appletStarted()
- Called from an Applet's start() method. Notifies all
ApplicationObservers that the Application has resumed.
Normally called from FoundationApplet.
public void appletStopped()
- Called from an Applet's stop() method. Notifies all
ApplicationObservers that the Application has paused.
Normally called from FoundationApplet.
public void processEvent(Event event)
- Processes Application-specific Events.
public boolean isRunning()
- Returns true if the Application's EventLoop is
currently running.
public boolean isPaused()
- Returns true if the Application is currently paused.
Applications pause when their Applet's HTML page becomes hidden.
public void makeCurrentDocumentWindow(Window aWindow)
- 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.
public Window currentDocumentWindow()
- Return the current document window. Return null if there is no
current document window
public void chooseNextCurrentDocumentWindow(Window aWindow)
- 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.
public int keyboardArrowPosition(View aView)
- 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
public Image keyboardArrowImage(int position)
- Return the arrow image that should be used for the position
position
public Point keyboardArrowHotSpot(int position)
- Return the Point that should be used for the the keyboard arrow
image for the position position
public Point keyboardArrowLocation(View aView,
int position)
- Return the arrow location.The location is the point where
the arrow hot spot should be in aView's root view
coordinate system.
public void setKeyboardUIEnabled(boolean aFlag)
- 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.
public boolean isKeyboardUIEnabled()
- Return whether keyboard UI is enabled
public static String clipboardText()
- Returns the "current" text string. This interacts with the
the native clipboard on platforms where it is available
public static void setClipboardText(String text)
- Returns the "current" text string. This interacts with the
the native clipboard on platforms where it is available
public void setHandleJDK11MouseEvents(boolean b)
- The RootView will attempt to detect and eliminate extraneous
mouseDown events under certain circumstances. This should should
only affect VMs under JDK 1.1.x. JDK 1.0.2 VMs should be unaffected.
By default this process is turned on.
public boolean handleJDK11MouseEvents()
public boolean handleExtendedKeyEvent()
- Override this method and return true if you want your application/applet
to receive some ExtendedKeyEvent instead of KeyEvent. This will also enable
keyTyped events. This works only when your application/applet is running with 1.1
The default implementation returns false to garantee backward compatibility
public Class classForName(String aName) throws ClassNotFoundException
- IFC uses this method when it wants to find a class from a string
This method will ask the foundation applet to load the class to
use the applet class loader. If there is no foundation applet,
Class.forName will be used.
Override this method if you do not want to use a FoundationApplet
and provide a different way to load a class
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 Oct 1997