Class AppletEnvironment
java.lang.Object
net.sourceforge.jnlp.runtime.AppletEnvironment
- All Implemented Interfaces:
AppletContext, AppletStub
The applet environment including stub, context, and frame. The
default environment puts the applet in a non-resizable frame;
this can be changed by obtaining the frame and setting it
resizable.
- Version:
- $Revision: 1.12 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Appletthe appletprivate booleanwhether the applet has been started / displayedprivate Containerthe applet containerprivate booleanwhether the applet has been destroyedprivate JNLPFilethe JNLP fileprivate static final Loggerthe parametersprivate final WeakList<AppletAudioClip> weak references to the audio clips -
Constructor Summary
ConstructorsConstructorDescriptionAppletEnvironment(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, Container cont) Create a new applet environment for the applet specified by the JNLP file. -
Method Summary
Modifier and TypeMethodDescriptionvoidappletResize(int width, int height) private voidChecks whether the applet has been destroyed, and throws an IllegalStateException if the applet has been destroyed of.voiddestroy()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.Returns the applet if the applet's name is specified, otherwise return null.Returns an enumeration that contains only the applet from the JNLP file.getAudioClip(URL location) getParameter(String name) Required for JRE1.4, but not implemented yet.Required for JRE1.4, but not implemented yet.booleanisActive()voidSet the applet of this environment; can only be called once.voidsetStream(String key, InputStream stream) Required for JRE1.4, but not implemented yet.voidshowDocument(URL uRL) voidshowDocument(URL uRL, String str) Not implemented yet.voidshowStatus(String str) Not implemented yet.voidInitialize, start, and show the applet.
-
Field Details
-
LOG
-
file
the JNLP file -
applet
the applet -
parameters
-
cont
the applet container -
weakClips
weak references to the audio clips -
appletStarted
private boolean appletStartedwhether the applet has been started / displayed -
destroyed
private boolean destroyedwhether the applet has been destroyed
-
-
Constructor Details
-
AppletEnvironment
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
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 Details
-
checkDestroyed
private void checkDestroyed()Checks whether the applet has been destroyed, and throws an IllegalStateException if the applet has been destroyed of.- Throws:
IllegalStateException
-
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
- Returns:
- the frame that contains the applet. Disposing this frame will destroy the applet.
-
startApplet
public void startApplet()Initialize, start, and show the applet. -
getApplet
Returns the applet if the applet's name is specified, otherwise return null.- Specified by:
getAppletin interfaceAppletContext
-
setApplet
Set the applet of this environment; can only be called once.- Parameters:
applet- source of this environment
-
getApplets
Returns an enumeration that contains only the applet from the JNLP file.- Specified by:
getAppletsin interfaceAppletContext
-
getAudioClip
- Specified by:
getAudioClipin interfaceAppletContext- Parameters:
location- source of clip- Returns:
- an audio clip.
-
getImage
- Specified by:
getImagein interfaceAppletContext- Parameters:
location- location of image- Returns:
- an image loaded from the specified location.
-
showDocument
- Specified by:
showDocumentin interfaceAppletContext- Parameters:
uRL- url of document
-
showDocument
Not implemented yet.- Specified by:
showDocumentin interfaceAppletContext- Parameters:
uRL- source of documentstr- _self, _parent, _top, _blank or "name". Have sense only for applets. Not implemented for our javaws world
-
showStatus
Not implemented yet.- Specified by:
showStatusin interfaceAppletContext- Parameters:
str- id of applet
-
setStream
Required for JRE1.4, but not implemented yet.- Specified by:
setStreamin interfaceAppletContext
-
getStream
Required for JRE1.4, but not implemented yet.- Specified by:
getStreamin interfaceAppletContext
-
getStreamKeys
Required for JRE1.4, but not implemented yet.- Specified by:
getStreamKeysin interfaceAppletContext
-
appletResize
public void appletResize(int width, int height) - Specified by:
appletResizein interfaceAppletStub
-
getAppletContext
- Specified by:
getAppletContextin interfaceAppletStub
-
getCodeBase
- Specified by:
getCodeBasein interfaceAppletStub
-
getDocumentBase
- Specified by:
getDocumentBasein interfaceAppletStub
-
getParameter
- Specified by:
getParameterin interfaceAppletStub
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceAppletStub
-