|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.util.AppletHost
public class AppletHost
AppletHost - implements AppletContext and AppletStub 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.
| Field Summary | |
|---|---|
protected java.util.Vector |
applets
|
protected int |
initial_height
|
protected int |
initial_width
|
protected java.util.Hashtable |
params
|
protected java.awt.Button |
startButton
|
protected java.awt.TextField |
status
|
protected java.awt.Button |
stopButton
|
| Constructor Summary | |
|---|---|
AppletHost(java.applet.Applet applet,
int default_width,
int default_height,
java.lang.String[] args)
Constructor for the main class, given an existing applet object and a default frame (window) width and height. |
|
AppletHost(java.applet.Applet applet,
java.lang.String[] args)
Constructor for the main class, given an existing applet object. |
|
AppletHost(java.lang.String[] args)
Constructor for the main class, from the command line arguments. |
|
AppletHost(java.lang.String appletClassName,
int default_width,
int default_height,
java.lang.String[] args)
Constructor for the main class, given a name of an applet object and a default frame (window) width and height. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
|
void |
appletResize(int width,
int height)
Called when the applet wants to be resized. |
java.applet.Applet |
getApplet(java.lang.String name)
Gets an applet by name. |
java.applet.AppletContext |
getAppletContext()
Gets a handler to the applet's context. |
java.util.Enumeration |
getApplets()
Enumerates the applets in this context. |
java.applet.AudioClip |
getAudioClip(java.net.URL url)
Gets an audio clip. |
java.net.URL |
getCodeBase()
Gets the codebase URL. |
java.net.URL |
getDocumentBase()
Gets the document URL. |
java.awt.Image |
getImage(java.net.URL url)
Gets an image. |
java.lang.String |
getParameter(java.lang.String name)
Gets a parameter of the applet. |
java.io.InputStream |
getStream(java.lang.String key)
Returns the stream to which specified key is associated within this applet context. |
java.util.Iterator |
getStreamKeys()
Finds all the keys of the streams in this applet context. |
boolean |
isActive()
Returns true if the applet is active. |
static void |
main(java.lang.String[] args)
Entry point into the standalone program. |
void |
parseArgs(java.lang.String[] args,
int startidx)
Parse the command line arguments. |
void |
processWindowEvent(java.awt.event.WindowEvent evt)
|
void |
setStream(java.lang.String key,
java.io.InputStream stream)
Associates the specified stream with the specified key in this applet context. |
void |
showDocument(java.net.URL url)
Shows a new document. |
void |
showDocument(java.net.URL url,
java.lang.String target)
Show a new document in a target window or frame. |
void |
showStatus(java.lang.String text)
Show a status string in the status area (the Text object at the bottom of the window. |
| Field Detail |
|---|
protected java.awt.TextField status
protected java.awt.Button startButton
protected java.awt.Button stopButton
protected java.util.Hashtable params
protected java.util.Vector applets
protected int initial_width
protected int initial_height
| Constructor Detail |
|---|
public AppletHost(java.applet.Applet applet,
java.lang.String[] args)
applet - the applet embedded in this AppletContextargs - the command line arguments. Contains possibly
height and width, and any applet parameters
public AppletHost(java.applet.Applet applet,
int default_width,
int default_height,
java.lang.String[] args)
applet - the applet embedded in this AppletContextdefault_width - the default width of the windowdefault_height - the default width of the windowargs - the command line arguments. Contains possibly
height and width, and any applet parameters
public AppletHost(java.lang.String appletClassName,
int default_width,
int default_height,
java.lang.String[] args)
appletClassName - the applet embedded in this AppletContextdefault_width - the default width of the windowdefault_height - the default width of the windowargs - the command line arguments. Contains possibly
height and width, and any applet parameterspublic AppletHost(java.lang.String[] args)
args - the command line arguments. Contains the name of the applet
class, possibly height and width, and any applet parameters.| Method Detail |
|---|
public static void main(java.lang.String[] args)
args - the command line arguments
public void parseArgs(java.lang.String[] args,
int startidx)
args - the command line arguments. Contains possibly
height and width, and any applet parametersstartidx - index in the args array at which to start parsingpublic void processWindowEvent(java.awt.event.WindowEvent evt)
processWindowEvent in class java.awt.Windowpublic void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed in interface java.awt.event.ActionListenerpublic boolean isActive()
isActive in interface java.applet.AppletStubisActive in class java.awt.Windowpublic java.net.URL getDocumentBase()
getDocumentBase in interface java.applet.AppletStubpublic final java.net.URL getCodeBase()
getCodeBase in interface java.applet.AppletStubpublic final java.lang.String getParameter(java.lang.String name)
getParameter in interface java.applet.AppletStubname - the name of the parameter
public final java.applet.AppletContext getAppletContext()
getAppletContext in interface java.applet.AppletStub
public void appletResize(int width,
int height)
appletResize in interface java.applet.AppletStubwidth - the new width of the appletheight - the new height of the appletpublic final java.applet.AudioClip getAudioClip(java.net.URL url)
getAudioClip in interface java.applet.AppletContexturl - URL of the AudioClip to load
public final java.awt.Image getImage(java.net.URL url)
getImage in interface java.applet.AppletContexturl - URL of the Image to load
public final java.applet.Applet getApplet(java.lang.String name)
getApplet in interface java.applet.AppletContextname - the name of the applet
public final java.util.Enumeration getApplets()
getApplets in interface java.applet.AppletContextpublic void showDocument(java.net.URL url)
showDocument in interface java.applet.AppletContexturl - URL to load
public void showDocument(java.net.URL url,
java.lang.String target)
showDocument in interface java.applet.AppletContexturl - URL to loadtarget - the target stringpublic void showStatus(java.lang.String text)
showStatus in interface java.applet.AppletContexttext - the text to displaypublic java.io.InputStream getStream(java.lang.String key)
getStream in interface java.applet.AppletContextpublic java.util.Iterator getStreamKeys()
getStreamKeys in interface java.applet.AppletContext
public void setStream(java.lang.String key,
java.io.InputStream stream)
setStream in interface java.applet.AppletContext
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||