UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.gesture
Class DefaultGestureObject

java.lang.Object
  |
  +--java.util.Observable
        |
        +--edu.berkeley.guir.lib.gesture.DefaultGestureObject
All Implemented Interfaces:
Cloneable, GestureObject
Direct Known Subclasses:
AbstractGestureContainer, Gesture

public class DefaultGestureObject
extends Observable
implements GestureObject, Cloneable

A default implementation of a GestureObject.


Field Summary
protected  String author
           
protected  GestureContainer parent
           
protected  PropertyChangeSupport propChangeSupport
           
protected  Map properties
           
 
Fields inherited from interface edu.berkeley.guir.lib.gesture.GestureObject
AUTHOR_PROP, ENABLED_PROP, PARENT_PROP
 
Constructor Summary
DefaultGestureObject()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Listen for all propertyChangeEvents
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Listen for propertyChangeEvents for a particular property
 Object clone()
          Deep-copies properties.
 String getAuthor()
           
 GestureContainer getParent()
           
 Object getProperty(String name)
          Get the value of the named property (or null if it is not set).
 boolean hasProperty(String name)
          Returns whether the object has the current property set
 boolean isEnabled()
           
 void readProperties(TokenReader reader)
           
 void removePropertyChangeListener(PropertyChangeListener listener)
          Stop listening for all propertyChangeEvents
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Stop listening for propertyChangeEvents for a particular property
 void setAuthor(String a)
          emits property change for property AUTHOR_PROP
 void setEnabled(boolean on)
          emits property change for property ENABLED_PROP
 void setParent(GestureContainer p)
          emits property change for property PARENT_PROP
 void setProperty(String name, Object value)
          Set the named property to a value.
 void unsetProperty(String name)
          Unset the property.
 void writeProperties(Writer writer)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

author

protected String author

parent

protected transient GestureContainer parent

properties

protected Map properties

propChangeSupport

protected transient PropertyChangeSupport propChangeSupport
Constructor Detail

DefaultGestureObject

public DefaultGestureObject()
Method Detail

setAuthor

public void setAuthor(String a)
Description copied from interface: GestureObject
emits property change for property AUTHOR_PROP
Specified by:
setAuthor in interface GestureObject

getAuthor

public String getAuthor()
Specified by:
getAuthor in interface GestureObject

setParent

public void setParent(GestureContainer p)
Description copied from interface: GestureObject
emits property change for property PARENT_PROP
Specified by:
setParent in interface GestureObject

getParent

public GestureContainer getParent()
Specified by:
getParent in interface GestureObject

setEnabled

public void setEnabled(boolean on)
Description copied from interface: GestureObject
emits property change for property ENABLED_PROP
Specified by:
setEnabled in interface GestureObject

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface GestureObject

hasProperty

public boolean hasProperty(String name)
Description copied from interface: GestureObject
Returns whether the object has the current property set
Specified by:
hasProperty in interface GestureObject

setProperty

public void setProperty(String name,
                        Object value)
Description copied from interface: GestureObject
Set the named property to a value. Null is not allowed as a key or value.
Specified by:
setProperty in interface GestureObject

unsetProperty

public void unsetProperty(String name)
Description copied from interface: GestureObject
Unset the property. Unsetting an already unset property has no effect. Predefined properties (e.g., author and enabled) cannot be removed and attempting to do so will result in an error.
Specified by:
unsetProperty in interface GestureObject

getProperty

public Object getProperty(String name)
Description copied from interface: GestureObject
Get the value of the named property (or null if it is not set).
Specified by:
getProperty in interface GestureObject

clone

public Object clone()
Deep-copies properties. Note that a clone does not have a parent (since the parent doesn't have the clone as a child).
Specified by:
clone in interface GestureObject
Overrides:
clone in class Object

readProperties

public void readProperties(TokenReader reader)
                    throws IOException,
                           ParseException

writeProperties

public void writeProperties(Writer writer)
                     throws IOException

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: GestureObject
Listen for all propertyChangeEvents
Specified by:
addPropertyChangeListener in interface GestureObject

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)
Description copied from interface: GestureObject
Listen for propertyChangeEvents for a particular property
Specified by:
addPropertyChangeListener in interface GestureObject

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: GestureObject
Stop listening for all propertyChangeEvents
Specified by:
removePropertyChangeListener in interface GestureObject

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)
Description copied from interface: GestureObject
Stop listening for propertyChangeEvents for a particular property
Specified by:
removePropertyChangeListener in interface GestureObject

Copyright Information