RemoteRenderedImage
interface. A RemoteRenderedOp
stores a protocol name (as a String
), a server name (as a String
), an operation name (as a String
), a ParameterBlock
containing sources and miscellaneous parameters, and a RenderingHints
containing rendering hints. A set of nodes may be joined together via the source Vector
s within their ParameterBlock
s to form a directed acyclic graph (DAG). The topology i.e., connectivity of the graph may be altered by changing the ParameterBlock
s; the operation name, parameters, and rendering hints may also be changed. Such chains represent and handle operations that are being performed remotely. They convey the structure of an imaging chain in a compact representation and can be used to influence the remote imaging process (through the use of retry interval, retries and negotiation preferences).
RemoteRenderedOp
s are a client side representation of the chain of operations taking place on the server.
The translation between RemoteRenderedOp
chains and RemoteRenderedImage
(usually PlanarImageServerProxy
) chains makes use of two levels of indirection provided by the OperationRegistry
and RemoteRIF
facilities. First, the local OperationRegistry
is used to map the protocol name into a RemoteRIF
. This RemoteRIF
then constructs one or more RemoteRenderedImage
s (usually PlanarImageServerProxy
s) to do the actual work (or returns a RemoteRenderedImage
by other means. The OperationRegistry
maps a protocol name into a RemoteRIF
, since there is one to one correspondence between a protocol name and a RemoteRIF
. This differs from the case of RenderedOp
s, where the OperationRegistry
maps each operation name to a RenderedImageFactory
(RIF), since there is a one to one correspondence between an operation name and a RIF. The RemoteRIF
s are therefore protocol-specific and not operation specific, while a RIF is operation specific.
Once a protocol name has been mapped into a RemoteRIF
, the RemoteRIF.create()
method is used to create a rendering. This rendering is responsible for communicating with the server to perform the specified operation remotely.
By virtue of being a subclass of RenderedOp
, this class participates in Java Bean-style events as specified by RenderedOp
. This means that PropertyChangeEmitter
methods may be used to register and unregister PropertyChangeListener
s. RemoteRenderedOp
s are also PropertyChangeListener
s so that they may be registered as listeners of other PropertyChangeEmitter
s or the equivalent. Each RemoteRenderedOp
also automatically receives any RenderingChangeEvent
s emitted by any of its sources which are RenderedOp
s.
RemoteRenderedOp
s add the server name and the protocol name to the critical attributes, the editing (changing) of which, coupled with a difference in the old and new rendering over some non-empty region, may cause a RenderingChangeEvent
to be emitted. As with RenderedOp
, editing of a critical attribute of a RemoteRenderedOp
will cause a PropertyChangeEventJAI
detailing the change to be fired to all registered PropertyChangeListener
s. RemoteRenderedOp
registers itself as a PropertyChangeListener
for all critical attributes, and thus receives all PropertyChangeEventJAI
events generated by itself. This is done in order to allow the event handling code to generate a new rendering and reuse any tiles that might be valid after the critical argument change.
When a RemoteRenderedOp
node receives a PropertyChangeEventJAI
from itself, the region of the current rendering which is invalidated is computed using RemoteDescriptor.getInvalidRegion()
. When a RemoteRenderedOp
node receives a RenderingChangeEvent
from one of its sources, the region of the current rendering which is invalidated is computed using the mapSourceRect()
method of the current rendering and the invalid region of the source (retrieved using RenderingChangeEvent.getInvalidRegion()
) If the complement of the invalid region contains any tiles of the current rendering, a new rendering of the node will be generated using the new source node and its rendering generated using that version of RemoteRIF.create
() that updates the rendering of the node according to the specified PropertyChangeEventJAI
. 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 PropertyChangeListener
s of the node, and to any node sinks that are PropertyChangeListener
s. 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.
@see RenderedOp
@see RemoteRenderedImage
@since JAI 1.1
|
|