|
UC Berkeley Group for User Interface Research Updated November 17, 2000 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.berkeley.guir.lib.properties.FlexProperties
Extensible and definable properties. Properties are specified through a
PropertySchema
object, and are set in this class.
The PropertySchema
defines a single schema for a property. For
example, it specifies the name of the property, and whether it is a simple
one, bound, constrained, or indexed.
Simple, bound, constrained, and indexed properties are the same as in Java Beans.
Property Change listeners
Veto Change listeners
first,
and then Property Change Listeners
The FlexProperties contains a set of PropertySchema objects, as well as the values for properties. When properties are set or modified, the schema is checked at runtime to ensure that everything is okay. If it is, then the property value is modified, and the appropriate listeners are notified.
This software is distributed under the Berkeley Software License.
Revisions: - GUIRLib-v1.0-1.0.0, Jun 02 2000, JH Created class - GUIRLib-v1.2-1.0.0, Jun 22 2000, JH Touched for GUIRLib release - GUIRLib-v1.3-1.0.0, Aug 11 2000, JH Touched for GUIRLib release - GUIRLib-v1.4-1.0.0, Aug 31 2000, JH Touched for GUIRLib release
Fields inherited from interface edu.berkeley.guir.lib.properties.PropertyConstants |
PROPERTY_BOUND, PROPERTY_CONSTRAINED, PROPERTY_INDEXED, PROPERTY_SIMPLE |
Constructor Summary | |
FlexProperties()
Creates a new properties object, points to itself as the source. |
|
FlexProperties(Object src)
Creates a new properties object. |
|
FlexProperties(Object src,
boolean flag)
Creates a new properties object that only allows a specified schema. |
Method Summary | |
void |
addIndexedProperty(String strPropertyName,
Object newVal)
Add a value to the back of the specified indexed property. |
void |
addPropertyChangeListener(PropertyChangeListener l)
Add a listener on a bound property. |
void |
addPropertyChangeListener(String str,
PropertyChangeListener l)
Add a listener on a bound property. |
void |
addSchema(PropertySchema schema)
Add a schema. |
void |
addVetoableChangeListener(String str,
VetoableChangeListener l)
Add a listener on a constrained property. |
void |
addVetoableChangeListener(VetoableChangeListener l)
Add a listener on a constrained property. |
void |
clearIndexedProperty(String strPropertyName)
Clear out all of the values from the specified indexed property. |
boolean |
containsSchema(PropertySchema schema)
Check if it contains a certain schema. |
boolean |
containsSchema(String strPropertyName)
Check if it contains a certain schema. |
void |
disableNotify()
|
void |
disableNotify(String strProperty)
|
void |
enableNotify()
Enable notifications to be sent. |
void |
enableNotify(String strProperty)
Enable notifications on the specified property. |
void |
firePropertyChange(PropertyChangeEvent evt)
Fire if property is enabled. |
void |
firePropertyChange(String str,
boolean oldVal,
boolean newVal)
Convenience method, see firePropertyChange(PropertyChangeEvent) |
void |
firePropertyChange(String str,
int oldVal,
int newVal)
Convenience method, see firePropertyChange(PropertyChangeEvent) |
void |
firePropertyChange(String str,
Object oldVal,
Object newVal)
Convenience method, see firePropertyChange(PropertyChangeEvent) |
void |
fireVetoableChange(PropertyChangeEvent evt)
Fire if property is enabled. |
void |
fireVetoableChange(String str,
boolean oldVal,
boolean newVal)
Convenience method, see fireVetoableChange(PropertyChangeEvent) |
void |
fireVetoableChange(String str,
int oldVal,
int newVal)
Convenience method, see fireVetoableChange(PropertyChangeEvent) |
void |
fireVetoableChange(String str,
Object oldVal,
Object newVal)
Convenience method, see fireVetoableChange(PropertyChangeEvent) |
List |
getIndexedProperty(String strPropertyName)
Get all of an indexed property. |
Object |
getIndexedProperty(String strPropertyName,
int index)
Get an indexed property at the specified index. |
Object |
getProperty(String strPropertyName)
Get a reference to a property. |
Iterator |
getPropertyNames()
|
PropertySchema |
getSchema(String strPropertyName)
Get a reference to the property schema by its property name. |
boolean |
isEnabled()
See if notifications are enabled in general. |
boolean |
isEnabled(String strProperty)
See if notifications are enabled on the specified property. |
List |
removeIndexedProperty(String strPropertyName)
Remove an indexed property entirely. |
Object |
removeIndexedProperty(String strPropertyName,
int index)
Remove a value from the specified indexed property. |
Object |
removeProperty(String strPropertyName)
Remove a property. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a listener on a bound property. |
void |
removePropertyChangeListener(String str,
PropertyChangeListener l)
Remove a listener on a bound property. |
PropertySchema |
removeSchema(PropertySchema schema)
Remove a schema. |
void |
removeVetoableChangeListener(String str,
VetoableChangeListener l)
Remove a listener on a constrained property. |
void |
removeVetoableChangeListener(VetoableChangeListener l)
Remove a listener on a constrained property. |
void |
setDefaultPropertyType(int type)
Sets the default schema type of all properties created in this instance. |
void |
setIndexedProperty(String strPropertyName,
int index,
Object newVal)
Set a value in the specified indexed property. |
void |
setProperty(String strPropertyName,
Object newVal)
Set a property. |
void |
setSourceObject(Object obj)
Set who this properties object is attached to. |
void |
setSpecifiedOnly(boolean flag)
Set whether we accept properties that have been specified in the schema only or not. |
String |
toString()
Print out schema and properties. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public FlexProperties()
public FlexProperties(Object src)
src
- is the Object this FlexProperties object represents
(ie who contains the FlexProperties).public FlexProperties(Object src, boolean flag)
flag
- is true if only specified properties are accepted.src
- is the Object this FlexProperties object represents
(ie who contains the FlexProperties).setSpecifiedOnly(boolean)
Method Detail |
public void setSourceObject(Object obj)
public void setSpecifiedOnly(boolean flag)
flag
- is true if only specified properties are accepted.public void setDefaultPropertyType(int type)
type
- is either PropertyConstants.PROPERTY_SIMPLE
, PropertyConstants.PROPERTY_BOUND
,
or PropertyConstants.PROPERTY_CONSTRAINED
. Don't use
PropertyConstants.PROPERTY_INDEXED
, since that is used automatically
if one of the indexed property methods is used.public void addSchema(PropertySchema schema)
public PropertySchema removeSchema(PropertySchema schema)
public PropertySchema getSchema(String strPropertyName)
public boolean containsSchema(PropertySchema schema)
public boolean containsSchema(String strPropertyName)
public void enableNotify()
disableNotify()
method call, otherwise an exception will
be thrown.RuntimeException
- if there are an un-balanced number of disable
and enable calls.public void enableNotify(String strProperty)
RuntimeException
- if there are an un-balanced number of disable
and enable calls.public boolean isEnabled()
public boolean isEnabled(String strProperty)
public void disableNotify()
enableNotify()
public void disableNotify(String strProperty)
enableNotify(String)
public void firePropertyChange(PropertyChangeEvent evt)
isEnabled()
,
isEnabled(String)
public void firePropertyChange(String str, boolean oldVal, boolean newVal)
firePropertyChange(PropertyChangeEvent)
public void firePropertyChange(String str, int oldVal, int newVal)
firePropertyChange(PropertyChangeEvent)
public void firePropertyChange(String str, Object oldVal, Object newVal)
firePropertyChange(PropertyChangeEvent)
public void fireVetoableChange(PropertyChangeEvent evt) throws PropertyVetoException
isEnabled()
,
isEnabled(String)
public void fireVetoableChange(String str, boolean oldVal, boolean newVal) throws PropertyVetoException
fireVetoableChange(PropertyChangeEvent)
public void fireVetoableChange(String str, int oldVal, int newVal) throws PropertyVetoException
fireVetoableChange(PropertyChangeEvent)
public void fireVetoableChange(String str, Object oldVal, Object newVal) throws PropertyVetoException
fireVetoableChange(PropertyChangeEvent)
public Iterator getPropertyNames()
public Object getProperty(String strPropertyName)
public void setProperty(String strPropertyName, Object newVal)
If setSpecifiedOnly(boolean)
is set to false (which it is by
default), then a property schema will be created. The type of this
new schema is normally PropertyConstants.PROPERTY_SIMPLE
unless another one is
specified by setDefaultPropertyType(int)
.
public Object removeProperty(String strPropertyName)
public List getIndexedProperty(String strPropertyName)
public Object getIndexedProperty(String strPropertyName, int index)
IndexOutOfBoundsException
- if out of bounds.public void setIndexedProperty(String strPropertyName, int index, Object newVal)
IndexOutOfBoundsException
- if out of bounds.public void addIndexedProperty(String strPropertyName, Object newVal)
If setSpecifiedOnly(boolean)
is set to false (which it is by
default), then an indexed property schema will be created.
public Object removeIndexedProperty(String strPropertyName, int index)
IndexOutOfBoundsException
- if out of bounds.public List removeIndexedProperty(String strPropertyName)
public void clearIndexedProperty(String strPropertyName)
public void addPropertyChangeListener(PropertyChangeListener l)
public void addPropertyChangeListener(String str, PropertyChangeListener l)
public void removePropertyChangeListener(PropertyChangeListener l)
public void removePropertyChangeListener(String str, PropertyChangeListener l)
public void addVetoableChangeListener(VetoableChangeListener l)
public void addVetoableChangeListener(String str, VetoableChangeListener l)
public void removeVetoableChangeListener(VetoableChangeListener l)
public void removeVetoableChangeListener(String str, VetoableChangeListener l)
public String toString()
toString
in class Object
|
Copyright Information | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |