All Packages Class Hierarchy This Package Previous Next Index
Class dtai.gwt.AppletManager
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Window
|
+----java.awt.Frame
|
+----dtai.gwt.AppletManager
- public class AppletManager
- extends Frame
- implements AppletContext, URLStreamHandlerFactory
AppletManager - implements AppletContext and works with gwt.AppletWrapper
to allow any applet to easily run as an application. The only thing it
can't do is access URL's. Applet parameters are entered on the command
line with name as one word and value as the next, or through an HTML file.
-
AppletManager()
- AppletManager
-
AppletManager(Applet, int, int, int, int, String[])
- Convenience constructor for the AppletManager that starts
the given applet in its own frame (AppletFrame).
-
AppletManager(Applet, int, int, String[])
- Convenience constructor for the AppletManager that starts
the given applet in its own frame (AppletFrame).
-
add(AppletWrapper)
- Add an applet, via an AppletWrapper, and have it initialize.
-
createURLStreamHandler(String)
- Creates a new URLStreamHandler instance with the specified
protocol.
-
getApplet(String)
- Gets an applet by name.
-
getApplets()
- Enumerates the applets in this context.
-
getAudioClip(URL)
- Gets an audio clip.
-
getDefaultAppletContext()
- Return the default applet context.
-
getImage(URL)
- Gets an image.
-
getStatusBar()
- returns the object in which "showStatus" is displayed
-
remove(AppletWrapper)
- Remove an applet, via an AppletWrapper.
-
setStatusBar(TextField)
- setStatusBar Set the given TextField as the status bar.
-
setStatusBar(TextFieldGadget)
- setStatusBar Set the given TextField as the status bar.
-
showDocument(URL)
- Shows a new document.
-
showDocument(URL, String)
- Show a new document in a target window or frame.
-
showStatus(String)
- Show a status string in the status area (the Text object at
the bottom of the window).
AppletManager
public AppletManager()
- AppletManager
AppletManager
public AppletManager(Applet applet,
int defaultWidth,
int defaultHeight,
String args[])
- Convenience constructor for the AppletManager that starts
the given applet in its own frame (AppletFrame).
- Parameters:
- applet - the wrapper of an applet
- defaultWidth - default frame width
- defaultHeight - default frame height
- args - the command line arguments
AppletManager
public AppletManager(Applet applet,
int defaultX,
int defaultY,
int defaultWidth,
int defaultHeight,
String args[])
- Convenience constructor for the AppletManager that starts
the given applet in its own frame (AppletFrame).
- Parameters:
- applet - the wrapper of an applet
- defaultX - default frame x
- defaultY - default frame y
- defaultWidth - default frame width
- defaultHeight - default frame height
- args - the command line arguments
getDefaultAppletContext
public static AppletManager getDefaultAppletContext()
- Return the default applet context.
- Returns:
- defaultAppletContext the default applet context, or null if none
add
protected void add(AppletWrapper appletWrapper)
- Add an applet, via an AppletWrapper, and have it initialize.
- Parameters:
- appletWrapper - the wrapper of an applet
remove
protected void remove(AppletWrapper appletWrapper)
- Remove an applet, via an AppletWrapper.
- Parameters:
- appletWrapper - the wrapper of an applet
setStatusBar
public void setStatusBar(TextField status)
- setStatusBar Set the given TextField as the status bar.
- Parameters:
- status - the TextField
setStatusBar
public void setStatusBar(TextFieldGadget status)
- setStatusBar Set the given TextField as the status bar.
- Parameters:
- status - the TextField
getStatusBar
public Object getStatusBar()
- returns the object in which "showStatus" is displayed
- Returns:
- a TextField or TextFieldGadget (must do instanceof to tell)
getAudioClip
public final AudioClip getAudioClip(URL url)
- Gets an audio clip. (There doesn't seem to be a "Toolkit" for
audio clips in my JDK, so this always returns null. You could
implement this differently, returning a dummy AudioClip object
for which the class could be defined at the bottom of this file.)
- Parameters:
- url - URL of the AudioClip to load
- Returns:
- the AudioClip object if it exists (in our case,
this is always null
getImage
public final Image getImage(URL url)
- Gets an image. This usually involves downloading it
over the net. However, the environment may decide to
cache images. This method takes an array of URLs,
each of which will be tried until the image is found.
- Parameters:
- url - URL of the Image to load
- Returns:
- the Image object
getApplet
public final Applet getApplet(String name)
- Gets an applet by name.
- Parameters:
- name - the name of the applet
- Returns:
- null if the applet does not exist, and it never
does since we never name the applet.
getApplets
public final Enumeration getApplets()
- Enumerates the applets in this context. Only applets
that are accessible will be returned. This list always
includes the applet itself.
- Returns:
- the Enumeration -- contains ONLY the applet created with
this AppletManager
showDocument
public void showDocument(URL url)
- Shows a new document. This may be ignored by
the applet context (and in our case, it is, but we'll show the
user, in the status area, that the document was requested and
WOULD be loaded if in a browser).
- Parameters:
- url - URL to load
showDocument
public void showDocument(URL url,
String target)
- Show a new document in a target window or frame.
This may be ignored by the applet context. (Again, it is ignored,
but we'll show the request information to the user in the status area.)
This method accepts the target strings:
_self show in current frame
_parent show in parent frame
_top show in top-most frame
_blank show in new unnamed top-level window
show in new top-level window named
- Parameters:
- url - URL to load
- target - the target string
showStatus
public void showStatus(String text)
- Show a status string in the status area (the Text object at
the bottom of the window).
- Parameters:
- text - the text to display
createURLStreamHandler
public URLStreamHandler createURLStreamHandler(String protocol)
- Creates a new URLStreamHandler instance with the specified
protocol.
- Parameters:
- protocol - the protocol to use (ftp, http, nntp, etc.).
THIS PROTOCOL IS IGNORED BY THIS APPLET CONTEXT
- Returns:
- URLStreamHandler
All Packages Class Hierarchy This Package Previous Next Index