Package net.sourceforge.jnlp.runtime
Class AppletEnvironment
- java.lang.Object
-
- net.sourceforge.jnlp.runtime.AppletEnvironment
-
- All Implemented Interfaces:
java.applet.AppletContext
,java.applet.AppletStub
public class AppletEnvironment extends java.lang.Object implements java.applet.AppletContext, java.applet.AppletStub
The applet environment including stub, context, and frame. The default environment puts the applet in a non-resiable frame; this can be changed by obtaining the frame and setting it resizable.
-
-
Constructor Summary
Constructors Constructor Description AppletEnvironment(JNLPFile file, AppletInstance appletInstance)
Create a new applet environment for the applet specified by the JNLP file, in a new frame.AppletEnvironment(JNLPFile file, AppletInstance appletInstance, java.awt.Container cont)
Create a new applet environment for the applet specified by the JNLP file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appletResize(int width, int height)
void
destroy()
Disposes the applet's resources and disables the applet environment from further use; after calling this method the applet stub and context methods throw IllegalStateExceptions.java.applet.Applet
getApplet(java.lang.String name)
Returns the applet if the applet's name is specified, otherwise return null.java.applet.AppletContext
getAppletContext()
java.awt.Container
getAppletFrame()
java.util.Enumeration<java.applet.Applet>
getApplets()
Returns an enumeration that contains only the applet from the JNLP file.java.applet.AudioClip
getAudioClip(java.net.URL location)
java.net.URL
getCodeBase()
java.net.URL
getDocumentBase()
java.awt.Image
getImage(java.net.URL location)
java.lang.String
getParameter(java.lang.String name)
net.sourceforge.jnlp.splashscreen.SplashController
getSplashController()
container must be SplashContoler.java.io.InputStream
getStream(java.lang.String key)
Required for JRE1.4, but not implemented yet.java.util.Iterator<java.lang.String>
getStreamKeys()
Required for JRE1.4, but not implemented yet.boolean
isActive()
void
setApplet(java.applet.Applet applet)
Set the applet of this environment; can only be called once.void
setStream(java.lang.String key, java.io.InputStream stream)
Required for JRE1.4, but not implemented yet.void
showDocument(java.net.URL uRL)
void
showDocument(java.net.URL uRL, java.lang.String str)
Not implemented yet.void
showStatus(java.lang.String str)
Not implemented yet.void
startApplet()
Initialize, start, and show the applet.
-
-
-
Constructor Detail
-
AppletEnvironment
public AppletEnvironment(JNLPFile file, AppletInstance appletInstance, java.awt.Container cont)
Create a new applet environment for the applet specified by the JNLP file.- Parameters:
file
- jnlp file base to construct environmentappletInstance
- applet for this environmentcont
- container to place this applet to
-
AppletEnvironment
public AppletEnvironment(JNLPFile file, AppletInstance appletInstance)
Create a new applet environment for the applet specified by the JNLP file, in a new frame.- Parameters:
file
- jnlp file base to construct environmentappletInstance
- applet for this environment
-
-
Method Detail
-
destroy
public void destroy()
Disposes the applet's resources and disables the applet environment from further use; after calling this method the applet stub and context methods throw IllegalStateExceptions.
-
getAppletFrame
public java.awt.Container getAppletFrame()
- Returns:
- the frame that contains the applet. Disposing this frame will destroy the applet.
-
getSplashController
public net.sourceforge.jnlp.splashscreen.SplashController getSplashController()
container must be SplashContoler.- Returns:
- container
-
startApplet
public void startApplet()
Initialize, start, and show the applet.
-
getApplet
public java.applet.Applet getApplet(java.lang.String name)
Returns the applet if the applet's name is specified, otherwise return null.- Specified by:
getApplet
in interfacejava.applet.AppletContext
-
setApplet
public void setApplet(java.applet.Applet applet)
Set the applet of this environment; can only be called once.- Parameters:
applet
- source of this environment
-
getApplets
public java.util.Enumeration<java.applet.Applet> getApplets()
Returns an enumeration that contains only the applet from the JNLP file.- Specified by:
getApplets
in interfacejava.applet.AppletContext
-
getAudioClip
public java.applet.AudioClip getAudioClip(java.net.URL location)
- Specified by:
getAudioClip
in interfacejava.applet.AppletContext
- Parameters:
location
- source of clip- Returns:
- an audio clip.
-
getImage
public java.awt.Image getImage(java.net.URL location)
- Specified by:
getImage
in interfacejava.applet.AppletContext
- Parameters:
location
- location of image- Returns:
- an image loaded from the specified location.
-
showDocument
public void showDocument(java.net.URL uRL)
- Specified by:
showDocument
in interfacejava.applet.AppletContext
- Parameters:
uRL
- url of document
-
showDocument
public void showDocument(java.net.URL uRL, java.lang.String str)
Not implemented yet.- Specified by:
showDocument
in interfacejava.applet.AppletContext
- Parameters:
uRL
- source of documentstr
- _self, _parent, _top, _blank or "name". Have sense only for applets. Not implemented for our javaws world
-
showStatus
public void showStatus(java.lang.String str)
Not implemented yet.- Specified by:
showStatus
in interfacejava.applet.AppletContext
- Parameters:
str
- id of applet
-
setStream
public void setStream(java.lang.String key, java.io.InputStream stream)
Required for JRE1.4, but not implemented yet.- Specified by:
setStream
in interfacejava.applet.AppletContext
-
getStream
public java.io.InputStream getStream(java.lang.String key)
Required for JRE1.4, but not implemented yet.- Specified by:
getStream
in interfacejava.applet.AppletContext
-
getStreamKeys
public java.util.Iterator<java.lang.String> getStreamKeys()
Required for JRE1.4, but not implemented yet.- Specified by:
getStreamKeys
in interfacejava.applet.AppletContext
-
appletResize
public void appletResize(int width, int height)
- Specified by:
appletResize
in interfacejava.applet.AppletStub
-
getAppletContext
public java.applet.AppletContext getAppletContext()
- Specified by:
getAppletContext
in interfacejava.applet.AppletStub
-
getCodeBase
public java.net.URL getCodeBase()
- Specified by:
getCodeBase
in interfacejava.applet.AppletStub
-
getDocumentBase
public java.net.URL getDocumentBase()
- Specified by:
getDocumentBase
in interfacejava.applet.AppletStub
-
getParameter
public java.lang.String getParameter(java.lang.String name)
- Specified by:
getParameter
in interfacejava.applet.AppletStub
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfacejava.applet.AppletStub
-
-