All Packages Class Hierarchy This Package Previous Next Index
Class dtai.gwt.AppletWrapper
java.lang.Object
|
+----dtai.gwt.AppletWrapper
- public class AppletWrapper
- extends Object
- implements AppletStub
AppletWrapper - implements AppletStub and works with gwt.AppletManager
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.
-
AppletWrapper(Applet)
- Constructor for the main class, given an existing applet object.
-
appletResize(int, int)
- Called when the applet wants to be resized.
-
destroy()
- Called by the applet context to destroy the applet.
-
getApplet()
- Returns the applet.
-
getAppletContext()
- Gets a handler to the applet's context.
-
getCodeBase()
- Gets the codebase URL.
-
getDocumentBase()
- Gets the document URL.
-
getInitialHeight()
- Returns the initial height.
-
getInitialWidth()
- Returns the initial width.
-
getInitialX()
- Returns the initial x.
-
getInitialY()
- Returns the initial y.
-
getParameter(String)
- Gets a parameter of the applet.
-
init()
- init
-
isActive()
- Returns true if the applet is active.
-
parseArgs(String[])
- Parse the command line arguments.
-
parseArgsFromHTML(String)
- Parse the command line arguments from an HTML file, as would be done by
the appletviewer.
-
setAppletContext(AppletContext)
- set the applet context.
-
setArgs(String[])
- Set the command-line arguments.
-
setDefaultLocation(int, int)
- Set the default location, which might be overridden by command line arguments
or an HTML file.
-
setDefaultSize(int, int)
- Set the default size, which might be overridden by
command line arguments or an HTML file.
-
setFrame(AppletFrame)
- Set the AppletFrame.
-
start()
- Called by the applet context to start the applet.
-
stop()
- Called by the applet context to stop the applet.
AppletWrapper
public AppletWrapper(Applet applet)
- Constructor for the main class, given an existing applet object.
- Parameters:
- applet - the Applet embedded in this AppletContext
getApplet
public Applet getApplet()
- Returns the applet.
- Returns:
- Applet
setFrame
public void setFrame(AppletFrame frame)
- Set the AppletFrame.
- Parameters:
- frame - the frame to be used
setArgs
public void setArgs(String args[])
- Set the command-line arguments.
- Parameters:
- args[] - the command line arguments. Contains possibly
height and width, and any applet parameters
setDefaultSize
protected void setDefaultSize(int default_width,
int default_height)
- Set the default size, which might be overridden by
command line arguments or an HTML file.
- Parameters:
- default_width - the default width of the window
- default_height - the default height of the window
setDefaultLocation
protected void setDefaultLocation(int default_x,
int default_y)
- Set the default location, which might be overridden by command line arguments
or an HTML file.
- Parameters:
- default_x - the default x of the window
- default_y - the default y of the window
getInitialX
public int getInitialX()
- Returns the initial x.
- Returns:
- int
getInitialY
public int getInitialY()
- Returns the initial y.
- Returns:
- int
getInitialWidth
public int getInitialWidth()
- Returns the initial width.
If initial_width was < 0, it is first set to 640,
then returned.
- Returns:
- int
getInitialHeight
public int getInitialHeight()
- Returns the initial height.
If initial_height was < 0, it is first set to 480,
- Returns:
- int
setAppletContext
public void setAppletContext(AppletContext appletContext)
- set the applet context.
- Parameters:
- appletContext - value for this appletContext
init
public void init()
- init
start
public void start()
- Called by the applet context to start the applet.
stop
public void stop()
- Called by the applet context to stop the applet.
destroy
public void destroy()
- Called by the applet context to destroy the applet.
parseArgs
public void parseArgs(String args[])
- Parse the command line arguments. Get the initial width and height of
the window if specified (-width [value] -height [value]), and the
applet parameters (name value pairs).
- Parameters:
- args[] - the command line arguments. Contains possibly
height and width, and any applet parameters
parseArgsFromHTML
public void parseArgsFromHTML(String filename)
- Parse the command line arguments from an HTML file, as would be done by
the appletviewer. This looks for width and height tags as well as applet
parameters. It parses only the first APPLET tag. It also assumes that the
first APPLET tag is for the applet it is using, rather than try to load the
class specified in the APPLET tag.
- Parameters:
- filename - the HTML file
isActive
public boolean isActive()
- Returns true if the applet is active.
- Returns:
- boolean result always true
getDocumentBase
public URL getDocumentBase()
- Gets the document URL.
- Returns:
- URL a "file:" URL for the current directory
getCodeBase
public final URL getCodeBase()
- Gets the codebase URL.
- Returns:
- URL in this case, the same value as getDocumentBase()
getParameter
public final String getParameter(String name)
- Gets a parameter of the applet.
- Parameters:
- name - the name of the parameter
- Returns:
- String the value, or null if not defined
getAppletContext
public final AppletContext getAppletContext()
- Gets a handler to the applet's context.
- Returns:
- AppletContext this object
appletResize
public void appletResize(int width,
int height)
- Called when the applet wants to be resized. This causes the
Frame (window) to be resized to accomodate the new Applet size.
- Parameters:
- width - the new width of the applet
- height - the new height of the applet
All Packages Class Hierarchy This Package Previous Next Index