|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface encapsulating the set of operations involved in identifying and reading properties.
The interface includes the getProperty()
and
getPropertyNames()
methods familiar from the
RenderedImage
and RenderableImage
interfaces.
Classes which implement this interface should do so in a manner which
treats the property names as case-retentive. That is to say that as
concerns operations effected using the property name as a key, the
operation should ignore the case of the property name while on the
other hand the property name retrieval methods should return the names
with their case preserved.
PropertySource
is implemented by the ImageJAI
interface and, among other classes, by PlanarImage
,
RenderableOp
and CollectionImage
.
Since all RenderedImage
s used with JAI are "wrapped"
by a RenderedImageAdapter
, all JAI RenderedImage
s
may be assumed to implement PropertySource
.
If a PropertySource
is also a
PropertyChangeEmitter
then it should fire PropertySourceChangeEvent
s to all
registered listeners whenever this is reasonable to do so in the context
of the PropertySource
in question.
Property name space collisions may be prevented by adhering to an hierarchical naming convention. This could for example be based on the name of the package in question, e.g., com.sun.media.jai.MyProperty. The names of properties generated by JAI itself will not adhere to the aforementioned naming convention, but this should not pose a problem if users adopt this convention for their own property names.
Another approach to handling multiple property name spaces would
be to define a separate PropertySource for each name space of properties.
These PropertySources could themselves be attached to images as properties.
Inheritance of these properties would occur by the default mechanism.
Modification of these properties within an operation chain could be
managed by PropertyGenerators which are capable of recognizing these
properties. Note that a potential problem with this approach exists
when a PropertySourceChangeEvent
is fired: it might be
necessary to clone the entire tree of properties in order to obtain
the old value of event object.
ImageJAI
,
PlanarImage
,
PropertyChangeEmitter
,
WritablePropertySource
,
RenderedImage
,
RenderableImage
Method Summary | |
Object |
getProperty(String propertyName)
Returns the value of a property. |
Class |
getPropertyClass(String propertyName)
Returns the class expected to be returned by a request for the property with the specified name. |
String[] |
getPropertyNames()
Returns an array of String s recognized as names by
this property source. |
String[] |
getPropertyNames(String prefix)
Returns an array of String s recognized as names by
this property source that begin with the supplied prefix. |
Method Detail |
public String[] getPropertyNames()
String
s recognized as names by
this property source. If no properties are available,
null
will be returned.String
s giving the valid
property names or null
.public String[] getPropertyNames(String prefix)
String
s recognized as names by
this property source that begin with the supplied prefix. If
no property names match, null
will be returned.
The comparison is done in a case-independent manner.String
s giving the valid
property names.prefix
is null
.public Class getPropertyClass(String propertyName)
null
will be returned indicating
that getProperty(propertyName).getClass()
should
be executed instead. A null
value might
be returned for example to prevent generating the value of
a deferred property solely to obtain its class. null
will also be returned if the requested property is not emitted
by this property source.propertyName
- the name of the property, as a String
.Class
expected to be return by a
request for the value of this property or null
.propertyName
is null
.public Object getProperty(String propertyName)
java.awt.Image.UndefinedProperty
will
be returned.propertyName
- the name of the property, as a String
.Object
, or the value
java.awt.Image.UndefinedProperty
.propertyName
is null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |