objectdraw
Class ControllerContext

java.lang.Object
  extended by objectdraw.ControllerContext
All Implemented Interfaces:
AppletContext

 class ControllerContext
extends Object
implements AppletContext

An implementation of AppletContext designed to support Controller objects run as applications or under the control of development environments that support direct instantiation of objects better than running applets (i.e. BlueJ and DrJava).

Version:
1.1.1 released February 2005

Constructor Summary
ControllerContext(Applet controller)
          Create a new Controller Context for the specified controller
 
Method Summary
 Applet getApplet(String name)
          Always returns null on the assumption that this context only manages a single controller
 Enumeration getApplets()
          Produce an enumeration that will provide access to the singleton collection of controllers managed by this context
 AudioClip getAudioClip(URL url)
          Access an audio file
 Image getImage(URL url)
          access an image file
 InputStream getStream(String key)
          Null implementation of unsupported getStream method
 Iterator getStreamKeys()
          Null implemenation of unsupported getStreamKeys method
 void setStream(String key, InputStream stream)
          Null implementation of unsupported setStream method
 void showDocument(URL url)
          Unsupported.
 void showDocument(URL url, String target)
          Unsupported.
 void showStatus(String status)
          Display a message in the applet status area
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControllerContext

public ControllerContext(Applet controller)
Create a new Controller Context for the specified controller

Parameters:
controller - the controller to serve. This parameter is typed as an Applet since this is the closest ancestor of both the Controller and AWTController classes.
Method Detail

getApplet

public Applet getApplet(String name)
Always returns null on the assumption that this context only manages a single controller

Specified by:
getApplet in interface AppletContext
Returns:
null

getApplets

public Enumeration getApplets()
Produce an enumeration that will provide access to the singleton collection of controllers managed by this context

Specified by:
getApplets in interface AppletContext
Returns:
an enumeration with just one controller as its contents

getAudioClip

public AudioClip getAudioClip(URL url)
Access an audio file

Specified by:
getAudioClip in interface AppletContext
Parameters:
url - the address of the desired audio file

getImage

public Image getImage(URL url)
access an image file

Specified by:
getImage in interface AppletContext
Parameters:
url - the address of the desired image file

getStream

public InputStream getStream(String key)
Null implementation of unsupported getStream method

Specified by:
getStream in interface AppletContext
Parameters:
key - ignored
Returns:
null

getStreamKeys

public Iterator getStreamKeys()
Null implemenation of unsupported getStreamKeys method

Specified by:
getStreamKeys in interface AppletContext
Returns:
null

setStream

public void setStream(String key,
                      InputStream stream)
Null implementation of unsupported setStream method

Specified by:
setStream in interface AppletContext
Parameters:
key - ignored
stream - ignored

showDocument

public void showDocument(URL url)
Unsupported. Displays message to indicate a request to load an HTMLpage, but does not actually display the requested document

Specified by:
showDocument in interface AppletContext
Parameters:
url - address of desired document.

showDocument

public void showDocument(URL url,
                         String target)
Unsupported. Displays message to indicate a request to load an HTMLpage, but does not actually display the requested document

Specified by:
showDocument in interface AppletContext
Parameters:
url - address of desired document.
target - ignored

showStatus

public void showStatus(String status)
Display a message in the applet status area

Specified by:
showStatus in interface AppletContext
Parameters:
status - the message to be displayed