Methods Summary |
---|
public java.awt.image.renderable.ParameterBlock | add(java.lang.Object obj)Adds an object to the list of parameters.
parameters.addElement(obj);
return this;
|
public java.awt.image.renderable.ParameterBlock | add(byte b)Adds a Byte to the list of parameters.
return add(new Byte(b));
|
public java.awt.image.renderable.ParameterBlock | add(char c)Adds a Character to the list of parameters.
return add(new Character(c));
|
public java.awt.image.renderable.ParameterBlock | add(short s)Adds a Short to the list of parameters.
return add(new Short(s));
|
public java.awt.image.renderable.ParameterBlock | add(int i)Adds a Integer to the list of parameters.
return add(new Integer(i));
|
public java.awt.image.renderable.ParameterBlock | add(long l)Adds a Long to the list of parameters.
return add(new Long(l));
|
public java.awt.image.renderable.ParameterBlock | add(float f)Adds a Float to the list of parameters.
return add(new Float(f));
|
public java.awt.image.renderable.ParameterBlock | add(double d)Adds a Double to the list of parameters.
return add(new Double(d));
|
public java.awt.image.renderable.ParameterBlock | addSource(java.lang.Object source)Adds an image to end of the list of sources. The image is
stored as an object in order to allow new node types in the
future.
sources.addElement(source);
return this;
|
public java.lang.Object | clone()Creates a copy of a ParameterBlock . The source and parameter
Vectors are cloned, but the actual sources and parameters are
copied by reference. This allows modifications to the order
and number of sources and parameters in the clone to be invisible
to the original ParameterBlock . Changes to the shared sources or
parameters themselves will still be visible.
ParameterBlock theClone;
try {
theClone = (ParameterBlock) super.clone();
} catch (Exception e) {
// We can't be here since we implement Cloneable.
return null;
}
if (sources != null) {
theClone.setSources((Vector)sources.clone());
}
if (parameters != null) {
theClone.setParameters((Vector)parameters.clone());
}
return (Object) theClone;
|
public byte | getByteParameter(int index)A convenience method to return a parameter as a byte. An
exception is thrown if the parameter is
null or not a Byte .
return ((Byte)parameters.elementAt(index)).byteValue();
|
public char | getCharParameter(int index)A convenience method to return a parameter as a char. An
exception is thrown if the parameter is
null or not a Character .
return ((Character)parameters.elementAt(index)).charValue();
|
public double | getDoubleParameter(int index)A convenience method to return a parameter as a double. An
exception is thrown if the parameter is
null or not a Double .
return ((Double)parameters.elementAt(index)).doubleValue();
|
public float | getFloatParameter(int index)A convenience method to return a parameter as a float. An
exception is thrown if the parameter is
null or not a Float .
return ((Float)parameters.elementAt(index)).floatValue();
|
public int | getIntParameter(int index)A convenience method to return a parameter as an int. An
exception is thrown if the parameter is
null or not an Integer .
return ((Integer)parameters.elementAt(index)).intValue();
|
public long | getLongParameter(int index)A convenience method to return a parameter as a long. An
exception is thrown if the parameter is
null or not a Long .
return ((Long)parameters.elementAt(index)).longValue();
|
public int | getNumParameters()Returns the number of parameters (not including source images).
return parameters.size();
|
public int | getNumSources()Returns the number of source images.
return sources.size();
|
public java.lang.Object | getObjectParameter(int index)Gets a parameter as an object.
return parameters.elementAt(index);
|
public java.lang.Class[] | getParamClasses()Returns an array of Class objects describing the types
of the parameters.
int numParams = getNumParameters();
Class [] classes = new Class[numParams];
int i;
for (i = 0; i < numParams; i++) {
Object obj = getObjectParameter(i);
if (obj instanceof Byte) {
classes[i] = byte.class;
} else if (obj instanceof Character) {
classes[i] = char.class;
} else if (obj instanceof Short) {
classes[i] = short.class;
} else if (obj instanceof Integer) {
classes[i] = int.class;
} else if (obj instanceof Long) {
classes[i] = long.class;
} else if (obj instanceof Float) {
classes[i] = float.class;
} else if (obj instanceof Double) {
classes[i] = double.class;
} else {
classes[i] = obj.getClass();
}
}
return classes;
|
public java.util.Vector | getParameters()Returns the entire Vector of parameters.
return parameters;
|
public java.awt.image.renderable.RenderableImage | getRenderableSource(int index)Returns a source as a RenderableImage. This method is a
convenience method.
An exception will be thrown if the sources is not a RenderableImage.
return (RenderableImage) sources.elementAt(index);
|
public java.awt.image.RenderedImage | getRenderedSource(int index)Returns a source as a RenderedImage . This method is
a convenience method.
An exception will be thrown if the source is not a RenderedImage.
return (RenderedImage) sources.elementAt(index);
|
public short | getShortParameter(int index)A convenience method to return a parameter as a short. An
exception is thrown if the parameter is
null or not a Short .
return ((Short)parameters.elementAt(index)).shortValue();
|
public java.lang.Object | getSource(int index)Returns a source as a general Object. The caller must cast it into
an appropriate type.
return sources.elementAt(index);
|
public java.util.Vector | getSources()Returns the entire Vector of sources.
return sources;
|
public void | removeParameters()Clears the list of parameters.
parameters = new Vector();
|
public void | removeSources()Clears the list of source images.
sources = new Vector();
|
public java.awt.image.renderable.ParameterBlock | set(java.lang.Object obj, int index)Replaces an Object in the list of parameters.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
int oldSize = parameters.size();
int newSize = index + 1;
if (oldSize < newSize) {
parameters.setSize(newSize);
}
parameters.setElementAt(obj, index);
return this;
|
public java.awt.image.renderable.ParameterBlock | set(byte b, int index)Replaces an Object in the list of parameters with a Byte.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
return set(new Byte(b), index);
|
public java.awt.image.renderable.ParameterBlock | set(char c, int index)Replaces an Object in the list of parameters with a Character.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
return set(new Character(c), index);
|
public java.awt.image.renderable.ParameterBlock | set(short s, int index)Replaces an Object in the list of parameters with a Short.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
return set(new Short(s), index);
|
public java.awt.image.renderable.ParameterBlock | set(int i, int index)Replaces an Object in the list of parameters with an Integer.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
return set(new Integer(i), index);
|
public java.awt.image.renderable.ParameterBlock | set(long l, int index)Replaces an Object in the list of parameters with a Long.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
return set(new Long(l), index);
|
public java.awt.image.renderable.ParameterBlock | set(float f, int index)Replaces an Object in the list of parameters with a Float.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
return set(new Float(f), index);
|
public java.awt.image.renderable.ParameterBlock | set(double d, int index)Replaces an Object in the list of parameters with a Double.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
return set(new Double(d), index);
|
public void | setParameters(java.util.Vector parameters)Sets the entire Vector of parameters to a given Vector.
this.parameters = parameters;
|
public java.awt.image.renderable.ParameterBlock | setSource(java.lang.Object source, int index)Replaces an entry in the list of source with a new source.
If the index lies beyond the current source list,
the list is extended with nulls as needed.
int oldSize = sources.size();
int newSize = index + 1;
if (oldSize < newSize) {
sources.setSize(newSize);
}
sources.setElementAt(source, index);
return this;
|
public void | setSources(java.util.Vector sources)Sets the entire Vector of sources to a given Vector.
this.sources = sources;
|
public java.lang.Object | shallowClone()Creates a shallow copy of a ParameterBlock . The source and
parameter Vectors are copied by reference -- additions or
changes will be visible to both versions.
try {
return super.clone();
} catch (Exception e) {
// We can't be here since we implement Cloneable.
return null;
}
|