|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
javax.media.jai.DeferredData
javax.media.jai.DeferredProperty
public class DeferredProperty
A subclass of DeferredData
to be used to wrap JAI property
values which will be computed at a later time. For example, an instance
of this class could be used to wrap a property emitted by an operation
node so that the actual computation of the property value was deferred
until it was actually needed.
DeferredData
,
RenderedOp
,
Serialized FormField Summary | |
---|---|
protected String |
propertyName
The name of the property the value of which is to be obtained. |
protected PropertySource |
propertySource
The PropertySource from which the value of the named
property is to be drawn. |
Fields inherited from class javax.media.jai.DeferredData |
---|
data, dataClass |
Constructor Summary | |
---|---|
DeferredProperty(PropertySource propertySource,
String propertyName,
Class propertyClass)
Creates a DeferredProperty . |
Method Summary | |
---|---|
protected Object |
computeData()
Returns the value of the image property associated with the image and property name specified at construction. |
boolean |
equals(Object obj)
Tests whether the parameter equals this object. |
String |
getPropertyName()
Returns the name of the property the value of which is to be obtained. |
PropertySource |
getPropertySource()
Returns the PropertySource of the property value. |
int |
hashCode()
Returns a hash code value for the object. |
void |
propertyChange(PropertyChangeEvent evt)
The implementation of PropertyChangeListener . |
Methods inherited from class javax.media.jai.DeferredData |
---|
getData, getDataClass, isValid, setData |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient PropertySource propertySource
PropertySource
from which the value of the named
property is to be drawn.
protected String propertyName
Constructor Detail |
---|
public DeferredProperty(PropertySource propertySource, String propertyName, Class propertyClass)
DeferredProperty
. If the specified
PropertySource
is a PropertyChangeEmitter
,
then this DeferredProperty
object is registered as a
PropertyChangeListener
of the PropertySource
.
IllegalArgumentException
- if a parameter is null
or if the propertyName
is not among those
emitted by the PropertySource
.Method Detail |
---|
public PropertySource getPropertySource()
PropertySource
of the property value.
public String getPropertyName()
protected Object computeData()
computeData
in class DeferredData
public boolean equals(Object obj)
DeferredProperty
and
the respective propertySource
and
dataClass
variables are equal according to their
respective equals()
methods and the
propertyName
s are equal ignoring case. The wrapped
data object is not tested unless the isValid()
of
both objects returns true
because requesting it via
getData()
may provoke computation of a deferred quantity.
equals
in class Object
public int hashCode()
hashCode
in class Object
public void propertyChange(PropertyChangeEvent evt)
PropertyChangeListener
. This
method responds to certain PropertyChangeEvent
s generated
by the PropertySource
used to construct this object.
If the PropertyChangeEvent
is named "Rendering" and is
an instance of javax.media.jai.RenderingChangeEvent
, then
the source of the event is checked to determine whether it equals the
PropertySource
used to construct this object. If this test
is passed then the PropertySource
is a
RenderedOp
the rendering of which has changed. Therefore
setData() will be invoked with a null argument. This will indicate to
any registered observers that the property data should be re-requested
by invoking getData() on this object.
If the PropertyChangeEvent
was generated by the
PropertySource
used to construct this object, has name
equal to the name of the deferred property, and is an instance of
PropertySourceChangeEvent
, then the value returned by
the getNewValue()
method of the event object will be
passed to setData()
unless getNewValue()
returns java.awt.Image.UndefinedProperty
in which case
null
will be passed to setData()
. Registered
observers will be notified according to the specification of
setData()
.
propertyChange
in interface PropertyChangeListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |