Package com.bc.ceres.binding
Interface PropertySet
- All Superinterfaces:
PropertyChangeEmitter
- All Known Subinterfaces:
FigureStyle
- All Known Implementing Classes:
DefaultFigureStyle
,PropertyContainer
A loose aggregation of properties. Properties can be added to and removed from this set.
Property change events are fired whenever property values change.
The PropertySet
interface is based on the well-known Property List design pattern.
- Since:
- 0.10
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addProperties
(Property... properties) Adds the given properties to this set.void
addProperty
(Property property) Adds a property to this set.getDescriptor
(String name) Gets the descriptor for the named property.Property[]
Gets all properties currently contained in this set.getProperty
(String name) Gets the named property.<T> T
Gets the value of the named property.boolean
isPropertyDefined
(String name) Tests if the named property is defined in this set.void
removeProperties
(Property... properties) Removes the given properties from this set.void
removeProperty
(Property property) Removes a property from this set.void
Sets all properties to their default values.void
Sets the value of the named property.Methods inherited from interface com.bc.ceres.binding.PropertyChangeEmitter
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
-
Method Details
-
getProperties
Property[] getProperties()Gets all properties currently contained in this set.- Returns:
- The array of properties, which may be empty.
-
isPropertyDefined
Tests if the named property is defined in this set. For undefined properties, the methodgetProperty(name)
will always returnnull
.- Parameters:
name
- The property name or the property's alias name (both case sensitive).- Returns:
true
if the property is defined.
-
getProperty
Gets the named property.- Parameters:
name
- The property name or the property's alias name (both case sensitive).- Returns:
- The property, or
null
if the property does not exist. - See Also:
-
addProperty
Adds a property to this set.- Parameters:
property
- The property.
-
addProperties
Adds the given properties to this set.- Parameters:
properties
- The properties to be added.
-
removeProperty
Removes a property from this set.- Parameters:
property
- The property.
-
removeProperties
Removes the given properties from this set.- Parameters:
properties
- The properties to be removed.
-
getValue
Gets the value of the named property.- Parameters:
name
- The property name.- Returns:
- The property value or
null
if a property with the given name does not exist. - Throws:
ClassCastException
- if the value is not of the requested type.
-
setValue
Sets the value of the named property.- Parameters:
name
- The property name.value
- The new property value.- Throws:
IllegalArgumentException
- If the value is illegal. The cause will always be aValidationException
.
-
setDefaultValues
Sets all properties to their default values.- Throws:
IllegalStateException
- If at least one of the default values is illegal. The cause will always be aValidationException
.- Since:
- Ceres 0.12
- See Also:
-
getDescriptor
Gets the descriptor for the named property.- Parameters:
name
- The property name (case sensitive).- Returns:
- The descriptor, or
null
if the property is unknown.
-