edu.washington.cs.supple.rep
Interface UiObject

All Superinterfaces:
ConstraintManipulation, java.util.EventListener, java.beans.PropertyChangeListener, SuppleBean, SuppleUiObjectHierarchyElement
All Known Subinterfaces:
PrimitiveShortcut, StateVar, UiAction, UiAlternative
All Known Implementing Classes:
StateVarImpl, UiActionImpl, UiAlternativeImpl, UiObjectImpl

public interface UiObject
extends SuppleUiObjectHierarchyElement, SuppleBean, java.util.EventListener, java.beans.PropertyChangeListener, ConstraintManipulation

Author:
kgajos

Method Summary
 void accept(UiVisitor visitor)
          Accept a UiVisitor.
 void childChanged()
          Called by a child object if something in it or below it changes
 boolean equals(java.lang.Object o)
          Based on the uid
 java.io.Serializable getInterfaceIdentifier()
          Produces an object that uniquely identifies this interface; this identifier remains the same across sessions and is based on the structure of the interface.
 java.lang.String getTextLabel()
          Get the text label for the object
 SuppleType getType()
          Returns the Supple type of this object
 int getUniqueId()
          Returns a unique id of this instantiation.
 RenderedView getView()
          Returns the view that shows this UI object; usuall only the root knows directly abou the view so this object may need to ask up the hierarchy to get the information
 int hashCode()
          Based on the uid
 boolean hasTextLabel()
          Lets you check if the object has a meaningful text label
 boolean isActive()
          UiObjects (well, really StateVars and UiActions) can become inactive if some preconditions are not satisfied (e.g., you cannot execute an action, if it's parameters are not set).
 boolean isLeaf()
          A convenience method -- returns true if the corresponding type has no children (state vars or actions)
 boolean isModifiable()
           
 boolean isRuntime()
          Runtime objects are created on the fly to represent dynamic data objects -- they are unlikely to appear in other instances of the UI; their names are instance-specific
 void setActive(boolean a)
          Lets you manually set the active state of a UiObject.
 void setRuntime(boolean r)
           
 void setView(RenderedView view)
          Tells this object what view shows it -- should only be called by RenderedView objects themselves
 java.lang.String toPrettyString(java.lang.String pref)
           
 java.lang.String toString()
           
 
Methods inherited from interface edu.washington.cs.supple.rep.SuppleUiObjectHierarchyElement
getAncestors, getFullName, getName, getParent, getParentObject, getRootObject, isChildOf, isDescendantOf, isRoot, setName, setParent
 
Methods inherited from interface edu.washington.cs.supple.rep.SuppleBean
addPropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface edu.washington.cs.supple.rep.ConstraintManipulation
addRenderingConstraint, addRenderingHint, getRenderingConstraints, getRenderingHints
 

Method Detail

isActive

public boolean isActive()
UiObjects (well, really StateVars and UiActions) can become inactive if some preconditions are not satisfied (e.g., you cannot execute an action, if it's parameters are not set). This method lets you check if a UiObject is active.

Returns:
true if active, false otherwise

setActive

public void setActive(boolean a)
Lets you manually set the active state of a UiObject. If the UiObject is bound to a value it may be switched back.

Parameters:
a -

getType

public SuppleType getType()
Returns the Supple type of this object

Returns:
the type of this object

getView

public RenderedView getView()
Returns the view that shows this UI object; usuall only the root knows directly abou the view so this object may need to ask up the hierarchy to get the information

Returns:
the view that shows this object

setView

public void setView(RenderedView view)
Tells this object what view shows it -- should only be called by RenderedView objects themselves

Parameters:
view - the view that shows this object

isLeaf

public boolean isLeaf()
A convenience method -- returns true if the corresponding type has no children (state vars or actions)

Returns:
true if leaf, false otherwise

getTextLabel

public java.lang.String getTextLabel()
Get the text label for the object


hasTextLabel

public boolean hasTextLabel()
Lets you check if the object has a meaningful text label

Returns:
true if text label is not null and at least one char long; false otherwise

getInterfaceIdentifier

public java.io.Serializable getInterfaceIdentifier()
Produces an object that uniquely identifies this interface; this identifier remains the same across sessions and is based on the structure of the interface. At the moment it just returns the string signature.

Returns:
the identifying object

isRuntime

public boolean isRuntime()
Runtime objects are created on the fly to represent dynamic data objects -- they are unlikely to appear in other instances of the UI; their names are instance-specific

Returns:
true if this is a runtime object, false otherwise

setRuntime

public void setRuntime(boolean r)

isModifiable

public boolean isModifiable()

hashCode

public int hashCode()
Based on the uid

See Also:
Object.hashCode()

equals

public boolean equals(java.lang.Object o)
Based on the uid

See Also:
Object.equals(java.lang.Object)

childChanged

public void childChanged()
Called by a child object if something in it or below it changes


getUniqueId

public int getUniqueId()
Returns a unique id of this instantiation.

Returns:
unique id

accept

public void accept(UiVisitor visitor)
Accept a UiVisitor.


toString

public java.lang.String toString()

toPrettyString

public java.lang.String toPrettyString(java.lang.String pref)