All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----java.util.Observable | +----edu.cornell.lassp.mck10.ConfigurePack.Configurable
Configurable is an abstract class which provides the functionality necessary for a variable to be configured in a number of ways:
set(string val)
method
Every Configurable variable belongs to a tree which gives it a unique name for the purpose of interpreting PARAM tags, and any other purpose where a variable must be uniquely identified. This tree also provides the variable with its position in the menu structure. In order to determine its position in the tree, each variable has a parent of type ConfigurableCollection. ConfigurableCollection is a subclass of Configurable which contains links to other Configurable's and provides functionality for displaying configure menus and interpreting param tags, environment variables, etc.
All configurables must be able to set their values through a
set(string val)
method, and to return their value as a
string through a toString()
method.
Source code
is available.
addCheck(check)
adds the object check
to the
list of objects which must approve changes in the value of the
variable.
addObserver(obs)
is overridden to make the notification of
observers more eficcient, and more predictable.
attributeIsSet(int)
method is used to check whether an
attribute has been set.
attributeSet(int)
method is used to set an attribute.
attributeUnSet(int)
method is used to unset an attribute.
checkValue(value)
asks all the registered
CheckConfigurable
instances whether the value of the
variable can be changed to value
.
deleteCheck(check)
removes the object check
from the list of objects which must approve changes in the value of
the variable.
deleteObserver(obs)
is overridden to make the notification
of observers more eficcient, and more predictable.
deleteObservers()
removes all observers from the
notification list.
getFullName()
method is used to get the full, unique
name of a variable.
getLongName()
method is used to get the long name
of a variable.
getShortName()
method is used to get the short name
of a variable.
notifyObservers(arg)
notifies all observers in the order in
which they were added.
notifyObservers()
notifies all observers in the order in
which they were added.
set(String val)
abstract method is used to set the
value of a variable.
setLongName(String)
method is used to reset the long
name of a variable.
toString()
abstract method is used to get the value
of the variable as a string.
public final static int LOCKED
public final static int INVISIBLE
public final static int IGNORE_PARAMS
public final static int MENU_LOCKED
protected Vector observers
protected int numObservers
protected Vector checkList
protected int numChecks
public Configurable(ConfigurableCollection parent, String shortName, String longName, int Att, String defaultVal)
public abstract boolean set(String val)
set(String val)
abstract method is used to set the
value of a variable.
public abstract String toString()
toString()
abstract method is used to get the value
of the variable as a string.
public boolean attributeIsSet(int Att)
attributeIsSet(int)
method is used to check whether an
attribute has been set.
true
if the attribute is set, and false
if it is not set.
public void attributeUnSet(int Att)
attributeUnSet(int)
method is used to unset an attribute.
public void attributeSet(int Att)
attributeSet(int)
method is used to set an attribute.
public String getFullName()
getFullName()
method is used to get the full, unique
name of a variable.
public String getLongName()
getLongName()
method is used to get the long name
of a variable.
public void setLongName(String longName)
setLongName(String)
method is used to reset the long
name of a variable.
public String getShortName()
getShortName()
method is used to get the short name
of a variable.
protected Frame newFrame()
public void displayFrame()
Configurable
class provides
a default frame, which can be used to modify any type of
configurable which has properly implemented toString()
and
set(String)
methods.
public void hideFrame()
public Component createConfigureComponent()
public final void addObserver(Observer obs)
addObserver(obs)
is overridden to make the notification of
observers more eficcient, and more predictable. It simply adds an
observer to the list of observers to be notified. The observers are
always notified in the order in which they were added. The method
is declared final so that it can be inlined.
public final void deleteObserver(Observer obs)
deleteObserver(obs)
is overridden to make the notification
of observers more eficcient, and more predictable. It will delete
the observer from the list of observers to be notified.
public final void deleteObservers()
deleteObservers()
removes all observers from the
notification list.
public final void notifyObservers(Object arg)
notifyObservers(arg)
notifies all observers in the order in
which they were added. The parameter arg
is passed to
the observers as the second parameter of the update method.
public final void notifyObservers()
notifyObservers()
notifies all observers in the order in
which they were added.
public void addCheck(CheckConfigurable check)
addCheck(check)
adds the object check
to the
list of objects which must approve changes in the value of the
variable.
CheckConfigurable
to be added.
public void deleteCheck(CheckConfigurable check)
deleteCheck(check)
removes the object check
from the list of objects which must approve changes in the value of
the variable.
CheckConfigurable
to be removed.
public boolean checkValue(Object value)
checkValue(value)
asks all the registered
CheckConfigurable
instances whether the value of the
variable can be changed to value
. If any of them
return false, checkValue
returs false. If they all
return true, checkValue
returns true, and the value
is accepted.
All Packages Class Hierarchy This Package Previous Next Index