javax.media.jai.operator
Class NullDescriptor

java.lang.Object
  extended byjavax.media.jai.OperationDescriptorImpl
      extended byjavax.media.jai.operator.NullDescriptor
All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class NullDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "Null" operation.

The "Null" operation performs no processing. It merely propagates its first source along the operation chain unmodified. There may be an arbitrary number of sources but only the first one is passed along so it must have the appropriate class type for the operation mode.

This operation may be useful as a placeholder in operation chains and in creating nodes to which PropertyGenerators may be attached. This would enable non-image data nodes to be present in chains without requiring that specific OperationDescriptors be implemented for these operations. The PropertyGenerators required would in this case be added locally to the nodes using the addPropertyGenerator() method of the node.

Resource List
Name Value
GlobalName Null
LocalName Null
Vendor com.sun.media.jai
Description An operation which does no processing.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/NullDescriptor.html
Version 1.0

No parameters are needed for this operation.

Since:
JAI 1.1
See Also:
OperationDescriptor, Serialized Form

Field Summary
 
Fields inherited from class javax.media.jai.OperationDescriptorImpl
sourceNames
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
NullDescriptor()
          Constructor.
 
Method Summary
static RenderedOp create(RenderedImage source0, RenderingHints hints)
          An operation which does no processing.
static RenderableOp createRenderable(RenderableImage source0, RenderingHints hints)
          An operation which does no processing.
 Object getInvalidRegion(String modeName, ParameterBlock oldParamBlock, RenderingHints oldHints, ParameterBlock newParamBlock, RenderingHints newHints, OperationNode node)
          Calculates the region over which two distinct renderings of the "Null" operation may be expected to differ.
protected  boolean validateSources(String modeName, ParameterBlock args, StringBuffer msg)
          Returns true if there is at least one source and the first source is a RenderedImage or RenderableImage.
 
Methods inherited from class javax.media.jai.OperationDescriptorImpl
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamMaxValue, getParamMinValue, getParamNames, getPropertyGenerators, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isImmediate, isModeSupported, isRenderableSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateArguments, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullDescriptor

public NullDescriptor()
Constructor.

Method Detail

validateSources

protected boolean validateSources(String modeName,
                                  ParameterBlock args,
                                  StringBuffer msg)
Returns true if there is at least one source and the first source is a RenderedImage or RenderableImage.

Overrides:
validateSources in class OperationDescriptorImpl
Parameters:
modeName - the operation mode name
args - a ParameterBlock that has the sources
msg - A string that may contain error messages.
Throws:
IllegalArgumentException - if args is null.
IllegalArgumentException - if msg is null and the validation fails.
See Also:
OperationDescriptorImpl.validateArguments(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)

getInvalidRegion

public Object getInvalidRegion(String modeName,
                               ParameterBlock oldParamBlock,
                               RenderingHints oldHints,
                               ParameterBlock newParamBlock,
                               RenderingHints newHints,
                               OperationNode node)
Calculates the region over which two distinct renderings of the "Null" operation may be expected to differ.

The operation returns an empty Shape if the first source in each of the two ParameterBlocks are equal according to the equals() method of the old source or null for all other cases.

Specified by:
getInvalidRegion in interface OperationDescriptor
Overrides:
getInvalidRegion in class OperationDescriptorImpl
Parameters:
modeName - The name of the mode.
oldParamBlock - The previous sources and parameters.
oldHints - The previous hints.
newParamBlock - The current sources and parameters.
newHints - The current hints.
node - The affected node in the processing chain (ignored).
Returns:
The region over which the data of two renderings of this operation may be expected to be invalid or null if there is no common region of validity. A non-null empty region indicates that the operation would produce identical data over the bounds of the old rendering although perhaps not over the area occupied by the tiles of the old rendering.
Throws:
IllegalArgumentException - if modeName is null or if either oldParamBlock or newParamBlock is null.
IllegalArgumentException - if oldParamBlock or newParamBlock does not contain at least one source.

create

public static RenderedOp create(RenderedImage source0,
                                RenderingHints hints)
An operation which does no processing.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
source0 - RenderedImage source 0.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp

createRenderable

public static RenderableOp createRenderable(RenderableImage source0,
                                            RenderingHints hints)
An operation which does no processing.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.createRenderable(String,ParameterBlock,RenderingHints).

Parameters:
source0 - RenderableImage source 0.
hints - The RenderingHints to use. May be null.
Returns:
The RenderableOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderableOp