Class AppletEnvironment

java.lang.Object
net.sourceforge.jnlp.runtime.AppletEnvironment
All Implemented Interfaces:
AppletContext, AppletStub

public class AppletEnvironment extends Object implements AppletContext, 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 Details

    • AppletEnvironment

      public AppletEnvironment(JNLPFile file, AppletInstance appletInstance, Container cont)
      Create a new applet environment for the applet specified by the JNLP file.
      Parameters:
      file - jnlp file base to construct environment
      appletInstance - applet for this environment
      cont - 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 environment
      appletInstance - applet for this environment
  • Method Details

    • 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 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 Applet getApplet(String name)
      Returns the applet if the applet's name is specified, otherwise return null.
      Specified by:
      getApplet in interface AppletContext
    • setApplet

      public void setApplet(Applet applet)
      Set the applet of this environment; can only be called once.
      Parameters:
      applet - source of this environment
    • getApplets

      public Enumeration<Applet> getApplets()
      Returns an enumeration that contains only the applet from the JNLP file.
      Specified by:
      getApplets in interface AppletContext
    • getAudioClip

      public AudioClip getAudioClip(URL location)
      Specified by:
      getAudioClip in interface AppletContext
      Parameters:
      location - source of clip
      Returns:
      an audio clip.
    • getImage

      public Image getImage(URL location)
      Specified by:
      getImage in interface AppletContext
      Parameters:
      location - location of image
      Returns:
      an image loaded from the specified location.
    • showDocument

      public void showDocument(URL uRL)
      Specified by:
      showDocument in interface AppletContext
      Parameters:
      uRL - url of document
    • showDocument

      public void showDocument(URL uRL, String str)
      Not implemented yet.
      Specified by:
      showDocument in interface AppletContext
      Parameters:
      uRL - source of document
      str - _self, _parent, _top, _blank or "name". Have sense only for applets. Not implemented for our javaws world
    • showStatus

      public void showStatus(String str)
      Not implemented yet.
      Specified by:
      showStatus in interface AppletContext
      Parameters:
      str - id of applet
    • setStream

      public void setStream(String key, InputStream stream)
      Required for JRE1.4, but not implemented yet.
      Specified by:
      setStream in interface AppletContext
    • getStream

      public InputStream getStream(String key)
      Required for JRE1.4, but not implemented yet.
      Specified by:
      getStream in interface AppletContext
    • getStreamKeys

      public Iterator<String> getStreamKeys()
      Required for JRE1.4, but not implemented yet.
      Specified by:
      getStreamKeys in interface AppletContext
    • appletResize

      public void appletResize(int width, int height)
      Specified by:
      appletResize in interface AppletStub
    • getAppletContext

      public AppletContext getAppletContext()
      Specified by:
      getAppletContext in interface AppletStub
    • getCodeBase

      public URL getCodeBase()
      Specified by:
      getCodeBase in interface AppletStub
    • getDocumentBase

      public URL getDocumentBase()
      Specified by:
      getDocumentBase in interface AppletStub
    • getParameter

      public String getParameter(String name)
      Specified by:
      getParameter in interface AppletStub
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface AppletStub