|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--javax.media.jai.OperationDescriptorImpl
This class provides an abstract implementation of the
OperationDescriptor interface that is suitable for
subclassing.
OperationDescriptor,
RegistryElementDescriptor, Serialized Form| Field Summary | |
protected String[][] |
resources
The resource tags and their corresponding data, stored as an two-dimensional String array. |
protected String[] |
sourceNames
An array of Strings that are the names of the
sources of this operation. |
protected String[] |
supportedModes
An array of operation modes supported by this operator. |
| Fields inherited from interface javax.media.jai.OperationDescriptor |
NO_PARAMETER_DEFAULT |
| Constructor Summary | |
OperationDescriptorImpl(String[][] resources,
Class[] sourceClasses)
Deprecated. as of JAI 1.1 in favor of constructors where the mode specfic information is explicitly specified. |
|
OperationDescriptorImpl(String[][] resources,
Class[] sourceClasses,
Class[] renderableSourceClasses)
Deprecated. as of JAI 1.1 in favor of constructors where the mode specfic information is explicitly specified. |
|
OperationDescriptorImpl(String[][] resources,
Class[] sourceClasses,
Class[] renderableSourceClasses,
Class[] paramClasses,
String[] paramNames,
Object[] paramDefaults)
Deprecated. as of JAI 1.1 in favor of constructors where supported modes are explicitly specified. Uses isRenderedSupported() and
isRenderableSupported() to figure out the supported modes. |
|
OperationDescriptorImpl(String[][] resources,
Class[] paramClasses,
String[] paramNames,
Object[] paramDefaults)
Deprecated. as of JAI 1.1 in favor of constructors where the mode specfic information is explicitly specified. |
|
OperationDescriptorImpl(String[][] resources,
int numSources)
Deprecated. as of JAI 1.1 in favor of constructors where the mode specfic information is explicitly specified. |
|
OperationDescriptorImpl(String[][] resources,
int numSources,
Class[] paramClasses,
String[] paramNames,
Object[] paramDefaults)
Deprecated. as of JAI 1.1 in favor of constructors where supported modes are explicitly specified. Uses isRenderedSupported() and
isRenderableSupported() to figure out the supported modes. |
|
OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
int numSources,
String[] paramNames,
Class[] paramClasses,
Object[] paramDefaults,
Object[] validParamValues)
Constructor. |
|
OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
String[] sourceNames,
Class[][] sourceClasses,
ParameterListDescriptor pld)
Constructor. |
|
OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
String[] sourceNames,
Class[][] sourceClasses,
ParameterListDescriptor[] pld)
Constructor which accepts a ParameterListDescriptor
to describe the parameters for each mode. |
|
OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
String[] sourceNames,
Class[][] sourceClasses,
String[] paramNames,
Class[][] paramClasses,
Object[][] paramDefaults,
Object[][] validParamValues)
Constructor. |
|
OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
String[] sourceNames,
Class[][] sourceClasses,
String[] paramNames,
Class[] paramClasses,
Object[] paramDefaults,
Object[] validParamValues)
Constructor. |
|
| Method Summary | |
boolean |
arePropertiesSupported()
Does this descriptor support properties ? |
protected static Class |
getDefaultSourceClass(String modeName)
Get the default source class for the supported mode. |
Class |
getDestClass()
Deprecated. as of JAI 1.1 in favor of getDestClass("rendered") |
Class |
getDestClass(String modeName)
Returns a Class that describes the type of
destination this operation produces for the specified mode. |
Object |
getInvalidRegion(String modeName,
ParameterBlock oldParamBlock,
RenderingHints oldHints,
ParameterBlock newParamBlock,
RenderingHints newHints,
OperationNode node)
Calculates the region over which two distinct renderings of an operation may be expected to differ. |
String |
getName()
Returns the name of this operation; this is the same as the GlobalName value in the resources and is visible
to all. |
int |
getNumParameters()
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getNumParameters()
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
int |
getNumSources()
Returns the number of sources required by this operation. |
Class[] |
getParamClasses()
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamClasses()
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
Object[] |
getParamDefaults()
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamDefaults()
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
Object |
getParamDefaultValue(int index)
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamDefaultValue(...)
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
ParameterListDescriptor |
getParameterListDescriptor(String modeName)
Returns the ParameterListDescriptor that describes
the associated parameters (NOT sources). |
Number |
getParamMaxValue(int index)
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamValueRange()
This will for the time being use getSupportedModes()[0]
for modeName.
If the parameter is not a sub-class of the Else if the above getParamValueRange() returns a non-null
Else returns the |
Number |
getParamMinValue(int index)
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamValueRange()
This will for the time being use getSupportedModes()[0]
for modeName.
If the parameter is not a sub-class of the Else if the above getParamValueRange() returns a non-null
Else for |
String[] |
getParamNames()
Deprecated. as of JAI 1.1 in favor of
getParameterListDescriptor(modeName).getParamNames()
This will for the time being return the above value for
modeName = getSupportedModes()[0] |
PropertyGenerator[] |
getPropertyGenerators()
Deprecated. as of JAI 1.1 in favor of the equivalent method that specifies the mode name. |
PropertyGenerator[] |
getPropertyGenerators(String modeName)
Returns an array of PropertyGenerators implementing
the property inheritance for this operator that may be used as
a basis for the operation's property management. |
Class |
getRenderableDestClass()
Deprecated. as of JAI 1.1 in favor of getDestClass("renderable") |
Class[] |
getRenderableSourceClasses()
Deprecated. as of JAI 1.1 in favor of getSourceClasses("renderable") |
ResourceBundle |
getResourceBundle(Locale locale)
Returns the resource data for this operation in a ResourceBundle. |
String[][] |
getResources(Locale locale)
Returns the resource data for this operation. |
Class[] |
getSourceClasses()
Deprecated. as of JAI 1.1 in favor of getSourceClasses("rendered") |
Class[] |
getSourceClasses(String modeName)
Returns an array of Classes that describe the types
of sources required by this operation for the specified mode. |
String[] |
getSourceNames()
Returns an array of Strings that are the names
of the sources of this operation. |
String[] |
getSupportedModes()
The registry modes supported by this descriptor. |
boolean |
isImmediate()
Returns true if the operation should be computed
immediately for all supported modes of this operation during
the call to JAI.create(); that is, the operation
is placed in immediate mode. |
boolean |
isModeSupported(String modeName)
Does this descriptor support the specified registry mode ?. |
boolean |
isRenderableSupported()
Deprecated. as of JAI 1.1 in favor of isModeSupported("renderable") |
boolean |
isRenderedSupported()
Deprecated. as of JAI 1.1 in favor of isModeSupported("rendered") |
protected static Class[][] |
makeDefaultSourceClassList(String[] supportedModes,
int numSources)
Create a list of per mode source classes for each supported mode which can then be passed on to the constructor. |
boolean |
validateArguments(ParameterBlock args,
StringBuffer msg)
Deprecated. as of JAI 1.1 in favor of validateArguments("rendered", ...) |
boolean |
validateArguments(String modeName,
ParameterBlock args,
StringBuffer msg)
Returns true if this operation/mode is capable of
handling the input source(s) and/or parameter(s)
specified in the ParameterBlock, or
false otherwise, in which case an explanatory
message may be appended to the StringBuffer. |
protected boolean |
validateParameters(ParameterBlock args,
StringBuffer msg)
Deprecated. as of JAI 1.1 in favor of
validateParameters(getSupportedModes()[0], ...) |
protected boolean |
validateParameters(String modeName,
ParameterBlock args,
StringBuffer msg)
Returns true if this operation is capable of
handling the input parameters for the specified mode. |
boolean |
validateRenderableArguments(ParameterBlock args,
StringBuffer msg)
Deprecated. as of JAI 1.1 in favor of validateArguments("renderable", ...) |
protected boolean |
validateRenderableSources(ParameterBlock args,
StringBuffer msg)
Deprecated. as of JAI 1.1 in favor of
validateSources("renderable", ...) |
protected boolean |
validateSources(ParameterBlock args,
StringBuffer msg)
Deprecated. as of JAI 1.1 in favor of
validateSources("rendered", ...) |
protected boolean |
validateSources(String modeName,
ParameterBlock args,
StringBuffer msg)
Returns true if this operation supports the
specified mode, and is capable of handling the given input
source(s) for the specified mode. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected final String[][] resources
String array.protected final String[] supportedModes
protected final String[] sourceNames
Strings that are the names of the
sources of this operation. The names must be listed in the
order corresponding to the source Classes.| Constructor Detail |
public OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
String[] sourceNames,
Class[][] sourceClasses,
String[] paramNames,
Class[][] paramClasses,
Object[][] paramDefaults,
Object[][] validParamValues)
sourceClasses[m][i]
corresponds to the mode supportedModes[m]
and the source sourceNames[i]. Similarly
paramClasses[m][i] corresponds to the
mode supportedModes[m] and the parameter
paramNames[i]. The same holds true for
paramDefaults and validParamValuesresources - The resource tags and their corresponding data.supportedModes - The modes that this operator supports.
maybe one or more of "rendered", "renderable", "collection",
and "renderableCollection" (or other image operation related
modes that maybe defined later). Must support at least one mode.sourceNames - The source names. It may be null
if this operation has no sources or if the default source
naming convention ("source0", "source1", etc.) is to be used.sourceClasses - The source types required by this operation
for each of the above supported modes. can be null
if this operation has no sources. The number of
sources for each mode must be the same.paramNames - The localized parameter names. It may be
null if this operation has no parameters.paramClasses - The parameter types required by this operation.
for each mode. It may be null if this operation
has no parameters. The number of parameters for each mode
must be the same.paramDefaults - The parameter default values for each parameter
for each mode. It may be null if this
operation has no parameters, or none of the parameters has
a default value for any mode. The parameter defaults for an
individual mode may be null, if there are no defaults for
that mode.validParamValues - defines the valid values for each parameter
for each mode. this can be null if the operation
has no parameters. Otherwise each element can be filled in as
defined in ParameterListDescriptorImpl.ParameterListDescriptorImpl(
Object, String[], Class[], Object[], Object[])resources is
null.nullsourceClasses
for each mode is not the same or is not equal to the number
of sourceNames (if non-null).paramClasses or paramNames is
null.sourceNames
is non-null and its length does not equal
the number of sources of this operation.paramClasses, paramNames,
and paramDefaults (if all are not
null) do not all have the same number of elements.
public OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
String[] sourceNames,
Class[][] sourceClasses,
String[] paramNames,
Class[] paramClasses,
Object[] paramDefaults,
Object[] validParamValues)
sourceClasses[m][i] corresponds to
the mode supportedModes[m] and the source
sourceNames[i].resources - The resource tags and their corresponding data.supportedModes - The modes that this operator supports.
maybe one or more of "rendered", "renderable", "collection",
and "renderableCollection". Must support at least one mode.sourceNames - The source names. It may be null
if this operation has no sources or if the default source
naming convention ("source0", "source1", etc.) is to be used.sourceClasses - The source types required by this operation
for each of the above supported modes. can be null
if this operation has no sources. The number of
sources for each mode must be the same.paramNames - The localized parameter names. It may be
null if this operation has no parameters.paramClasses - The parameter types required by this operation.
It may be null if this operation has no parameters.paramDefaults - The parameter default values for each parameter
It may be null if this operation has no
parameters, or none of the parameters has a default value.validParamValues - defines the valid values for each parameter
for all modes. this can be null if the operation
has no parameters. Otherwise it can be filled in as
defined in ParameterListDescriptorImpl.ParameterListDescriptorImpl(
Object, String[], Class[], Object[], Object[])resources is
null.nullsourceClasses
for each mode is not the same or is not equal to the number
of sourceNames (if non-null).paramClasses or paramNames is
null.sourceNames
is non-null and its length does not equal
the number of sources of this operation.paramClasses, paramNames,
and paramDefaults (if all are not
null) do not all have the same number of elements.
public OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
int numSources,
String[] paramNames,
Class[] paramClasses,
Object[] paramDefaults,
Object[] validParamValues)
makeDefaultSourceClassList() from numSources
and supportedModesresources - The resource tags and their corresponding data.supportedModes - The modes that this operator supports.
maybe one or more of "rendered", "renderable", "collection",
and "renderableCollection". Must support at least one mode.numSources - The number of sources.paramNames - The localized parameter names. It may be
null if this operation has no parameters.paramClasses - The parameter types required by this operation.
It may be null if this operation has no parameters.paramDefaults - The parameter default values for each parameter
It may be null if this operation has no
parameters, or none of the parameters has a default value.validParamValues - defines the valid values for each parameter
for all modes. this can be null if the operation
has no parameters. Otherwise it can be filled in as
defined in ParameterListDescriptorImpl.ParameterListDescriptorImpl(
Object, String[], Class[], Object[], Object[])resources is
null.nullparamClasses or paramNames is
null.paramClasses, paramNames,
and paramDefaults (if all are not
null) do not all have the same number of elements.
public OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
String[] sourceNames,
Class[][] sourceClasses,
ParameterListDescriptor[] pld)
ParameterListDescriptor
to describe the parameters for each mode. Note
that sourceClasses[m][i] corresponds to
the mode supportedModes[m] and the source
sourceNames[i].resources - The resource tags and their corresponding data.supportedModes - The modes that this operator supports.
maybe one or more of "rendered", "renderable", "collection",
and "renderableCollection". Must support at least one mode.sourceNames - The source names. It may be null
if this operation has no sources or if the default source
naming convention ("source0", "source1", etc.) is to be used.sourceClasses - The source types required by this operation
for each of the above supported modes. can be null
if this operation has no sources. The number of
sources for each mode must be the same.pld - the parameter list descriptor for each mode.
Can be null if there are no parameters.resources is
null.nullsourceClasses
for each mode is not the same or is not equal to the number
of sourceNames (if non-null).sourceNames
is non-null and its length does not equal
the number of sources of this operation.
public OperationDescriptorImpl(String[][] resources,
String[] supportedModes,
String[] sourceNames,
Class[][] sourceClasses,
ParameterListDescriptor pld)
ParameterListDescriptor. Note
that sourceClasses[m][i] corresponds to
the mode supportedModes[m] and the source
sourceNames[i].resources - The resource tags and their corresponding data.supportedModes - The modes that this operator supports.
maybe one or more of "rendered", "renderable", "collection",
and "renderableCollection". Must support at least one mode.sourceNames - The source names. It may be null
if this operation has no sources or if the default source
naming convention ("source0", "source1", etc.) is to be used.sourceClasses - The source types required by this operation
for each of the above supported modes. can be null
if this operation has no sources. The number of
sources for each mode must be the same.pld - the parameter list descriptor for all modes.
Can be null if there are no parameters.resources is
null.nullsourceClasses
for each mode is not the same or is not equal to the number
of sourceNames (if non-null).sourceNames
is non-null and its length does not equal
the number of sources of this operation.
public OperationDescriptorImpl(String[][] resources,
Class[] sourceClasses,
Class[] renderableSourceClasses,
Class[] paramClasses,
String[] paramNames,
Object[] paramDefaults)
isRenderedSupported() and
isRenderableSupported() to figure out the supported modes.
resources - The resource tags and their corresponding data.sourceClasses - The source types required by this operation
in the rendered mode. It may be null
if this operation does not support the rendered mode, or
if it has no sources.renderableSourceClasses - The source types required by this
operation in the renderable mode. It may be
null if this operation does not support the
renderable mode, or if it has no sources.paramClasses - The parameter types required by this operation.
It may be null if this operation has no
parameters.paramNames - The localized parameter names. It may be
null if this operation has no parameters.paramDefaults - The parameter default values. It may be
null if this operation has no parameters,
or none of the parameters has a default value.resources is
null.sourceClasses is null.renderableSourceClasses is null.sourceClasses
and renderableSourceClasses (if both are not
null) do not have the same number of elements.paramClasses or paramNames is
null.paramClasses, paramNames,
and paramDefaults (if all are not
null) do not all have the same number of elements.OperationDescriptorImpl(String[][],
String[], String[], Class [][], String[], Class [], Object[], Object[])
public OperationDescriptorImpl(String[][] resources,
int numSources,
Class[] paramClasses,
String[] paramNames,
Object[] paramDefaults)
isRenderedSupported() and
isRenderableSupported() to figure out the supported modes.
java.awt.image.RenderedImage.class.
The class type for all the source(s) of the renderable mode (if
supported) is set to
java.awt.image.renderable.RenderableImage.resources - The resource tags and their corresponding data.numSources - The number of sources required by this operation.
It should not be negative. A negative value indicates this
operation has no sources.paramClasses - The parameter types required by this operation.
It may be null if this operation has no
parameters.paramNames - The localized parameter names. It may be
null if this operation has no parameters.paramDefaults - The parameter default values. It may be
null if this operation has no parameters,
or none of the parameters has a default value.resources is
null.paramClasses or paramNames is
null.paramClasses, paramNames,
and paramDefaults (if not null)
do not all have the same number of elements.OperationDescriptorImpl(String[][],
String[], int, String[], Class [], Object[], Object[])
public OperationDescriptorImpl(String[][] resources,
Class[] sourceClasses)
resources - The resource tags and their corresponding data.sourceClasses - The source types required by this operation
in the rendered mode. It may be null
if this operation has no sources.resources is
null.OperationDescriptorImpl(String[][],
String[], String[], Class [][], String[], Class [], Object[], Object[])
public OperationDescriptorImpl(String[][] resources,
Class[] sourceClasses,
Class[] renderableSourceClasses)
resources - The resource tags and their corresponding data.sourceClasses - The source types required by this operation
in the rendered mode. It may be null
if this operation does not support the rendered mode, or
if it has no sources.renderableSourceClasses - The source types required by this
operation in the renderable mode. It may be
null if this operation does not support the
renderable mode, or if it has no sources.resources is
null.sourceClasses is null.renderableSourceClasses is null.sourceClasses
and renderableSourceClasses (if both are not
null) do not have the same number of elements.OperationDescriptorImpl(String[][],
String[], String[], Class [][], String[], Class [], Object[], Object[])
public OperationDescriptorImpl(String[][] resources,
Class[] paramClasses,
String[] paramNames,
Object[] paramDefaults)
resources is
null.paramClasses or paramNames is
null.paramClasses, paramNames,
and paramDefaults (if not null)
do not all have the same number of elements.OperationDescriptorImpl(String[][],
String[], int, String[], Class [], Object[], Object[])
public OperationDescriptorImpl(String[][] resources,
int numSources)
java.awt.image.RenderedImage.class.
The class type for all the source(s) of the renderable mode (if
supported) is set to
java.awt.image.renderable.RenderableImage.resources - The resource tags and their corresponding data.numSources - The number of sources required by this operation.
It should not be negative. A negative value indicates this
operation has no sources.resources is
null.OperationDescriptorImpl(String[][],
String[], int, String[], Class [], Object[], Object[])| Method Detail |
public String getName()
GlobalName value in the resources and is visible
to all. This is also descriptor name under which it is registered
in the OperationRegistry.String representing the operation's
global name.GlobalName
resource value is not supplied in the resources.public String[] getSupportedModes()
RegistryMode.getModes()Strings specifying the supported modes.RegistryMode,
RegistryElementDescriptorpublic boolean isModeSupported(String modeName)
modeNames are treated in a case-insensitive
(but retentive) manner.modeName - the registry mode namemodeName is nullRegistryElementDescriptorpublic boolean arePropertiesSupported()
true so that properties are always supported.
Operations that do not wish to support properties must
override this implementation.PropertyGenerator,
RegistryElementDescriptorpublic PropertyGenerator[] getPropertyGenerators(String modeName)
PropertyGenerators implementing
the property inheritance for this operator that may be used as
a basis for the operation's property management. The default
implementation returns null, indicating that source
properties are simply copied. Subclasses should override this
method if they wish to produce inherited properties.
For the sake of backward compatibilty, if a
deprecated constructor was used to create this object,
then this method simply calls its deprecated equivalent,
getPropertyGenerators(), if the modeName is either
"rendered" or "renderable".
modeName - the registry mode namePropertyGenerators, or
null if this operation does not have any of
its own PropertyGenerators.modeName is null
or if it is not one of the supported modes.arePropertiesSupported
returns falseRegistryElementDescriptorpublic ParameterListDescriptor getParameterListDescriptor(String modeName)
ParameterListDescriptor that describes
the associated parameters (NOT sources). This method returns
null if there are no parameters for the specified modeName.
If the specified modeName supports parameters but the
implementing class does not have parameters, then this method
returns a non-null ParameterListDescriptor whose
getNumParameters() returns 0.modeName - the registry mode name.modeName is null
or if it is not one of the supported modes.RegistryElementDescriptorpublic String[][] getResources(Locale locale)
String data for the following tags: "GlobalName",
"LocalName", "Vendor", "Description", "DocURL", and "Version".
Additional resources should be supplied when appropriate.
The default implementation simply returns a reference to
the local "resources" variable, which should be supplied by
each subclass by way of the superclass constructor. It also
ignores the Locale argument, and always returns
the Strings in the default Locale.
locale - The Locale in which to localize the
resource data.Strings containing
the mandatory and optional resource tags and their
corresponding resource data. (String[i][0] is
the tag for the i-th resource and String[i][1] is the
corresponding data)public ResourceBundle getResourceBundle(Locale locale)
ResourceBundle. The resource data are taken from the
getResources() method.
The default implementation ignores the Locale
argument, and always returns the resources in the default
Locale.
locale - The Locale in which to localize the
resource data.ResourceBundle containing mandatory and
optional resource information.public int getNumSources()
public Class[] getSourceClasses(String modeName)
Classes that describe the types
of sources required by this operation for the specified mode.
If this operation has no sources, this method returns null.modeName - the operation mode namenull
or if it is not one of the supported modes.public String[] getSourceNames()
Strings that are the names
of the sources of this operation. If this operation has no
sources, this method returns null. If this
operation has sources but their names were not provided at
construction time, then the returned names will be of the
form "source0", "source1", etc.public Class getDestClass(String modeName)
Class that describes the type of
destination this operation produces for the specified mode.
For the sake of backward compatibilty, if a deprecated constructor was used to create this object, then this method simply calls its deprecated equivalent, if the modeName is either "rendered" or "renderable".
modeName - the operation mode namenull
or if it is not one of the supported modes.
protected boolean validateSources(String modeName,
ParameterBlock args,
StringBuffer msg)
true if this operation supports the
specified mode, and is capable of handling the given input
source(s) for the specified mode. The default implementation
ensures that the ParameterBlock has at least
the required number of sources. It also verifies the class type
of the first getNumSources() and makes sure
that none of them are null. Any extra sources in
the ParameterBlock are ignored. Subclasses should
override this implementation if their requirement on the
sources are different from the default. This method is used by
validateArguments to validate the sources.
For the sake of backward compatibilty, if a
deprecated constructor was used to create this object, then this
method simply calls its deprecated equivalent, if the modeName is
either "rendered" or "renderable".
modeName - the operation mode nameargs - a ParameterBlock that has the sourcesmsg - A string that may contain error messages.null.validateArguments(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
protected boolean validateParameters(String modeName,
ParameterBlock args,
StringBuffer msg)
true if this operation is capable of
handling the input parameters for the specified mode. The default
implementation validates the number of parameters, the class type
of each parameter, and null parameter. For non-null parameters,
it also checks to see if the parameter value is valid. Subclasses
should override this implementation if their requirement on the
parameter objects are different from the default. This is used by
validateArguments to validate the parameters.
JAI allows unspecified tailing parameters if these parameters
have default values. This method automatically sets these unspecified
parameters to their default values. However, if a parameter, which
has a default value, is followed by one or more parameters that
have no default values, this parameter must be specified in the
ParameterBlock; else this method returns
false.
This method sets all the undefined parameters in the
ParameterBlock to their default values, if the default
values are specified.
Note that DeferredData parameters will not be
recognized as valid unless the parameter is defined to have class
DeferredData.class.
For the sake of backward compatibilty, if a
deprecated constructor was used to create this object, then this
method simply calls its deprecated equivalent, if the modeName is
either "rendered" or "renderable".
null.validateArguments(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer),
ParameterListDescriptorImpl.isParameterValueValid(java.lang.String, java.lang.Object)
public boolean validateArguments(String modeName,
ParameterBlock args,
StringBuffer msg)
true if this operation/mode is capable of
handling the input source(s) and/or parameter(s)
specified in the ParameterBlock, or
false otherwise, in which case an explanatory
message may be appended to the StringBuffer.
This method is the standard place where input arguments are
validated against this operation's specification for the specified
mode. It is called by JAI.create() as a part of its
validation process. Thus it is strongly recommended that the
application programs use the JAI.create() methods to
instantiate all the rendered operations.
The default implementation of this method makes sure that
this operator supports the specified mode and then calls
validateSources and validateParameters.
This method sets all the undefined parameters in the
ParameterBlock to their default values, if the default
values are specified.
Note that DeferredData parameters will not be
recognized as valid unless the parameter is defined to have class
DeferredData.class.
modeName - the operation mode nameargs - Input arguments, including source(s) and/or parameter(s).msg - A string that may contain error messages.modeName is nullvalidateSources(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer),
validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)public boolean isImmediate()
true if the operation should be computed
immediately for all supported modes of this operation during
the call to JAI.create(); that is, the operation
is placed in immediate mode. If true, and
the computation fails, null will be returned
from JAI.create(). If false,
JAI.create() will return an instance of the
appropriate destination class that may be asked to compute itself
at a later time; this computation may fail at that time.
Operations that rely on an external resource, such as
a source file, or that produce externally-visible side
effects, such as writing to an output file, should return
true from this method. Operations that rely
only on their sources and parameters usually wish to return
false in order to defer rendering as long as
possible.
The default implementation in this class returns
false so that deferred execution is invoked.
Operations that wish to be placed in the immediate mode must
override this implementation.
public Object getInvalidRegion(String modeName,
ParameterBlock oldParamBlock,
RenderingHints oldHints,
ParameterBlock newParamBlock,
RenderingHints newHints,
OperationNode node)
The class of the returned object will vary as a function of
the mode of the operation. For rendered and renderable two-
dimensional images this will be an instance of a class which
implements java.awt.Shape.
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.null to indicate that there is no
common region of validity.modeName
is null or if the operation requires either
sources or parameters and either oldParamBlock
or newParamBlock is null.oldParamBlock or
newParamBlock do not contain sufficient sources
or parameters for the operation in question.protected static Class getDefaultSourceClass(String modeName)
protected static Class[][] makeDefaultSourceClassList(String[] supportedModes,
int numSources)
getDefaultSourceClass(modeName) to construct this
list.public PropertyGenerator[] getPropertyGenerators()
PropertyGenerators implementing
the property inheritance for this operation. The default
implementation returns null, indicating that source
properties are simply copied. Subclasses should override
this method if they wish to produce inherited properties.getPropertyGenerators(java.lang.String)public boolean isRenderedSupported()
isModeSupported("rendered")
true if this operation supports the
rendered mode. The default implementation in this
class returns true.isModeSupported(java.lang.String)public Class[] getSourceClasses()
getSourceClasses("rendered")
null.rendered mode
is not supported.getSourceClasses(java.lang.String)public Class getDestClass()
getDestClass("rendered")
java.awt.image.RenderedImage.class if this operation
supports the rendered mode, or null otherwise.getDestClass(java.lang.String)
public boolean validateArguments(ParameterBlock args,
StringBuffer msg)
validateArguments("rendered", ...)
true if this operation supports the rendered
mode, and is capable of handling the input arguments for the
rendered mode. The default implementation validates both the
source(s) and the parameter(s).
Note that DeferredData parameters will not be
recognized as valid unless the parameter is defined to have class
DeferredData.class.
Additional validations should be added by each individual operation based on its specification.
args is null.msg is null
and the validation fails.validateArguments(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)public boolean isRenderableSupported()
isModeSupported("renderable")
true if this operation supports the
renderable mode. The default implementation in this
class returns false. Operations that support
the renderable mode must override this implementation.isModeSupported(java.lang.String)public Class[] getRenderableSourceClasses()
getSourceClasses("renderable")
null.renderable mode
is not supported.getSourceClasses(java.lang.String)public Class getRenderableDestClass()
getDestClass("renderable")
java.awt.image.renderable.RenderableImage.class if
this operation supports the renderable mode, or null
otherwise.getDestClass(java.lang.String)
public boolean validateRenderableArguments(ParameterBlock args,
StringBuffer msg)
validateArguments("renderable", ...)
true if this operation supports the
renderable mode, and is capable of handling the input
arguments for the renderable mode. The default implementation
validates both the source(s) and the parameter(s).
If this operation does not support the renderable mode,
this method returns false regardless of the input
arguments.
Note that DeferredData parameters will not be
recognized as valid unless the parameter is defined to have class
DeferredData.class.
Additional validations should be added by each individual operation based on its specification.
args is null.msg is null
and the validation fails.validateArguments(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)public int getNumParameters()
getParameterListDescriptor(modeName).getNumParameters()
This will for the time being return the above value for
modeName = getSupportedModes()[0]
ParameterListDescriptor.getNumParameters()public Class[] getParamClasses()
getParameterListDescriptor(modeName).getParamClasses()
This will for the time being return the above value for
modeName = getSupportedModes()[0]
null.ParameterListDescriptor.getParamClasses()public String[] getParamNames()
getParameterListDescriptor(modeName).getParamNames()
This will for the time being return the above value for
modeName = getSupportedModes()[0]
null.ParameterListDescriptor.getParamNames()public Object[] getParamDefaults()
getParameterListDescriptor(modeName).getParamDefaults()
This will for the time being return the above value for
modeName = getSupportedModes()[0]
null. If a parameter does not have a default value,
the constant
OperationDescriptor.NO_PARAMETER_DEFAULT will be
returned. The validateArguments() and
validateRenderableArguments method will return
false if an input parameter without a default value
is supplied as null, or if an unspecified tailing
parameter does not have a default value.ParameterListDescriptor.getParamDefaults()public Object getParamDefaultValue(int index)
getParameterListDescriptor(modeName).getParamDefaultValue(...)
This will for the time being return the above value for
modeName = getSupportedModes()[0]
null. If a parameter has no default
value, this method returns
OperationDescriptor.NO_PARAMETER_DEFAULT.index - The index of the parameter whose default
value is queried.index.ParameterListDescriptor.getParamDefaultValue(java.lang.String)public Number getParamMinValue(int index)
getParameterListDescriptor(modeName).getParamValueRange()
This will for the time being use getSupportedModes()[0]
for modeName.
If the parameter is not a sub-class of the Number
class then this method returns null.
Else if the above getParamValueRange() returns a non-null
Range then it returns the getMinValue()
of that Range.
Else for Float and Double parameters
it returns the corresponding -MAX_VALUE and
MIN_VALUE for other Number classes.
null.
The return value should be of the class types corresponding to
the parameter's primitive type, that is, Byte for a
byte parameter, Integer for an
int parameter, and so forth.
The default implementation returns the minimum value in the parameter data type's full range.
index - The index of the parameter to be queried.Number representing the minimum legal value,
or null if the specified parameter is not
numeric.index.ParameterListDescriptor.getParamValueRange(java.lang.String),
ParameterListDescriptor.getEnumeratedParameterValues(java.lang.String),
ParameterListDescriptor.isParameterValueValid(java.lang.String, java.lang.Object)public Number getParamMaxValue(int index)
getParameterListDescriptor(modeName).getParamValueRange()
This will for the time being use getSupportedModes()[0]
for modeName.
If the parameter is not a sub-class of the Number
class then this method returns null.
Else if the above getParamValueRange() returns a non-null
Range then it returns the getMaxValue()
of that Range.
Else returns the MAX_VALUE of the corresponding
Number class.
null.
The return value should be of the class type corresponding to
the parameter's primitive type, that is, Byte for a
byte parameter, Integer for an
int parameter, and so forth.
The default implementation returns the maximum value in the parameter data type's full range.
index - The index of the parameter to be queried.Number representing the maximum legal value,
or null if the specified parameter is not
numeric.index.ParameterListDescriptor.getParamValueRange(java.lang.String),
ParameterListDescriptor.getEnumeratedParameterValues(java.lang.String),
ParameterListDescriptor.isParameterValueValid(java.lang.String, java.lang.Object)
protected boolean validateSources(ParameterBlock args,
StringBuffer msg)
validateSources("rendered", ...)
true if this operation supports the rendered
mode, and is capable of handling the given input source(s) for the
rendered mode. The default implementation validates the number of
sources, the class type of each source, and null sources. Subclasses
should override this implementation if their requirement on the
sources are different from the default.args is null.msg is null
and the validation fails.validateSources(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
protected boolean validateRenderableSources(ParameterBlock args,
StringBuffer msg)
validateSources("renderable", ...)
true if this operation supports the
renderable mode, and is capable of handling the given input
source(s) for the renderable mode. The default
implementation validates the number of sources, the class type of
each source, and null sources. Subclasses should override this
implementation if their requirement on the sources are
different from the default.args is null.msg is null
and the validation fails.validateSources(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
protected boolean validateParameters(ParameterBlock args,
StringBuffer msg)
validateParameters(getSupportedModes()[0], ...)
true if this operation is capable of handling
the given input parameters. The default implementation validates the
number of parameters, the class type of each parameter, and null
parameters. For those non-null numeric parameters, it also checks to
see if the parameter value is within the minimum and maximum range.
Subclasses should override this implementation if their requirements
for the parameter objects are different from the default.
JAI allows unspecified tailing parameters if these parameters
have default values. This method automatically sets these unspecified
parameters to their default values. However, if a parameter, which
has a default value, is followed by one or more parameters that
have no default values, this parameter must be specified in the
ParameterBlock; else this method returns
false.
Note that DeferredData parameters will not be
recognized as valid unless the parameter is defined to have class
DeferredData.class.
args is null.msg is null
and the validation fails.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||