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.


Constructor Index

 o AppletWrapper(Applet)
Constructor for the main class, given an existing applet object.

Method Index

 o appletResize(int, int)
Called when the applet wants to be resized.
 o destroy()
Called by the applet context to destroy the applet.
 o getApplet()
Returns the applet.
 o getAppletContext()
Gets a handler to the applet's context.
 o getCodeBase()
Gets the codebase URL.
 o getDocumentBase()
Gets the document URL.
 o getInitialHeight()
Returns the initial height.
 o getInitialWidth()
Returns the initial width.
 o getInitialX()
Returns the initial x.
 o getInitialY()
Returns the initial y.
 o getParameter(String)
Gets a parameter of the applet.
 o init()
init
 o isActive()
Returns true if the applet is active.
 o parseArgs(String[])
Parse the command line arguments.
 o parseArgsFromHTML(String)
Parse the command line arguments from an HTML file, as would be done by the appletviewer.
 o setAppletContext(AppletContext)
set the applet context.
 o setArgs(String[])
Set the command-line arguments.
 o setDefaultLocation(int, int)
Set the default location, which might be overridden by command line arguments or an HTML file.
 o setDefaultSize(int, int)
Set the default size, which might be overridden by command line arguments or an HTML file.
 o setFrame(AppletFrame)
Set the AppletFrame.
 o start()
Called by the applet context to start the applet.
 o stop()
Called by the applet context to stop the applet.

Constructors

 o AppletWrapper
 public AppletWrapper(Applet applet)
Constructor for the main class, given an existing applet object.

Parameters:
applet - the Applet embedded in this AppletContext

Methods

 o getApplet
 public Applet getApplet()
Returns the applet.

Returns:
Applet
 o setFrame
 public void setFrame(AppletFrame frame)
Set the AppletFrame.

Parameters:
frame - the frame to be used
 o 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
 o 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
 o 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
 o getInitialX
 public int getInitialX()
Returns the initial x.

Returns:
int
 o getInitialY
 public int getInitialY()
Returns the initial y.

Returns:
int
 o getInitialWidth
 public int getInitialWidth()
Returns the initial width. If initial_width was < 0, it is first set to 640, then returned.

Returns:
int
 o getInitialHeight
 public int getInitialHeight()
Returns the initial height. If initial_height was < 0, it is first set to 480,

Returns:
int
 o setAppletContext
 public void setAppletContext(AppletContext appletContext)
set the applet context.

Parameters:
appletContext - value for this appletContext
 o init
 public void init()
init

 o start
 public void start()
Called by the applet context to start the applet.

 o stop
 public void stop()
Called by the applet context to stop the applet.

 o destroy
 public void destroy()
Called by the applet context to destroy the applet.

 o 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
 o 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
 o isActive
 public boolean isActive()
Returns true if the applet is active.

Returns:
boolean result always true
 o getDocumentBase
 public URL getDocumentBase()
Gets the document URL.

Returns:
URL a "file:" URL for the current directory
 o getCodeBase
 public final URL getCodeBase()
Gets the codebase URL.

Returns:
URL in this case, the same value as getDocumentBase()
 o 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
 o getAppletContext
 public final AppletContext getAppletContext()
Gets a handler to the applet's context.

Returns:
AppletContext this object
 o 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