|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.CRIFImpl
A utility class to minimize in most cases the effort required to implement
the ContextualRenderedImageFactory
(CRIF) of an operation.
An extender of this class is required to implement only the method
RenderedImage create(ParameterBlock, RenderingHints)
defined in the RenderedImageFactory
interface. The remaining
methods may be overridden insofar as this is necessary to obtain behavior
different from that provided by default.
ContextualRenderedImageFactory
,
RenderedImageFactory
Field Summary | |
protected String |
operationName
If non- null , this name will be used as a parameter to
JAI.create() in
create(RenderContext,ParameterBlock) ; otherwise the RIF
create(ParameterBlock,RenderingHints) method implemented
in the extending class will be invoked. |
Constructor Summary | |
CRIFImpl()
Default constructor. |
|
CRIFImpl(String operationName)
Constructor. |
Method Summary | |
abstract RenderedImage |
create(ParameterBlock paramBlock,
RenderingHints renderHints)
The RenderedImageFactory create() method
which must be implemented by concrete subclasses. |
RenderedImage |
create(RenderContext renderContext,
ParameterBlock paramBlock)
Creates a RenderedImage from the renderable layer. |
Rectangle2D |
getBounds2D(ParameterBlock paramBlock)
Returns the bounding box for the output of the operation. |
Object |
getProperty(ParameterBlock paramBlock,
String name)
Returns the appropriate instance of the property with the indicated name. |
String[] |
getPropertyNames()
Returns the valid property names for the operation. |
boolean |
isDynamic()
Returns true if successive renderings with the same
arguments may produce different results. |
RenderContext |
mapRenderContext(int i,
RenderContext renderContext,
ParameterBlock paramBlock,
RenderableImage image)
Maps the destination RenderContext into a
RenderContext for each source. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected String operationName
null
, this name will be used as a parameter to
JAI.create()
in
create(RenderContext,ParameterBlock)
; otherwise the RIF
create(ParameterBlock,RenderingHints)
method implemented
in the extending class will be invoked.Constructor Detail |
public CRIFImpl()
null
.public CRIFImpl(String operationName)
null
.Method Detail |
public abstract RenderedImage create(ParameterBlock paramBlock, RenderingHints renderHints)
RenderedImageFactory
create()
method
which must be implemented by concrete subclasses.public RenderedImage create(RenderContext renderContext, ParameterBlock paramBlock)
RenderedImage
from the renderable layer.
If operationName
is non-null
,
JAI.create()
will be invoked using the supplied
ParameterBlock
and the RenderingHints
contained in the RenderContext
. If
operationName
is null
, or
JAI.create()
returns null
, the
create(ParameterBlock,RenderingHints)
method defined
in the extending class will be invoked.
renderContext
- The rendering information associated with
this rendering.paramBlock
- The parameters used to create the image.RenderedImage
.public RenderContext mapRenderContext(int i, RenderContext renderContext, ParameterBlock paramBlock, RenderableImage image)
RenderContext
into a
RenderContext
for each source. The
implementation in this class simply returns the
RenderContext
passed in by the caller.i
- The index of the source image.renderContext
- The RenderContext
being applied to
the operation.paramBlock
- A ParameterBlock
containing the
sources and parameters of the operation.image
- The RenderableImage
being rendered.RenderContext
to be used to render the
given source.public Rectangle2D getBounds2D(ParameterBlock paramBlock)
paramBlock
- A ParameterBlock
containing the
sources and parameters of the operation.Rectangle2D
specifying the bounding box.public Object getProperty(ParameterBlock paramBlock, String name)
The implementation in this class always returns
java.awt.Image.UndefinedProperty
since
no properties are defined by default.
paramBlock
- A ParameterBlock
containing the
sources and parameters of the operation.name
- A String
containing the desired property name.java.awt.Image.UndefinedProperty
indicating that the property is undefined.public String[] getPropertyNames()
null
since no properties are associated with the operation by
default.null
indicating that no properties are defined.public boolean isDynamic()
true
if successive renderings with the same
arguments may produce different results. The implementation in this
class always returns false
so as to enable caching
of renderings by default. CRIFs that do implement dynamic
rendering behavior must override this method.false
indicating that the rendering is static.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |