public abstract class KiwiAppletContext extends Object implements AppletContext
showDocument()
and showStatus()
methods are
no-ops and may be overriden by subclasses to provide application-specific
behavior.Modifier and Type | Field and Description |
---|---|
private Hashtable |
applets |
private Hashtable |
streams |
Constructor and Description |
---|
KiwiAppletContext()
Construct a new Kiwi applet context.
|
Modifier and Type | Method and Description |
---|---|
void |
addApplet(String name,
Applet applet)
Add an applet to the applet context.
|
Applet |
getApplet(String name)
Look up an applet by name.
|
Enumeration |
getApplets()
Get all of the applets managed by this applet context.
|
AudioClip |
getAudioClip(URL url)
Load an audio clip at the specified URL.
|
Image |
getImage(URL url)
Load an image at the specified URL.
|
InputStream |
getStream(String key)
Look up a stream by key.
|
Iterator |
getStreamKeys()
Get a list of keys of the streams associated with this applet context.
|
void |
removeApplet(String name)
Remove an applet from the applet context.
|
void |
setStream(String key,
InputStream stream)
Associate a stream with this applet context.
|
void |
showDocument(URL url)
Display the document at the given URL.
|
void |
showDocument(URL url,
String target)
Display the document at the given URL.
|
void |
showStatus(String msg)
Display a status message from the applet.
|
public KiwiAppletContext()
public void addApplet(String name, Applet applet)
name
- The name of the applet.applet
- The applet to add.public void removeApplet(String name)
name
- The name of the applet to remove.public Applet getApplet(String name)
getApplet
in interface AppletContext
name
- The name of the appletApplet
object on success, or null
if an applet with the given name was not found in this applet context.public Enumeration getApplets()
getApplets
in interface AppletContext
Applet
objects.public AudioClip getAudioClip(URL url)
getAudioClip
in interface AppletContext
url
- The URL of the audio clip to load.null
on failure.public Image getImage(URL url)
getImage
in interface AppletContext
url
- The URL of the image to load.null
on failure.public void showDocument(URL url)
showDocument
in interface AppletContext
public void showDocument(URL url, String target)
showDocument
in interface AppletContext
public Iterator getStreamKeys()
getStreamKeys
in interface AppletContext
public void setStream(String key, InputStream stream) throws IOException
setStream
in interface AppletContext
key
- The key for the stream.stream
- The stream.IOException
- If an I/O exception occurs.public InputStream getStream(String key)
getStream
in interface AppletContext
key
- The key for the stream.InputStream
on success, or null
if
a stream with the given key is not associated with this applet context.public void showStatus(String msg)
showStatus
in interface AppletContext
msg
- The message to display.WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses