javax.media.jai
Interface PropertyGenerator

All Superinterfaces:
Serializable

public interface PropertyGenerator
extends Serializable

An interface through which properties may be computed dynamically with respect to an environment of pre-existing properties. In the interest of simplicity and consistency, a PropertyGenerator is required to be a pure function; that is, if called multiple times with the same environment it must produce identical results.

The OperationRegistry class allows PropertyGenerators to be associated with a particular operation type, and will automatically insert them into imaging chains as needed.

Properties are treated in a case-insensitive manner.

See Also:
OperationRegistry

Method Summary
 boolean canGenerateProperties(Object opNode)
          Determines whether the specified Object will be recognized by getProperty(String,Object).
 Class getClass(String propertyName)
          Returns the class expected to be returned by a request for the property with the specified name.
 Object getProperty(String name, Object opNode)
          Computes the value of a property relative to an environment of pre-existing properties.
 Object getProperty(String name, RenderableOp op)
          Deprecated. as of JAI 1.1. Use getProperty(String,Object) instead.
 Object getProperty(String name, RenderedOp op)
          Deprecated. as of JAI 1.1. Use getProperty(String,Object) instead.
 String[] getPropertyNames()
          Returns an array of Strings naming properties emitted by this property generator.
 

Method Detail

getPropertyNames

public String[] getPropertyNames()
Returns an array of Strings naming properties emitted by this property generator. The Strings may contain characters of any case.

Returns:
an array of Strings that may be passed as parameter names to the getProperty() method.

getClass

public Class getClass(String propertyName)
Returns the class expected to be returned by a request for the property with the specified name. If this information is unavailable, null will be returned indicating that getProperty(propertyName).getClass() should be executed instead. A null value might be returned for example to prevent generating the value of a deferred property solely to obtain its class.

Returns:
The Class expected to be return by a request for the value of this property or null.
Throws:
IllegalArgumentException - if propertyName is null.
Since:
JAI 1.1

canGenerateProperties

public boolean canGenerateProperties(Object opNode)
Determines whether the specified Object will be recognized by getProperty(String,Object).

Throws:
IllegalArgumentException - if opNode is null.
Since:
JAI 1.1

getProperty

public Object getProperty(String name,
                          Object opNode)
Computes the value of a property relative to an environment of pre-existing properties. The case of the supplied String is ignored.

In the case of an OperationNode in a chain of operations these properties may be emitted by the sources of the node in a chain or the parameters of that operation. The information requisite to compute the requested property must be available via the supplied OperationNode. It is legal to call getProperty() on the operation's sources.

Parameters:
name - the name of the property, as a String.
Returns:
the value of the property, as an Object or the value java.awt.Image.UndefinedProperty.
Throws:
IllegalArgumentException - if name or opNode is null.
IllegalArgumentException - if opNode is not an instance of a supported class for this method, i.e., canGenerateProperties(opNode) returns false.
Since:
JAI 1.1

getProperty

public Object getProperty(String name,
                          RenderedOp op)
Deprecated. as of JAI 1.1. Use getProperty(String,Object) instead.

Computes the value of a property relative to an environment of pre-existing properties emitted by the sources of a RenderedOp, and the parameters of that operation.

The operation name, sources, and ParameterBlock of the RenderedOp being processed may be obtained by means of the op.getOperationName, op.getSources(), and op.getParameterBlock() methods. It is legal to call getProperty() on the operation's sources.

Parameters:
name - the name of the property, as a String.
op - the RenderedOp representing the operation.
Returns:
the value of the property, as an Object or the value java.awt.Image.UndefinedProperty.
Throws:
IllegalArgumentException - if name or op is null.

getProperty

public Object getProperty(String name,
                          RenderableOp op)
Deprecated. as of JAI 1.1. Use getProperty(String,Object) instead.

Computes the value of a property relative to an environment of pre-existing properties emitted by the sources of a RenderableOp, and the parameters of that operation.

The operation name, sources, and ParameterBlock of the RenderableOp being processed may be obtained by means of the op.getOperationName, op.getSources(), and op.getParameterBlock() methods. It is legal to call getProperty() on the operation's sources.

Parameters:
name - the name of the property, as a String.
op - the RenderableOp representing the operation.
Returns:
the value of the property, as an Object or the value java.awt.Image.UndefinedProperty.
Throws:
IllegalArgumentException - if name or op is null.