Interface PropertySet

All Superinterfaces:
PropertyChangeEmitter
All Known Subinterfaces:
FigureStyle
All Known Implementing Classes:
DefaultFigureStyle, PropertyContainer

public interface PropertySet extends PropertyChangeEmitter
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 Details

    • getProperties

      Property[] getProperties()
      Gets all properties currently contained in this set.
      Returns:
      The array of properties, which may be empty.
    • isPropertyDefined

      boolean isPropertyDefined(String name)
      Tests if the named property is defined in this set. For undefined properties, the method getProperty(name) will always return null.
      Parameters:
      name - The property name or the property's alias name (both case sensitive).
      Returns:
      true if the property is defined.
    • getProperty

      Property getProperty(String name)
      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

      void addProperty(Property property)
      Adds a property to this set.
      Parameters:
      property - The property.
    • addProperties

      void addProperties(Property... properties)
      Adds the given properties to this set.
      Parameters:
      properties - The properties to be added.
    • removeProperty

      void removeProperty(Property property)
      Removes a property from this set.
      Parameters:
      property - The property.
    • removeProperties

      void removeProperties(Property... properties)
      Removes the given properties from this set.
      Parameters:
      properties - The properties to be removed.
    • getValue

      <T> T getValue(String name) throws ClassCastException
      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

      void setValue(String name, Object value) throws IllegalArgumentException
      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 a ValidationException.
    • setDefaultValues

      void setDefaultValues() throws IllegalStateException
      Sets all properties to their default values.
      Throws:
      IllegalStateException - If at least one of the default values is illegal. The cause will always be a ValidationException.
      Since:
      Ceres 0.12
      See Also:
    • getDescriptor

      PropertyDescriptor getDescriptor(String name)
      Gets the descriptor for the named property.
      Parameters:
      name - The property name (case sensitive).
      Returns:
      The descriptor, or null if the property is unknown.