UniVista.beans
Class VariableBean

java.lang.Object
  |
  +--UniVista.support.Variable
        |
        +--UniVista.beans.VariableBean
All Implemented Interfaces:
java.lang.Cloneable, ConsistencyCheck, java.util.EventListener, java.beans.PropertyChangeListener, java.io.Serializable, TypedVariable
Direct Known Subclasses:
ArrayVariable, BooleanVariable, ComplexVariable, FloatVariable, LongVariable, ShortVariable, StringVariable, VariableBean2

public abstract class VariableBean
extends Variable
implements java.lang.Cloneable, java.io.Serializable, TypedVariable, java.beans.PropertyChangeListener

This class adds more functionality to the Variable class so they can be used as Beans.

See Also:
Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changeSupport
           
static java.lang.String DEFAULT_DISPLAY
           
protected  java.beans.VetoableChangeSupport vetoSupport
           
 
Fields inherited from class UniVista.support.Variable
description, documentationURL, name, namelistGroup, type, typedVariable, typeNames, UV_ARRAY, UV_BOOLEAN, UV_COMPLEX, UV_FLOAT, UV_LONG, UV_SHORT, UV_STRING, UV_TYPE, variableOptionsUI, variableUI
 
Constructor Summary
VariableBean()
          Default zero-argument constructor.
 
Method Summary
 void addDisplayBean(java.lang.String name, java.lang.String className)
          Add a new display bean class to the object
 void addPropertyChangeListener(java.beans.PropertyChangeListener x)
          Register any property listeners.
 void addVetoableChangeListener(java.beans.VetoableChangeListener x)
          Register any vetoable property listeners.
 void duplicate(VariableBean newInfo)
          duplicate the information from another Variable into this one
 boolean equals(java.lang.Object obj)
          Compare two variable objects
 java.lang.Object getDisplayBean(java.lang.String beanName)
          This method returns a new bean with the name given.
 java.lang.String[] getDisplayBeans()
          Return the bean classes as an array of strings
abstract  java.lang.Object getValue()
          The subclass must override this.
 void propertyChange(java.beans.PropertyChangeEvent event)
          This method is activated when a property change occurs.
 void removePropertyChangeListener(java.beans.PropertyChangeListener x)
          Disassociate any property listeners that have been previously registered.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener x)
          Disassociate any vetoable property listeners that have been previously registered.
 void setDescription(java.lang.String newDesc)
          Set the short description
 void setDisplayBeans(java.util.Hashtable newBeans)
          This method changes the Vector.
 void setDisplayBeans(java.lang.String[] beanNames, java.lang.String[] beanClassNames)
          This method changes the displayable Bean classes.
 void setDocumentationURL(java.lang.String newDoc)
          Change the URL of the documentation
 void setName(java.lang.String newName)
          Set the variable's name
 void setNamelistGroup(java.lang.String newGroup)
          Change the namelistGroup property
 void setType(int newType)
          Set the fundamental type
abstract  void setValue(java.lang.Object obj)
          This must be implemented, since it is dependant on the data.
abstract  void setValue(java.lang.String strng)
           
abstract  java.lang.String toString()
           
abstract  java.lang.String valOk(java.lang.String theValue)
           
 
Methods inherited from class UniVista.support.Variable
clone, consistencyCheck, duplicate, getDescription, getDocumentationURL, getName, getNamelistGroup, getType, isLowerBoundEnabled, isTypedVariable, isUpperBoundEnabled, isVariableOptionsUI, isVariableUI, setLowerBound, setLowerBoundEnabled, setUpperBound, setUpperBoundEnabled
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DISPLAY

public static final java.lang.String DEFAULT_DISPLAY

changeSupport

protected java.beans.PropertyChangeSupport changeSupport

vetoSupport

protected java.beans.VetoableChangeSupport vetoSupport
Constructor Detail

VariableBean

public VariableBean()
Default zero-argument constructor. Used to conform to Bean standards.
Method Detail

addDisplayBean

public void addDisplayBean(java.lang.String name,
                           java.lang.String className)
Add a new display bean class to the object

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener x)
Register any property listeners.

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener x)
Register any vetoable property listeners.

duplicate

public void duplicate(VariableBean newInfo)
duplicate the information from another Variable into this one

equals

public boolean equals(java.lang.Object obj)
Compare two variable objects
Overrides:
equals in class Variable

getDisplayBean

public java.lang.Object getDisplayBean(java.lang.String beanName)
This method returns a new bean with the name given.
Parameters:
beanName - java.lang.String
Returns:
java.lang.Object

getDisplayBeans

public java.lang.String[] getDisplayBeans()
Return the bean classes as an array of strings

getValue

public abstract java.lang.Object getValue()
The subclass must override this.
Specified by:
getValue in interface TypedVariable

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
This method is activated when a property change occurs. This bean must register itself as a listener with another bean for this to work.
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
event - java.beans.PropertyChangeEvent

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener x)
Disassociate any property listeners that have been previously registered.

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener x)
Disassociate any vetoable property listeners that have been previously registered.

setDescription

public void setDescription(java.lang.String newDesc)
Set the short description
Overrides:
setDescription in class Variable

setDisplayBeans

public void setDisplayBeans(java.lang.String[] beanNames,
                            java.lang.String[] beanClassNames)
This method changes the displayable Bean classes.
Parameters:
beans - java.lang.String[]

setDisplayBeans

public void setDisplayBeans(java.util.Hashtable newBeans)
This method changes the Vector.
Parameters:
newBeans - java.util.Vector

setDocumentationURL

public void setDocumentationURL(java.lang.String newDoc)
Change the URL of the documentation
Overrides:
setDocumentationURL in class Variable

setName

public void setName(java.lang.String newName)
Set the variable's name
Overrides:
setName in class Variable

setNamelistGroup

public void setNamelistGroup(java.lang.String newGroup)
Change the namelistGroup property
Overrides:
setNamelistGroup in class Variable

setType

public void setType(int newType)
Set the fundamental type
Overrides:
setType in class Variable
Following copied from class: UniVista.support.Variable
Parameters:
newType - should be one of the type constants defined in this class

setValue

public abstract void setValue(java.lang.Object obj)
                       throws TypedVariableException
This must be implemented, since it is dependant on the data.
Specified by:
setValue in interface TypedVariable

setValue

public abstract void setValue(java.lang.String strng)
                       throws TypedVariableException

valOk

public abstract java.lang.String valOk(java.lang.String theValue)