|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.media.jai.PlanarImage
|
+--javax.media.jai.RenderedOp
A node in a rendered imaging chain. A RenderedOp stores
an operation name, a ParameterBlock containing sources and
parameters, and a RenderingHints containing hints which
may be used in rendering the node. A set of nodes may be joined together
via the source Vectors within their respective
ParameterBlocks to form a directed acyclic
graph (DAG). The topology, i.e., connectivity, of the graph may be
altered by changing the node's sources. The operation name, parameters,
and rendering hints may also be changed.
Such chains are useful for example as arguments to a
RemoteImage; they convey the structure of an imaging
chain in a compact representation and at a suitably high level of
abstraction to allow the server some leeway in materializing the
results. They are also useful in that a chain may be manipulated
dynamically and rendered multiple times. Thus for example the same
chain of operations may be applied to different images or the parameters
of certain operations in a chain may be modified interactively.
A RenderedOp may be constructed directly as, for example,
ParameterBlock pb =
(new ParameterBlock()).add("SomeFile.tif");
RenderedOp node = new RenderedOp("fileload", pb, null);
or via the create or createNS() methods defined
in the JAI class. The difference between direct construction
of a node and creation via a convenience method is that in the latter case:
validateArguments() method of the associated
OperationDescriptor, the arguments (sources and parameters)
are validated as being compatible with the specified operation.RenderingHints maintained by the JAI
instance are merged with the local RenderingHints with the
local hints taking precedence.isImmediate() method of the corresponding
OperationDescriptor returns true)
then the node is rendered. When a chain of nodes is rendered by any means a "parallel" chain of
RenderedImages is created. Each node in the chain of
RenderedOps corresponds to a node in the chain of
RenderedImages. RenderedImage methods invoked
on the RenderedOp are in general forwarded to the associated
RenderedImage which is referred to as the rendering
of the node.
The translation between RenderedOp chains and
RenderedImage (usually OpImage) chains makes
use of two levels of indirection provided by the
OperationRegistry and RenderedImageFactory
(RIF) facilities. First, the local OperationRegistry is
used to map the operation name into a RIF. This RIF then constructs
a RenderedImage (usually an OpImage) which
does the actual image data processing. The local
OperationRegistry is used in order to take advantage
of the best possible implementation of the operation, e.g., RIFs that
provide acceleration for certain cases or RIFs that are known to a server
without having to burden the client.
A node may be rendered explicitly by invoking the method
getRendering() which also returns the rendering of the
node. A node may be rendered implicitly by invoking any method
defined in the RenderedImage interface. A node may also be
rendered implicitly by invoking any method the execution of which
getCurrentRendering().
A node may also be re-rendered via getNewRendering() which
regenerates the rendering from the existing set of sources, parameters,
and hints.
A rendering of a node may also be obtained by means of the
createInstance() method. This method returns a
PlanarImage rendering without marking the node as
having been rendered. If the node is not marked as rendered then it
will not fire RenderingChangeEvents as described below.
RenderedOp nodes may participate in Java Bean-style
events. The PropertyChangeEmitter methods may be used
to register and unregister PropertyChangeListeners.
RenderedOps are also PropertyChangeListeners
so that they may be registered as listeners of other
PropertyChangeEmitters or the equivalent. Each
RenderedOp also automatically receives any
RenderingChangeEvents emitted by any of its sources which
are also RenderedOps or any CollectionChangeEvents
from any CollectionOp sources.
Certain PropertyChangeEvents may be emitted by the
RenderedOp. These include the
PropertyChangeEventJAIs and
PropertySourceChangeEvents required by virtue of implementing
the OperationNode interface. Additionally a
RenderingChangeEvent may be emitted if the node has already
been rendered and both of the following conditions are satisfied:
RenderingChangeEvent from one of
its RenderedOp sources or a CollectionChangeEvent
from one of its CollectionOp sources. When a rendered RenderedOp node receives a
RenderingChangeEvent from a RenderedOp source,
then if the rendering is an OpImage, the region of
the current rendering which may be retained will be determined by using
mapSourceRect() to forward map the bounds of the invalid
region. A similar procedure is used for "InvalidRegion" events emitted
by source RenderedImages such as TiledImages.
If a critical attribute of the node is edited, then the
getInvalidRegion() method of the corresponding
OperationDescriptor will be used to determine the
invalid region. If the complement of the invalid region contains any tiles
of the current rendering and the rendering is an OpImage, a
new rendering of the node will be generated and the
identified tiles will be retained from the old rendering insofar as
possible. This might involve for example adding tiles to a
TileCache under the ownership of the new rendering. A
RenderingChangeEvent will then be fired to all
PropertyChangeListeners of the node, and to any sinks that
are PropertyChangeListeners. The newRendering
parameter of the event constructor (which may be retrieved via the
getNewValue() method of the event) will be set to either
the new rendering of the node or to null if it was not
possible to retain any tiles of the previous rendering.
RenderedOp nodes are WritablePropertySources
and so manage a name-value database of image meta-data also known as image
properties. Properties may be set on and requested from a node. The
value of a property not explicitly set on the node (via
setProperty()) is obtained from the property environment of
the node. When a property is derived from the property environment it is
cached locally to ensure synchronization, i.e., that properties do not
change spontaneously if for example the same property is modified upstream.
The property environment of a RenderedOp is initially
derived from that of the corresponding OperationDescriptor
as maintained by the OperationRegistry. It may be modified
locally by adding PropertyGenerators, directives to copy
certain properties from specific sources, or requests to suppress certain
properties. These modifications per se cannot be undone directly but
may be eliminated as a side effect of other changes to the node as
described below.
The RenderedOp itself synthesizes several property values,
which may neither be set nor removed. These are: image_width,
image_height, image_min_x_coord, and
image_min_y_coord. These properties are referred to as
synthetic properties.
When a property value is requested an attempt will be made to derive it from the several entities in the following order of precedence:
PropertyGenerators, or
setProperty() or due to caching of a
property derived from the property environment. Note that the properties
of a node are not copied to its rendering.
All dynamically computed properties of a RenderedOp which
have been cached locally, i.e., those cached properties which were not set
by an explicit call to setProperty(), will be cleared when any
of the critical attributes of the node is edited. By implication these
properties will also be cleared when a RenderingChangeEvent
is received from any node source. The property environment or the cached
properties may also be cleared by invoking resetProperties().
As mentioned, a RenderedOp chain created on a client
may be passed to a server via a RemoteImage. Whether the
node has been previously rendered is irrelevant to its ability to be
serialized. Any RenderedImage sources which are not
Serializable will be wrapped in
SerializableRenderedImages for serialization. The tile
transmission parameters will be determined from the
RenderingHints of the node. All other non-serializable
objects will attempt to be serialized using
SerializerFactory. If no Serializer is
available for a particular object, a
java.io.NotSerializableException may result. Image
properties (meta-data) are serialized insofar as they are serializable:
non-serializable components are simply eliminated from the local cache
of properties and from the property environment.
Note that RenderedOp nodes used to instantiate
operations which have a corresponding OperationDescriptor
the isImmediate() method of which returns
true are rendered upon deserialization.
RenderedOp represents a single PlanarImage
as a node in a RenderedImage operation chain. Its companion
classes, RenderableOp and CollectionOp, represent
nodes in operation chains of RenderableImages and
CollectionImages, respectively.
CollectionOp,
JAI,
OperationDescriptor,
OperationRegistry,
OpImage,
RenderableOp,
RenderingChangeEvent,
SerializableRenderedImage,
Serializer,
SerializerFactory,
RenderingHints,
ParameterBlock,
RenderedImageFactory, Serialized Form| Field Summary | |
protected OperationNodeSupport |
nodeSupport
An object to assist in implementing OperationNode. |
protected PlanarImage |
theImage
The rendering of the current image, not preserved over RMI. |
protected PropertySource |
thePropertySource
The PropertySource containing the combined properties
of all of the node's sources. |
| Fields inherited from class javax.media.jai.PlanarImage |
colorModel,
eventManager,
height,
minX,
minY,
properties,
sampleModel,
tileGridXOffset,
tileGridYOffset,
tileHeight,
tileWidth,
width |
| Constructor Summary | |
RenderedOp(OperationRegistry registry,
String opName,
ParameterBlock pb,
RenderingHints hints)
Constructs a RenderedOp that will be used to
instantiate a particular rendered operation from the specified
operation registry, an operation name, a ParameterBlock,
and a set of rendering hints. |
|
RenderedOp(String opName,
ParameterBlock pb,
RenderingHints hints)
Constructs a RenderedOp that will be used to
instantiate a particular rendered operation from the default
operation registry, an operation name, a ParameterBlock,
and a set of rendering hints. |
|
| Method Summary | |
void |
addNodeSource(Object source)
Deprecated. as of JAI 1.1 Use addSource(Object). |
void |
addPropertyGenerator(PropertyGenerator pg)
Adds a PropertyGenerator to the node. |
boolean |
addSink(Object sink)
Adds a sink to the list of node sinks. |
void |
addSink(PlanarImage sink)
Adds a PlanarImage sink to the list of sinks of the node. |
void |
addSource(Object source)
Adds a source to the ParameterBlock of this node. |
void |
addSource(PlanarImage source)
Deprecated. as of JAI 1.1. Use addSource(Object). |
void |
cancelTiles(TileRequest request,
Point[] tileIndices)
Issue an advisory cancellation request to nullify processing of the indicated tiles. |
WritableRaster |
copyData()
Renders the node if it has not already been rendered, and copies and returns the entire rendered image into a single raster. |
WritableRaster |
copyData(WritableRaster raster)
Renders the node if it has not already been rendered, and copies a specified rectangle of the rendered image into the given WritableRaster. |
void |
copyPropertyFromSource(String propertyName,
int sourceIndex)
Forces a property to be copied from the specified source node. |
PlanarImage |
createInstance()
Instantiate a PlanarImage that computes the result
of this RenderedOp. |
protected PlanarImage |
createInstance(boolean isNodeRendered)
This method performs the actions described by the documentation of createInstance() optionally marking the node as rendered
according to the parameter. |
protected void |
createRendering()
Creates a PlanarImage rendering if none exists
and sets theImage to the resulting value. |
byte |
getByteParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a byte. |
char |
getCharParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a char. |
ColorModel |
getColorModel()
Renders the node if it has not already been rendered, and returns the ColorModel of the rendered image. |
PlanarImage |
getCurrentRendering()
Returns the value of the protected variable theImage
which may be null if no rendering has yet been created. |
Raster |
getData()
Renders the node if it has not already been rendered, and returns the entire rendered image as a Raster. |
Raster |
getData(Rectangle rect)
Renders the node if it has not already been rendered, and returns a specified rectangular region of the rendered image as a Raster. |
double |
getDoubleParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a double. |
Object |
getDynamicProperty(String name)
Returns the property associated with the specified property name, or java.awt.Image.UndefinedProperty if the specified
property is not set on the image. |
float |
getFloatParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a float. |
int |
getHeight()
Renders the node if it has not already been rendered, and returns the height of the rendered image. |
int |
getIntParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as an int. |
long |
getLongParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a long. |
int |
getMinX()
Renders the node if it has not already been rendered, and returns the X coordinate of the leftmost column of the rendered image. |
int |
getMinY()
Renders the node if it has not already been rendered, and returns the X coordinate of the uppermost row of the rendered image. |
PlanarImage |
getNewRendering()
Forces the node to be re-rendered and returns the new rendering. |
Object |
getNodeSource(int index)
Deprecated. as of JAI 1.1 Use getSourceObject(int). |
int |
getNumParameters()
Returns the number of parameters stored in the ParameterBlock of this node. |
int |
getNumSources()
Returns the number of sources stored in the ParameterBlock of this node. |
Object |
getObjectParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as an Object. |
String |
getOperationName()
Returns the name of the operation this node represents as a String. |
ParameterBlock |
getParameterBlock()
Returns a clone of the ParameterBlock of this node. |
Vector |
getParameters()
Returns a clone of the Vector of parameters stored in the
ParameterBlock of this node. |
Object |
getProperty(String name)
Returns the property associated with the specified property name, or java.awt.Image.UndefinedProperty if the specified
property is not set on the image. |
Class |
getPropertyClass(String name)
Returns the class expected to be returned by a request for the property with the specified name. |
String[] |
getPropertyNames()
Returns the names of properties available from this node. |
OperationRegistry |
getRegistry()
Returns the OperationRegistry that is used
by this node. |
String |
getRegistryModeName()
Returns the name of the RegistryMode corresponding to
this RenderedOp. |
PlanarImage |
getRendering()
Returns the PlanarImage rendering associated with this
RenderedOp node. |
Object |
getRenderingHint(RenderingHints.Key key)
Gets a hint from the RenderingHints of this node. |
RenderingHints |
getRenderingHints()
Returns a clone of the RenderingHints of this node or
null. |
SampleModel |
getSampleModel()
Renders the node if it has not already been rendered, and returns the SampleModel of the rendered image. |
short |
getShortParameter(int index)
Returns the specified parameter stored in the ParameterBlock of this node as a short. |
PlanarImage |
getSource(int index)
Deprecated. as of JAI 1.1. Use getSourceObject(). |
PlanarImage |
getSourceImage(int index)
Returns the specified PlanarImage source stored in the
ParameterBlock of this node. |
Object |
getSourceObject(int index)
Returns the specified source stored in the ParameterBlock of this node. |
Vector |
getSources()
Returns a clone of the Vector of sources stored in the
ParameterBlock of this node. |
Raster |
getTile(int tileX,
int tileY)
Renders the node if it has not already been rendered, and returns the specified tile of the rendered image. |
int |
getTileGridXOffset()
Renders the node if it has not already been rendered, and returns the tile grid X offset of the rendered image. |
int |
getTileGridYOffset()
Renders the node if it has not already been rendered, and returns the tile grid Y offset of the rendered image. |
int |
getTileHeight()
Renders the node if it has not already been rendered, and returns the tile height of the rendered image. |
Raster[] |
getTiles(Point[] tileIndices)
Renders the node if it has not already been rendered, and returns the tiles indicated by the tileIndices
of the rendered image as an array of Rasters. |
int |
getTileWidth()
Renders the node if it has not already been rendered, and returns the tile width of the rendered image. |
int |
getWidth()
Renders the node if it has not already been rendered, and returns the width of the rendered image. |
void |
prefetchTiles(Point[] tileIndices)
Renders the node if it has not already been rendered. |
void |
propertyChange(PropertyChangeEvent evt)
Implementation of PropertyChangeListener. |
TileRequest |
queueTiles(Point[] tileIndices)
Queues a list of tiles for computation. |
void |
removeProperty(String name)
Removes the named property from the local property set of the RenderedOp as well as from its property
environment. |
boolean |
removeSink(Object sink)
Removes a sink from the list of node sinks. |
boolean |
removeSink(PlanarImage sink)
Removes a PlanarImage sink from the list of sinks of
the node. |
void |
removeSinks()
Removes all sinks from the list of sinks of the node. |
boolean |
removeSource(Object source)
Removes the specified Object source from the
ParameterBlock of this node. |
boolean |
removeSource(PlanarImage source)
Deprecated. as of JAI 1.1. Use removeSource(Object). |
void |
removeSources()
Removes all the sources stored in the ParameterBlock of this node. |
protected void |
resetProperties(boolean resetPropertySource)
Resets the PropertySource. |
void |
setNodeSource(Object source,
int index)
Deprecated. as of JAI 1.1 Use setSource(Object,int). |
void |
setOperationName(String opName)
Sets the name of the operation this node represents. |
void |
setParameter(byte param,
int index)
Sets one of the node's parameters to a byte. |
void |
setParameter(char param,
int index)
Sets one of the node's parameters to a char. |
void |
setParameter(double param,
int index)
Sets one of the node's parameters to a double. |
void |
setParameter(float param,
int index)
Sets one of the node's parameters to a float. |
void |
setParameter(int param,
int index)
Sets one of the node's parameters to an int. |
void |
setParameter(long param,
int index)
Sets one of the node's parameters to a long. |
void |
setParameter(Object param,
int index)
Sets one of the node's parameters to an Object. |
void |
setParameter(short param,
int index)
Sets one of the node's parameters to a short. |
void |
setParameterBlock(ParameterBlock pb)
Sets the ParameterBlock of this node. |
void |
setParameters(Vector parameters)
Sets all the parameters of this node. |
void |
setProperty(String name,
Object value)
Sets a local property on a node. |
void |
setRegistry(OperationRegistry registry)
Sets the OperationRegistry that is used by
this node. |
void |
setRenderingHint(RenderingHints.Key key,
Object value)
Sets a hint in the RenderingHints of this node. |
void |
setRenderingHints(RenderingHints hints)
Sets the RenderingHints of this node. |
void |
setSource(Object source,
int index)
Sets the specified source stored in the ParameterBlock
of this node to a new source object. |
void |
setSource(PlanarImage source,
int index)
Deprecated. as of JAI 1.1. Use setSource(Object, int). |
void |
setSources(List sourceList)
Replaces the sources in the ParameterBlock of this node
with a new list of sources. |
void |
suppressProperty(String name)
Removes a named property from the property environment of this node. |
| Methods inherited from class java.lang.Object |
clone,
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected OperationNodeSupport nodeSupport
OperationNode.protected transient PropertySource thePropertySource
PropertySource containing the combined properties
of all of the node's sources.protected transient PlanarImage theImage
| Constructor Detail |
public RenderedOp(OperationRegistry registry,
String opName,
ParameterBlock pb,
RenderingHints hints)
RenderedOp that will be used to
instantiate a particular rendered operation from the specified
operation registry, an operation name, a ParameterBlock,
and a set of rendering hints.
This method does not validate the contents of the supplied
ParameterBlock. The caller should ensure that
the sources and parameters in the ParameterBlock
are suitable for the operation this node represents; otherwise
some form of error or exception may occur at the time of rendering.
The ParameterBlock may include
DeferredData parameters. These will not be evaluated
until their values are actually required, i.e., when the node is
rendered.
The node is added automatically as a sink of any
PlanarImage or CollectionImage sources.
registry - The OperationRegistry to be used for
instantiation. if null, the default registry
is used. Saved by reference.opName - The operation name. Saved by reference.pb - The sources and parameters. If null,
it is assumed that this node has no sources and parameters.
This parameter is cloned.hints - The rendering hints. If null, it is assumed
that no hints are associated with the rendering.
This parameter is cloned.opName is
null.
public RenderedOp(String opName,
ParameterBlock pb,
RenderingHints hints)
RenderedOp that will be used to
instantiate a particular rendered operation from the default
operation registry, an operation name, a ParameterBlock,
and a set of rendering hints. The default operation registry
is used.
This method does not validate the contents of the supplied
ParameterBlock. The caller should ensure that
the sources and parameters in the ParameterBlock
are suitable for the operation this node represents; otherwise
some form of error or exception may occur at the time of rendering.
The ParameterBlock may include
DeferredData parameters. These will not be evaluated
until their values are actually required, i.e., when the node is
rendered.
The node is added automatically as a sink of any
PlanarImage or CollectionImage sources.
opName - The operation name. Saved by reference.pb - The sources and parameters. If null,
it is assumed that this node has no sources and parameters.
This parameter is cloned.hints - The rendering hints. If null, it is assumed
that no hints are associated with the rendering.
This parameter is cloned.opName is
null.| Method Detail |
public String getRegistryModeName()
RegistryMode corresponding to
this RenderedOp. This method always returns the
String "rendered".public OperationRegistry getRegistry()
OperationRegistry that is used
by this node. If the registry is not set, the default
registry is returned.public void setRegistry(OperationRegistry registry)
OperationRegistry that is used by
this node. If the specified registry is null, the
default registry is used. The parameter is saved by reference.
If the supplied registry does not equal the current registry, a
PropertyChangeEventJAI named "OperationRegistry"
will be fired and a RenderingChangeEvent may be
fired if the node has already been rendered.
registry - The new OperationRegistry to be set;
it may be null.public String getOperationName()
String.public void setOperationName(String opName)
If the supplied name does not equal the current operation name, a
PropertyChangeEventJAI named "OperationName"
will be fired and a RenderingChangeEvent may be
fired if the node has already been rendered.
opName - The new operation name to be set.opName is
null.public ParameterBlock getParameterBlock()
ParameterBlock of this node.public void setParameterBlock(ParameterBlock pb)
ParameterBlock of this node.
If the specified new ParameterBlock is null,
it is assumed that this node has no input sources and parameters.
The supplied parameter is cloned.
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 this node represents; otherwise
some form of error or exception may occur at the time of rendering.
If the supplied ParameterBlock does not equal the
current ParameterBlock, a
PropertyChangeEventJAI named "ParameterBlock", "Sources",
or "Parameters" will be fired. A RenderingChangeEvent
may also be fired if the node has already been rendered.
The ParameterBlock may include
DeferredData parameters. These will not be evaluated
until their values are actually required, i.e., when the node is
rendered.
The node is registered as a sink of any PlanarImage
or CollectionImage sources contained in the supplied
ParameterBlock. The node is also removed as a sink of
any previous PlanarImage or CollectionImage
sources if these are not in the new ParameterBlock.
pb - The new ParameterBlock to be set;
it may be null.public RenderingHints getRenderingHints()
RenderingHints of this node or
null.public void setRenderingHints(RenderingHints hints)
RenderingHints of this node.
The supplied parameter is cloned if non-null.
If the supplied RenderingHints does not equal the
current RenderingHints, a
PropertyChangeEventJAI named "RenderingHints"
will be fired and a RenderingChangeEvent may be
fired if the node has already been rendered.
hints - The new RenderingHints to be set;
it may be null.public PlanarImage createInstance()
PlanarImage that computes the result
of this RenderedOp. The local
OperationRegistry of this node is used to translate
the operation name into a RenderedImageFactory and
eventually an actual RenderedImage (usually an
OpImage).
During this method, all the sources supplied in the
ParameterBlock are checked. If any of the sources
is a RenderedOp, a rendering of that source is
created. This propagates all the way up to the top of the op
chain. If any of the sources is a Collection,
then the collection is passed to the operation as-is. If there
is a RenderedOp anywhere in the collection, it is
up to the individual operation to create the rendering for that
RenderedOp.
This method does not validate the sources and parameters
stored in the ParameterBlock against the specification
of the operation this node represents. It is the responsibility
of the caller to ensure that the data in the
ParameterBlock are suitable for this operation.
Otherwise, some kind of exception or error will occur.
Invoking this method will cause any source RenderedOp
nodes to be rendered using getRendering() and any
source CollectionOp nodes to be rendered using
getCollection(). Any DeferredData parameters
in the ParameterBlock will also be evaluated.
The RenderedImage generated by the selected
RenderedImageFactory will be converted to a
PlanarImage by invoking
PlanarImage.wrapRenderedImage().
PlanarImage.protected PlanarImage createInstance(boolean isNodeRendered)
createInstance() optionally marking the node as rendered
according to the parameter.createInstance()protected void createRendering()
PlanarImage rendering if none exists
and sets theImage to the resulting value. This method
performs the same actions as createInstance() but sets
theImage to the result.createInstance()public PlanarImage getRendering()
PlanarImage rendering associated with this
RenderedOp node. This method performs the same action
as createRendering() but returns theImage.createRendering(),
createInstance()public PlanarImage getCurrentRendering()
theImage
which may be null if no rendering has yet been created.
This method does not force the node to be rendered.public PlanarImage getNewRendering()
If the node has not yet been rendered this method is identical to
getRendering().
If the node has already been rendered, then a new rendering will be
generated. The synthetic and locally cached properties and the property
environment of the node will all be reset. All registered
PropertyChangeListeners and any
PropertyChangeListener sinks will be notifed of the
change in the rendering via a RenderingChangeEvent
the invalid region of which will be null.
This method could be used for example to trigger a
re-rendering of the node in cases where this would not happen
automatically but is desirable to the application. One
example occurs if a parameter of the operation is a referent of
some other entity which changes but the parameter itself does not
change according to equals(). This could occur for
example for an image file input operation wherein the path to the
file remains the same but the content of the file changes.
RenderingChangeEvent listeners.public void propertyChange(PropertyChangeEvent evt)
PropertyChangeListener.
When invoked with an event which is an instance of
RenderingChangeEvent or CollectionChangeEvent
emitted by a RenderedOp or CollectionOp,
respectively, the node will respond by re-rendering itself while
retaining any tiles possible. It will respond to an "InvalidRegion"
event emitted by a source RenderedImage in a manner
similar to that applied for RenderingChangeEvents.
TiledImage.propertyChange(java.beans.PropertyChangeEvent)public void addNodeSource(Object source)
addSource(Object).
ParameterBlock of this node.
This is a convenience method that invokes
setParameterBlock() and so adheres to the same event
firing behavior.source - The source to be added to the
ParameterBlock
public void setNodeSource(Object source,
int index)
setSource(Object,int).
ParameterBlock
of this node to a new source object.
This is a convenience method that invokes
setParameterBlock() and so adheres to the same event
firing behavior.source - The Source to be set.index - The Index at which it is to be set.source is null.index is invalid.public Object getNodeSource(int index)
getSourceObject(int).
ParameterBlock of this node.
If there is no source corresponding to the specified index, an
ArrayIndexOutOfBoundsException will be thrown.index - The index of the source.public int getNumParameters()
ParameterBlock of this node.public Vector getParameters()
Vector of parameters stored in the
ParameterBlock of this node.public byte getByteParameter(int index)
ParameterBlock of this node as a byte.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.index is invalid.public char getCharParameter(int index)
ParameterBlock of this node as a char.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.index is invalid.public short getShortParameter(int index)
ParameterBlock of this node as a short.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.index is invalid.public int getIntParameter(int index)
ParameterBlock of this node as an int.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.index is invalid.public long getLongParameter(int index)
ParameterBlock of this node as a long.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.index is invalid.public float getFloatParameter(int index)
ParameterBlock of this node as a float.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.index is invalid.public double getDoubleParameter(int index)
ParameterBlock of this node as a double.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.index is invalid.public Object getObjectParameter(int index)
ParameterBlock of this node as an Object.
An ArrayIndexOutOfBoundsException may occur if an
invalid index is suppliedindex - The index of the parameter.index is invalid.public void setParameters(Vector parameters)
setParameterBlock() and so adheres to the same event
firing behavior.
The Vector may include
DeferredData parameters. These will not be evaluated
until their values are actually required, i.e., when the node is
rendered.
public void setParameter(byte param,
int index)
byte.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
This is a convenience method that invokes
setParameter(Object,int) and so adheres to the same event
firing behavior.param - The parameter, as a byte.index - The index of the parameter.
public void setParameter(char param,
int index)
char.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
This is a convenience method that invokes
setParameter(Object,int) and so adheres to the same event
firing behavior.param - The parameter, as a char.index - The index of the parameter.
public void setParameter(short param,
int index)
short.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a short.index - The index of the parameter.
public void setParameter(int param,
int index)
int.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as an int.index - The index of the parameter.
public void setParameter(long param,
int index)
long.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a long.index - The index of the parameter.
public void setParameter(float param,
int index)
float.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a float.index - The index of the parameter.
public void setParameter(double param,
int index)
double.
If the index lies beyond the current source list,
the list is extended with nulls as needed.param - The parameter, as a double.index - The index of the parameter.
public void setParameter(Object param,
int index)
Object.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
This is a convenience method that invokes
setParameterBlock() and so adheres to the same event
firing behavior.
The Object may be a
DeferredData instance. It will not be evaluated
until its value is actually required, i.e., when the node is
rendered.
param - The parameter, as an Object.index - The index of the parameter.
public void setRenderingHint(RenderingHints.Key key,
Object value)
RenderingHints of this node. This
is a convenience method which calls setRenderingHints()
and so adheres to the same event firing behavior.null.public Object getRenderingHint(RenderingHints.Key key)
RenderingHints of this node.null if the key is not mapped to any value.protected void resetProperties(boolean resetPropertySource)
PropertySource. If the parameter is
true then the property environment is completely
reset; if false then only cached properties are
cleared, i.e., those which were derived from the property
environment and are now stored in the local cache.public String[] getPropertyNames()
Strings containing valid
property names.public Class getPropertyClass(String name)
null will be returned.Class expected to be return by a
request for the value of this property or null.name
is null.public Object getProperty(String name)
java.awt.Image.UndefinedProperty if the specified
property is not set on the image. If name equals the
name of any synthetic property, i.e., image_width,
image_height, image_min_x_coord, or
image_min_y_coord, then the node will be rendered.name - A String naming the property.name is null.
public void setProperty(String name,
Object value)
If the node is serialized then serializable properties will also be serialized but non-serializable properties will be lost.
name - A String representing the property name.value - The property's value, as an Object.name is null.value is null.name
conflicts with Synthetic property.public void removeProperty(String name)
RenderedOp as well as from its property
environment. The synthetic properties
(containing image width, height, and position) may not be removed.name
is null.name
conflicts with Synthetic property.public Object getDynamicProperty(String name)
java.awt.Image.UndefinedProperty if the specified
property is not set on the image. This method is dynamic in the
sense that subsequent invocations of this method on the same object
may return different values as a function of changes in the property
environment of the node, e.g., a change in which
PropertyGenerators are registered or in the values
associated with properties of node sources. The case of the property
name passed to this method is ignored.name - A String naming the property.name is 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 this node's
property environment.pg is null.
public void copyPropertyFromSource(String propertyName,
int sourceIndex)
propertyName - the name of the property to be copied.sourceIndex - the index of the from which to copy the property.propertyName is
null.public void suppressProperty(String name)
setProperty()
or to having been cached for property
synchronization purposes, subsequent calls to
getProperty(name) will return
java.awt.Image.UndefinedProperty, and name
will not appear on the list of properties emitted by
getPropertyNames(). To delete the property from the
local property set of the node, removeProperty() should
be used.name - A String naming the property to be suppressed.name is null.name
conflicts with Synthetic property.public int getMinX()
public int getMinY()
public int getWidth()
public int getHeight()
public int getTileWidth()
public int getTileHeight()
public int getTileGridXOffset()
public int getTileGridYOffset()
public SampleModel getSampleModel()
SampleModel of the rendered image.public ColorModel getColorModel()
ColorModel of the rendered image.
public Raster getTile(int tileX,
int tileY)
tileX - The X index of the tile.tileY - The Y index of the tile.Raster.public Raster getData()
Raster.Raster containing the entire image data.Raster.public Raster getData(Rectangle rect)
Raster.region - The rectangular region of this image to be
returned, or null.Raster containing the specified image data.Raster.public WritableRaster copyData()
public WritableRaster copyData(WritableRaster raster)
WritableRaster.raster - A WritableRaster to be filled with image data.WritableRaster.public Raster[] getTiles(Point[] tileIndices)
tileIndices
of the rendered image as an array of Rasters.tileIndices - An array of Points representing TileIndices.tileIndices is
null.public TileRequest queueTiles(Point[] tileIndices)
RenderedOp itself in fact should monitor any
TileComputationListener events of its rendering and
forward any such events to any of its registered listeners.tileIndices - A list of tile indices indicating which tiles
to schedule for computation.tileIndices is
null.
public void cancelTiles(TileRequest request,
Point[] tileIndices)
request - The request for which tiles are to be cancelled.tileIndices - The tiles to be cancelled; may be null.
Any tiles not actually in the TileRequest will be
ignored.request is
null.public void prefetchTiles(Point[] tileIndices)
tileIndices - A list of tileIndices indicating which tiles
to prefetch.tileIndices is
null.public void addSource(PlanarImage source)
addSource(Object).
PlanarImage source to the
ParameterBlock of this node.
This is a convenience method that invokes
setParameterBlock() and so adheres to the same event
firing behavior.
Note that the behavior of this method has changed as of
Java Advanced Imaging 1.1. To obtain the previous behavior use
getRendering().addSource(). The description of the
previous behavior is as follows:
Renders the node if it has not already been rendered, and
adds a
PlanarImage source to the list of sources
of the rendered image.
source - The source to be added to the
ParameterBlocksource is
null.
public void setSource(PlanarImage source,
int index)
setSource(Object, int).
ParameterBlock
of this node to a new PlanarImage source.
This is a convenience method that invokes
setParameterBlock() and so adheres to the same event
firing behavior.
Note that the behavior of this method has changed as of
Java Advanced Imaging 1.1. To obtain the previous behavior use
getRendering().setSource(). The description of the
previous behavior is as follows:
Renders the node if it has not already been rendered, and
sets the specified source of the rendered image to the
supplied
PlanarImage.
An ArrayIndexOutOfBoundsException may be thrown if
an invalid index is supplied.
source - The source, as a PlanarImage.index - The index of the source.source is
null.index is invalid.public PlanarImage getSource(int index)
getSourceObject().
PlanarImage source stored in the
ParameterBlock of this node.
If there is no source corresponding to the specified index, an
ArrayIndexOutOfBoundsException will be thrown.
Note that the behavior of this method has changed as of
Java Advanced Imaging 1.1. To obtain the previous behavior use
getRendering().getSource(). The description of the
previous behavior is as follows:
Renders the node if it has not already been rendered, and
returns the specified
PlanarImage source of
the rendered image. If there is no source corresponding to
the specified index, this method will throw an
ArrayIndexOutOfBoundsException.
The source returned may differ from the source stored in
the ParameterBlock of this node.
index - The index of the desired source.PlanarImage source.index is invalid.PlanarImage.public boolean removeSource(PlanarImage source)
removeSource(Object).
PlanarImage source from the
ParameterBlock of this node.
Note that the behavior of this method has changed as of
Java Advanced Imaging 1.1. To obtain the previous behavior use
getRendering().removeSource(). The description of the
previous behavior is as follows:
Renders the node if it has not already been rendered, and
removes a
PlanarImage source from the list
of sources of the rendered image.
source - A PlanarImage to be removed.true if the element was present, false
otherwise.source is null.public void addSource(Object source)
ParameterBlock of this node.
This is a convenience method that invokes
setParameterBlock() and so adheres to the same event
firing behavior.
The node is added automatically as a sink if the source is a
PlanarImage or a CollectionImage.
source - The source to be added to the
ParameterBlocksource is null.
public void setSource(Object source,
int index)
ParameterBlock
of this node to a new source object.
This is a convenience method that invokes
setParameterBlock() and so adheres to the same event
firing behavior.
The node is added automatically as a sink if the source is a
PlanarImage or a CollectionImage. If
appropriate the node is removed as a sink of any previous source
at the same index.
source - The Source to be set.index - The Index at which it is to be set.source is null.index is invalid.public boolean removeSource(Object source)
Object source from the
ParameterBlock of this node.
The node is removed automatically as a sink if the source is a
PlanarImage or a CollectionImage.
source - A Object to be removed.true if the element was present, false
otherwise.source is null.public PlanarImage getSourceImage(int index)
PlanarImage source stored in the
ParameterBlock of this node.
If there is no source corresponding to the specified index, an
ArrayIndexOutOfBoundsException will be thrown.index - The index of the desired source.PlanarImage source.index is invalid.PlanarImage.public Object getSourceObject(int index)
ParameterBlock of this node.
If there is no source corresponding to the specified index, an
ArrayIndexOutOfBoundsException will be thrown.index - The index of the source.index is invalid.public int getNumSources()
ParameterBlock of this node.
This may differ from the number of sources of the rendered image.public Vector getSources()
Vector of sources stored in the
ParameterBlock of this node.
This may differ from the source vector of the rendering of the node.public void setSources(List sourceList)
ParameterBlock of this node
with a new list of sources.
This is a convenience method that invokes
setParameterBlock() and so adheres to the same event
firing behavior.
The node is added automatically as a sink of any source which is a
PlanarImage or a CollectionImage. It is
also automatically removed as a sink of any such prior sources which
are no longer sources.
sourceList - A List of sources.sourceList is null.public void removeSources()
ParameterBlock of this node.
This is a convenience method that invokes
setParameterBlock() and so adheres to the same event
firing behavior.
The node is removed automatically as a sink of any source which
is a PlanarImage or a CollectionImage.
public void addSink(PlanarImage sink)
PlanarImage sink to the list of sinks of the node.
Note that the behavior of this method has changed as of
Java Advanced Imaging 1.1. To obtain the previous behavior use
getRendering().addSink(). The description of the
previous behavior is as follows:
Renders the node if it has not already been rendered, and
adds a
PlanarImage sink to the list of sinks
of the rendered image.
Note also that this class no longer overrides
getSinks(). To obtain the previous behavior of
getSinks() use getRendering().getSinks().
sink is null.public boolean removeSink(PlanarImage sink)
PlanarImage sink from the list of sinks of
the node.
Note that the behavior of this method has changed as of
Java Advanced Imaging 1.1. To obtain the previous behavior use
getRendering().removeSink(). The description of the
previous behavior is as follows:
Renders the node if it has not already been rendered, and
removes a
PlanarImage sink from the list of sinks
of the rendered image.
Note also that this class no longer overrides
getSinks(). To obtain the previous behavior of
getSinks() use getRendering().getSinks().
sink is null.public void removeSinks()
public boolean addSink(Object sink)
PropertyChangeListener it will be
notified in the same manner as registered listeners for the
changes to the "Rendering" property of this node as long as its
WeakReference has not yet been cleared.sink is null.public boolean removeSink(Object sink)
PropertyChangeListener for the "Rendering"
property of this node it will no longer be eligible for
notification events indicating a change in this property.sink is null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||