Class DirectiveManager

java.lang.Object
   |
   +----DirectiveManager

public class DirectiveManager
extends Object
This class is sort of a "rendering engine" for the scrolling text. It takes a TextScroll for an argument, and provides one method, performDirective. It is used to handle the directives independant of the applet.


Variable Index

 o directives
The set of supported directives.
 o VERSION
The current version of this class.

Constructor Index

 o DirectiveManager(TextScroll)
Constructor.

Method Index

 o performDirective(String)
This method actually handles the directives.
 o supportedDirective(String)
This method is used to determine whether or not a directive the user is attempting to use is supported.

Variables

 o VERSION
 public static final String VERSION
The current version of this class.

 o directives
 public static final String directives[]
The set of supported directives.

Constructors

 o DirectiveManager
 public DirectiveManager(TextScroll applet)
Constructor.

Parameters:
applet - The TextScroll object to invoke the methods in when handling directives.

Methods

 o performDirective
 public boolean performDirective(String directive)
This method actually handles the directives. It will not use reflection, making this class Java 1.0 capable. Note that it also does not use any deprecated methods, so it manages to stay neutral. This same class can be used with both the Java 1.0 and Java 1.1 versions.

Parameters:
directive - The actual directive to perform. This is the string read directly from the text data file, with or without the two leading caret symbols. This is simply a method name, followed by 0 or more whitespace, followed by a "(" character, then a string argument, then a ")" character.
Returns:
true if the directive could successfully be handled, false if it could not.
 o supportedDirective
 public static boolean supportedDirective(String methodName)
This method is used to determine whether or not a directive the user is attempting to use is supported. This is done for security reasons, to protect the user from accidentally calling methods they shouldn't be in Applet and its superclasses.

Parameters:
methodName - the name of the method the user is trying to use.
Returns:
true if the user is permitted to call the named method, false otherwise.