|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--javax.media.jai.OperationNodeSupport
This is a utility class that can be used by OperationNodes
to consolidate common functionality. An instance of this class may be
used as a member field of the OperationNode and some of the
OperationNode's work delegated to it.
| Constructor Summary | |
OperationNodeSupport(String registryModeName,
String opName,
OperationRegistry registry,
ParameterBlock pb,
RenderingHints hints,
PropertyChangeSupportJAI eventManager)
Constructs an OperationNodeSupport instance. |
|
| Method Summary | |
void |
addPropertyGenerator(PropertyGenerator pg)
Adds a PropertyGenerator to the node. |
void |
copyPropertyFromSource(String propertyName,
int sourceIndex)
Forces a property to be copied from the specified source node. |
String |
getOperationName()
Returns the name of the operation the associated node represents. |
ParameterBlock |
getParameterBlock()
Returns the ParameterBlock of the associated node
by reference. |
PropertySource |
getPropertySource(OperationNode opNode,
PropertySource defaultPS)
Constructs and returns a PropertySource suitable for
use by the specified OperationNode. |
OperationRegistry |
getRegistry()
Returns the OperationRegistry used by the associated
node. |
String |
getRegistryModeName()
Returns the name of RegistryMode corresponding to
this OperationNode. |
RenderingHints |
getRenderingHints()
Returns the RenderingHints of the associated node
by reference. |
void |
resetPropertyEnvironment(boolean resetLocalEnvironment)
Resets the property environment. |
void |
setOperationName(String opName)
Sets the name of the operation the associated node represents. |
void |
setParameterBlock(ParameterBlock pb)
Sets the ParameterBlock of the associated node by
reference. |
void |
setRegistry(OperationRegistry registry)
Sets the OperationRegistry that is used by the associated
node. |
void |
setRenderingHints(RenderingHints hints)
Sets the RenderingHints of the associated node. |
void |
suppressProperty(String name)
Removes a named property from the property environment of the associated node. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public OperationNodeSupport(String registryModeName,
String opName,
OperationRegistry registry,
ParameterBlock pb,
RenderingHints hints,
PropertyChangeSupportJAI eventManager)
OperationNodeSupport instance.
All parameters except opName may be null.
If non-null the PropertyChangeSupportJAI
should have been created with the node as its event source (note
that this cannot be verified).
The ParameterBlock may include
DeferredData parameters. These will not be evaluated
until their values are actually required, i.e., when the node is
rendered. Any Observable events generated by such
DeferredData parameters will be trapped by the node,
converted to a PropertyChangeEventJAI named "parameters",
and forwarded to any listeners registered with the supplied.
eventManager. The old and new values of the event object
so generated will be the previous and current values, respectively, of
the data object wrapped by the DeferredData parameter,
and thus will be instances of the class returned by the
getDataClass() method of the DeferredData
parameter.
registryModeName - The name of the registry mode concerned.opName - The operation name to set.registry - The OperationRegistry to set;
it may be null in which case the registry
will be set to the default JAI registry.pb - The ParameterBlock to set;
it may be null.hints - The new RenderingHints to be set;
it may be null.eventManager - The event helper object. The property change
event source of this object should be the
OperationNode which is using the constructed
OperationNodeSupport instance. If null
no events will be fired.IllegalArgumentException - if registryModeName
or opName is null.| Method Detail |
public String getRegistryModeName()
RegistryMode corresponding to
this OperationNode. This value shoud be immutable
for a given node. The value is returned by reference.public String getOperationName()
public void setOperationName(String opName)
If the operation name changes as a result of calling this
method according to a case-insensitive
comparison by equals() of the old and new names,
a PropertyChangeEventJAI named "OperationName"
will be fired by the event helper object with old and new values
set to the old and new values of the operation name, respectively.
opName - The new operation name to be set.IllegalArgumentException - if opName is
null.
public OperationRegistry getRegistry()
OperationRegistry used by the associated
node. The value is returned by reference.public void setRegistry(OperationRegistry registry)
OperationRegistry that is used by the associated
node. If the specified registry is null, the
registry will be set to the default JAI registry. The value is
set by reference.
If the registry changes according to a direct comparison
of the old and new registry references,
a PropertyChangeEventJAI named "OperationRegistry"
will be fired by the event helper object with old and new values
set to the old and new values of the registry, respectively.
registry - The new OperationRegistry to be set;
it may be null.
public ParameterBlock getParameterBlock()
ParameterBlock of the associated node
by reference. Nodes desirous of maintaining a consistent state
for their ParameterBlock may prefer to clone the
value returned by this method.public void setParameterBlock(ParameterBlock pb)
ParameterBlock of the associated node by
reference. If the specified ParameterBlock is
null, it is assumed that the associated node has
neither input sources nor parameters. Nodes desirous of maintaining
a consistent state for their ParameterBlock may prefer
to clone any user-supplied ParameterBlock before passing
it to this method.
This method does not validate the content of the supplied
ParameterBlock. The caller should ensure that
the sources and parameters in the ParameterBlock
are suitable for the operation the associated node represents; otherwise
some form of error or exception may occur at the time of rendering.
If the The ParameterBlock changes according to a
comparison of the sources and parameters Vectors of the
old and new ParameterBlocks using equals(),
a PropertyChangeEventJAI named "ParameterBlock"
will be fired by the event helper object with old and new values
set to the old and new values of the ParameterBlock,
respectively. A PropertyChangeEventJAI named "Sources" or
"Parameters" will instead be fired if it can be determined that the
ParameterBlock modification has affected only the sources
or parameters of the node, respectively.
ParameterBlock may include
DeferredData parameters. These will not be evaluated
until their values are actually required, i.e., when the node is
rendered. Any Observable events generated by such
DeferredData parameters will be trapped by the node,
converted to a PropertyChangeEventJAI named "parameters",
and forwarded to any listeners registered with the supplied.
eventManager. The old and new values of the event object
so generated will be the previous and current values, respectively, of
the data object wrapped by the DeferredData parameter,
and thus will be instances of the class returned by the
getDataClass() method of the DeferredData
parameter.
pb - The new ParameterBlock to be set;
it may be null.
public RenderingHints getRenderingHints()
RenderingHints of the associated node
by reference. Nodes desirous of maintaining a consistent state
for their RenderingHints may prefer to clone the
value returned by this method.public void setRenderingHints(RenderingHints hints)
RenderingHints of the associated node. It is
legal for nodes to ignore RenderingHints set on them by
this mechanism. Nodes desirous of maintaining
a consistent state for their RenderingHints may prefer
to clone any user-supplied RenderingHints before passing
it to this method.
If the RenderingHints changes according to a
comparison by equals() of the old and new hints,
a PropertyChangeEventJAI named "RenderingHints"
will be fired by the event helper object with old and new values
set to the old and new values of the RenderingHints,
respectively.
hints - The new RenderingHints to be set;
it may be null.
public void addPropertyGenerator(PropertyGenerator pg)
PropertyGenerator to the node. The property values
emitted by this property generator override any previous definitions.pg - A PropertyGenerator to be added to the
associated node's property environment.IllegalArgumentException - if
pg is null.
public void copyPropertyFromSource(String propertyName,
int sourceIndex)
propertyName - the name of the property to be copied.sourceIndex - the index of the source to copy the property from.IllegalArgumentException - if propertyName is null.public void suppressProperty(String name)
getProperty(name) will return
java.awt.Image.UndefinedProperty, and name
will not appear on the list of properties emitted by
getPropertyNames().name - A String naming the property to be suppressed.IllegalArgumentException - if
name is null.
public PropertySource getPropertySource(OperationNode opNode,
PropertySource defaultPS)
PropertySource suitable for
use by the specified OperationNode. If the registry mode
identified by getRegistryModeName() supports properties,
i.e., the statement
Registry.getMode(getRegistryModeName()).arePropertiesSupported()evaluates to
true, then the PropertySource
will include the global property environment as managed by the
OperationRegistry for the corresponding operation.
Prior and subsequent modifications to the local property environment
made via this object will be reflected in the returned
PropertySource.opNode - the OperationNode requesting its
PropertySource.defaultPS - a PropertySource to be used to derive
property values if and only if they would otherwise be
derived by inheritance from a source rather than from a
a PropertyGenerator or a copy-from-source
directive.PropertySource including the local and, if
applicable, the global property environment for the operation.IllegalArgumentException - if opNode is null.RegistryMode,
OperationRegistry.getPropertySource(OperationNode op)public void resetPropertyEnvironment(boolean resetLocalEnvironment)
true.resetLocalEnvironment - Whether to clear the list of property
environment changes made directly on this object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||