UniVista.beans
Class VariableDisplay

java.lang.Object
  |
  +--UniVista.beans.VariableDisplay
All Implemented Interfaces:
java.util.EventListener, java.beans.PropertyChangeListener, java.io.Serializable, VariableUI
Direct Known Subclasses:
ArrayVariableDisplay, BooleanVariableDisplay, SimpleVariableDisplay

public abstract class VariableDisplay
extends java.lang.Object
implements VariableUI, java.beans.PropertyChangeListener, java.io.Serializable

A bean that implements VariableUI, so that Variables may use subclasses of this as UI plug-ins.

See Also:
Serialized Form

Field Summary
protected  java.beans.PropertyChangeSupport changeSupport
           
protected  javax.swing.JLabel label
           
static java.lang.String name
           
protected  javax.swing.JPanel panel
           
 
Constructor Summary
VariableDisplay()
          Default zero-argument constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener x)
          Register any property listeners.
 void destroyUI()
          Clean up the UI components.
 java.awt.Rectangle getBounds()
          Return the current bounds of the UI element.
 java.lang.String getLabelPosition()
          Get the orientation of the label.
 java.lang.String getLabelText()
          Get the label data.
 java.lang.String getName()
          This method returns a descriptive name of the type of display this is.
 java.awt.Rectangle getPreferredBounds()
          Return the recommended bounds for the UI element.
 java.awt.Dimension getPreferredSize()
          Returns the width and height suggested.
 javax.swing.JComponent getUI()
          Get a reference to the bean's UI component.
abstract  java.lang.Object getValue()
          Get data for the visual component.
 boolean isLabelVisible()
          Check if the Variable name label is enabled.
 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 setDesignMode(boolean isDesigning)
          Informs the variable whether the UI is being utilized in design mode.
 void setLabelPosition(java.lang.String pos)
          Adjust the orientation of the label.
 void setLabelText(java.lang.String label)
          Set the label.
 void setLabelVisible(boolean onOrOff)
          Enable or disable the Variable name label
 void setName(java.lang.String s)
          Symmetric with getName().
 void setReadOnly(boolean isReadOnly)
          Informs the variable whether it should make its UI read-only or not.
 void setToolTipEnabled(boolean enable)
          Enable or disable the tool tip for this UI.
 void setToolTipText(java.lang.String s)
          Pass the String that should be used as the tool tip.
abstract  void setValue(java.lang.Object obj)
          Pass any Variable specific data for the visual component to modify its display.
 void validate()
          Since these displays are not managed by real Layout managers, we need to manually resize ourselves.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface UniVista.support.VariableUI
accept, reset, revert, setupUI
 

Field Detail

name

public static java.lang.String name

label

protected transient javax.swing.JLabel label

panel

protected transient javax.swing.JPanel panel

changeSupport

protected java.beans.PropertyChangeSupport changeSupport
Constructor Detail

VariableDisplay

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

addPropertyChangeListener

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

destroyUI

public void destroyUI()
Clean up the UI components.
Specified by:
destroyUI in interface VariableUI

getBounds

public java.awt.Rectangle getBounds()
Return the current bounds of the UI element.
Specified by:
getBounds in interface VariableUI

isLabelVisible

public boolean isLabelVisible()
Check if the Variable name label is enabled.

getName

public java.lang.String getName()
This method returns a descriptive name of the type of display this is.
Returns:
java.lang.String

setName

public void setName(java.lang.String s)
Symmetric with getName().

getPreferredBounds

public java.awt.Rectangle getPreferredBounds()
Return the recommended bounds for the UI element. We'll use a width or height of -1 to indicate that that bounds is flexible.
Specified by:
getPreferredBounds in interface VariableUI

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the width and height suggested.
Specified by:
getPreferredSize in interface VariableUI

getUI

public javax.swing.JComponent getUI()
Get a reference to the bean's UI component.
Specified by:
getUI in interface VariableUI

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.

setDesignMode

public void setDesignMode(boolean isDesigning)
Informs the variable whether the UI is being utilized in design mode.
Specified by:
setDesignMode in interface VariableUI

setLabelText

public void setLabelText(java.lang.String label)
Set the label.

getLabelText

public java.lang.String getLabelText()
Get the label data.

setLabelPosition

public void setLabelPosition(java.lang.String pos)
Adjust the orientation of the label.
Parameters:
pos - This should correspond to the static fields of BorderLayout, such as BorderLayout.EAST.

getLabelPosition

public java.lang.String getLabelPosition()
Get the orientation of the label.

setLabelVisible

public void setLabelVisible(boolean onOrOff)
Enable or disable the Variable name label

setReadOnly

public void setReadOnly(boolean isReadOnly)
Informs the variable whether it should make its UI read-only or not.
Specified by:
setReadOnly in interface VariableUI

setToolTipEnabled

public void setToolTipEnabled(boolean enable)
Enable or disable the tool tip for this UI.

setToolTipText

public void setToolTipText(java.lang.String s)
Pass the String that should be used as the tool tip. It is recommended that the Variable's description is used.

getValue

public abstract java.lang.Object getValue()
                                   throws java.lang.Exception
Get data for the visual component. Remains to be implemented specifically to the subclass.

setValue

public abstract void setValue(java.lang.Object obj)
                       throws java.lang.Exception
Pass any Variable specific data for the visual component to modify its display. Remains to be implemented specifically to the subclass.

validate

public void validate()
Since these displays are not managed by real Layout managers, we need to manually resize ourselves.