org.fest.swing.applet
Class BasicAppletContext

java.lang.Object
  extended by org.fest.swing.applet.BasicAppletContext
All Implemented Interfaces:
AppletContext

public class BasicAppletContext
extends Object
implements AppletContext

Understands a basic (and limited) implementation of AppletContext.

Author:
Alex Ruiz, Yvonne Wang

Constructor Summary
BasicAppletContext(StatusDisplay statusDisplay)
          Creates a new BasicAppletContext.
 
Method Summary
 Applet getApplet(String name)
          If the StatusDisplay passed to this context is an instance of AppletViewer, this method will return the Applet of such AppletViewer.
 Enumeration<Applet> getApplets()
          Returns an enumeration containing the Applet returned by getApplet(String).
 AudioClip getAudioClip(URL url)
          Not implemented.
 Image getImage(URL url)
          Not implemented.
 InputStream getStream(String key)
          Returns the stream to which specified key is associated within this applet context.
 Iterator<String> getStreamKeys()
          Finds all the keys of the streams in this applet context.
 void setStream(String key, InputStream stream)
          Associates the specified stream with the specified key in this applet context.
 void showDocument(URL url)
          Not implemented.
 void showDocument(URL url, String target)
          Not implemented.
 void showStatus(String status)
          Requests that the given status be displayed in this context's StatusDisplay.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAppletContext

public BasicAppletContext(StatusDisplay statusDisplay)
Creates a new BasicAppletContext.

Parameters:
statusDisplay - where the application can inform users of its current state.
Throws:
NullPointerException - if statusDisplay is null.
Method Detail

getApplet

public Applet getApplet(String name)
If the StatusDisplay passed to this context is an instance of AppletViewer, this method will return the Applet of such AppletViewer. Otherwise this method returns null.

Specified by:
getApplet in interface AppletContext
Returns:
the Applet in this context's StatusDisplay (if any.)
See Also:
AppletContext.getApplet(String)

getApplets

public Enumeration<Applet> getApplets()
Returns an enumeration containing the Applet returned by getApplet(String). If getApplet(String) returns null, this method will return an empty enumeration.

Specified by:
getApplets in interface AppletContext
Returns:
an enumeration containing the Applet in this context's StatusDisplay (if any.)
See Also:
getApplet(String), AppletContext.getApplets()

getAudioClip

public AudioClip getAudioClip(URL url)
Not implemented. Returns null.

Specified by:
getAudioClip in interface AppletContext
See Also:
AppletContext.getAudioClip(URL)

getImage

public Image getImage(URL url)
Not implemented. Returns null.

Specified by:
getImage in interface AppletContext
See Also:
AppletContext.getImage(URL)

getStream

public InputStream getStream(String key)
Returns the stream to which specified key is associated within this applet context. Returns null if the applet context contains no stream for this key.

Specified by:
getStream in interface AppletContext
Parameters:
key - key whose associated stream is to be returned.
Returns:
the stream to which this applet context maps the key.

getStreamKeys

public Iterator<String> getStreamKeys()
Finds all the keys of the streams in this applet context.

Specified by:
getStreamKeys in interface AppletContext
Returns:
an iterator of all the names of the streams in this applet context.

setStream

public void setStream(String key,
                      InputStream stream)
Associates the specified stream with the specified key in this applet context.

Specified by:
setStream in interface AppletContext
Parameters:
key - key with which the specified value is to be associated.
stream - stream to be associated with the specified key. If this parameter is null, the specified key is removed in this applet context.

showDocument

public void showDocument(URL url)
Not implemented.

Specified by:
showDocument in interface AppletContext
See Also:
AppletContext.showDocument(URL)

showDocument

public void showDocument(URL url,
                         String target)
Not implemented.

Specified by:
showDocument in interface AppletContext
See Also:
AppletContext.showDocument(URL, String)

showStatus

public void showStatus(String status)
Requests that the given status be displayed in this context's StatusDisplay.

Specified by:
showStatus in interface AppletContext
Parameters:
status - a message to display.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.