| |
|
| java.lang.Object javax.media.jai.PropertySourceImpl javax.media.jai.WritablePropertySourceImpl
WritablePropertySourceImpl | public class WritablePropertySourceImpl extends PropertySourceImpl implements WritablePropertySource(Code) | | A utility implementation of the WritablePropertySource
interface. The same internal superclass data structures are used and
are supplemented by a PropertyChangeSupportJAI to handle
property event firing. All events fired by an instance of this class
will be PropertySourceChangeEvent s with an event source
equal to the object used to create the PropertyChangeSupportJAI
helper object. This object is user-specifiable at construction time or
automatically created when a PropertyChangeListener is
added or removed and the PropertyChangeSupportJAI specified
at construction was null .
See Also: CaselessStringKey See Also: PropertySource See Also: PropertySourceChangeEvent See Also: PropertySourceImpl See Also: WritablePropertySource See Also: PropertyChangeEmitter See Also: PropertyChangeSupportJAI since: JAI 1.1 |
Constructor Summary | |
public | WritablePropertySourceImpl() Constructs a WritablePropertySourceImpl instance with
no properties set. | public | WritablePropertySourceImpl(Map propertyMap, PropertySource source, PropertyChangeSupportJAI manager) Constructs a WritablePropertySourceImpl instance which
will derive properties from one or both of the supplied parameters.
The propertyMap and propertySource parameters
will be used to initialize the name-value and
name-PropertySource mappings, respectively.
Entries in the propertyMap object will be assumed
to be properties if the key is a String or a
CaselessStringKey . |
manager | protected PropertyChangeSupportJAI manager(Code) | | Helper object for bean-style property events. Its default
value is null which indicates that no events
are to be fired.
|
WritablePropertySourceImpl | public WritablePropertySourceImpl()(Code) | | Constructs a WritablePropertySourceImpl instance with
no properties set.
|
WritablePropertySourceImpl | public WritablePropertySourceImpl(Map propertyMap, PropertySource source, PropertyChangeSupportJAI manager)(Code) | | Constructs a WritablePropertySourceImpl instance which
will derive properties from one or both of the supplied parameters.
The propertyMap and propertySource parameters
will be used to initialize the name-value and
name-PropertySource mappings, respectively.
Entries in the propertyMap object will be assumed
to be properties if the key is a String or a
CaselessStringKey . The propertySource
object will be queried for the names of properties that it emits
but requests for associated values will not be made at this time
so as to to defer any calculation that such requests might provoke.
The case of property names will be retained but will be ignored
insofar as the name is used as a key to the property value.
Parameters: propertyMap - A Map from which to copy propertieswhich have keys which are either String s orCaselessStringKey s. Parameters: propertySource - A PropertySource from which toderive properties. Parameters: manager - The object which will actually fire the events.May be null in which case a defaultevent manager will be created as needed with thisobject as its event source. |
addProperties | public void addProperties(Map propertyMap)(Code) | | Copies from the supplied Map to the property set all
entries wherein the key is an instance of String
or CaselessStringKey . Values set by this means will
supersede any previously defined values of the respective properties.
All property values are copied by reference.
PropertySourceChangeEvents may be fired for each
property added. If the property was not previously defined the
old value of the property event will be
java.awt.Image.UndefinedProperty .
Parameters: propertyMap - A Map from which to copy propertieswhich have keys which are either String s orCaselessStringKey s. If null noproperties will be added. |
addProperties | public void addProperties(PropertySource propertySource)(Code) | | Adds a PropertySource to the
name-PropertySource mapping. The
actual property values are not requested at this time but instead
an entry for the name of each property emitted by the
PropertySource is added to the
name-PropertySource mapping. Properties defined by
this PropertySource supersede those of all other
previously added PropertySource s including that
specified at construction, if any. Note that this method will not
provoke any events as no properties will actually have changed.
Parameters: propertySource - A PropertySource from which toderive properties. If null nothing is done. |
addPropertyChangeListener | public void addPropertyChangeListener(PropertyChangeListener listener)(Code) | | Add a PropertyChangeListener to the listener list. The
listener is registered for all properties.
If the property event utility object was not set at construction,
then it will be initialized to a PropertyChangeSupportJAI
whose property event source is this object.
|
addPropertyChangeListener | public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code) | | Add a PropertyChangeListener for a specific property. The
listener will be invoked only when a call on
firePropertyChange names that specific property.
If the property event utility object was not set at construction,
then it will be initialized to a PropertyChangeSupportJAI
whose property event source is this object.
|
clearCachedProperties | public void clearCachedProperties()(Code) | | Clears from the name-value mapping all properties which were
derived from a source in the name-PropertySource mapping.
PropertySourceChangeEvents may be fired
for each stored property removed. In this case the new value
of the property event will be
java.awt.Image.UndefinedProperty .
|
clearProperties | public void clearProperties()(Code) | | Clears all properties from the PropertySource by
invoking removeProperty() with all known names.
PropertySourceChangeEvents may be fired
for each stored property removed. In this case the new value
of the property event will be
java.awt.Image.UndefinedProperty .
|
clearPropertyMap | public void clearPropertyMap()(Code) | | Clears the name-value mapping of all properties.
PropertySourceChangeEvents may be fired
for each stored property removed. In this case the new value
of the property event will be
java.awt.Image.UndefinedProperty .
|
clearPropertySourceMap | public void clearPropertySourceMap()(Code) | | Clears the name-PropertySource mapping.
No events will be fired.
|
getProperty | public Object getProperty(String propertyName)(Code) | | Returns the value of a property. If the property name is not
recognized, java.awt.Image.UndefinedProperty will
be returned.
If the requested name is found in the name-value mapping,
the corresponding value will be returned. Otherwise the
name-PropertySource mapping will be queried and the
value will be derived from the found PropertySource ,
if any. If the value is derived from a PropertySource ,
a record will be kept of this and this property will be referred to
as a "cached property". Derivation of the value from a
PropertySource rather than from the name-value
mapping may cause a PropertySourceChangeEvent to be fired.
Parameters: propertyName - the name of the property, as a String . the value of the property, as anObject , or the valuejava.awt.Image.UndefinedProperty . exception: IllegalArgumentException - if propertyName is null . |
removeProperty | public void removeProperty(String propertyName)(Code) | | Removes the named property from the PropertySource .
PropertySourceChangeEvents may be fired if the property
values is actually removed from the name-value mapping. In this case
the new value of the property event will be
java.awt.Image.UndefinedProperty .
Parameters: propertyName - the name of the property, as a String . Parameters: propertyValue - the property, as a general Object . exception: IllegalArgumentException - if propertyName is null . |
removePropertyChangeListener | public void removePropertyChangeListener(PropertyChangeListener listener)(Code) | | Remove a PropertyChangeListener from the listener list.
This removes a PropertyChangeListener that was registered
for all properties.
If the property event utility object was not set at construction,
then it will be initialized to a PropertyChangeSupportJAI
whose property event source is this object.
|
removePropertyChangeListener | public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code) | | Remove a PropertyChangeListener for a specific property.
If the property event utility object was not set at construction,
then it will be initialized to a PropertyChangeSupportJAI
whose property event source is this object.
|
removePropertySource | public void removePropertySource(PropertySource propertySource)(Code) | | Removes from the name-PropertySource mapping all entries
which refer to the supplied PropertySource .
|
setProperty | public void setProperty(String propertyName, Object propertyValue)(Code) | | Adds the property value associated with the supplied name to
the PropertySource . Values set by this means will
supersede any previously defined value of the property.
PropertySourceChangeEvents may be fired
with a name set to that of the property (retaining case) and old and
new values set to the previous and current values of the property,
respectively. The value returned by the getSource()
method of the event is determined by the value passed to the
constructor of the PropertyChangeSupportJAI parameter.
Neither the old nor the new value may be null : undefined
properties must as usual be indicated by the constant value
java.awt.Image.UndefinedProperty . It is however
legal for either but not both of the old and new property values
to equal java.awt.Image.UndefinedProperty .
Parameters: propertyName - the name of the property, as a String . Parameters: propertyValue - the property, as a general Object . exception: IllegalArgumentException - if propertyName or propertyValue is null . |
|
|
|