org.jfree.ui

Class StandardGradientPaintTransformer

public class StandardGradientPaintTransformer extends Object implements GradientPaintTransformer, Cloneable, PublicCloneable, Serializable

Transforms a GradientPaint to range over the width of a target shape. Instances of this class are immutable.

Author: David Gilbert

Constructor Summary
StandardGradientPaintTransformer()
Creates a new transformer with the type VERTICAL.
StandardGradientPaintTransformer(GradientPaintTransformType type)
Creates a new transformer with the specified type.
Method Summary
Objectclone()
Returns a clone of the transformer.
booleanequals(Object obj)
Tests this instance for equality with an arbitrary object.
GradientPaintTransformTypegetType()
Returns the type of transform.
inthashCode()
Returns a hash code for this object.
GradientPainttransform(GradientPaint paint, Shape target)
Transforms a GradientPaint instance to fit the specified target shape.

Constructor Detail

StandardGradientPaintTransformer

public StandardGradientPaintTransformer()
Creates a new transformer with the type VERTICAL.

StandardGradientPaintTransformer

public StandardGradientPaintTransformer(GradientPaintTransformType type)
Creates a new transformer with the specified type.

Parameters: type the transform type (null not permitted).

Method Detail

clone

public Object clone()
Returns a clone of the transformer. Note that instances of this class are immutable, so cloning an instance isn't really necessary.

Returns: A clone.

Throws: CloneNotSupportedException not thrown by this class, but subclasses (if any) might.

equals

public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: A boolean.

getType

public GradientPaintTransformType getType()
Returns the type of transform.

Returns: The type of transform (never null).

Since: 1.0.10

hashCode

public int hashCode()
Returns a hash code for this object.

Returns: A hash code.

transform

public GradientPaint transform(GradientPaint paint, Shape target)
Transforms a GradientPaint instance to fit the specified target shape.

Parameters: paint the original paint (null not permitted). target the target shape (null not permitted).

Returns: The transformed paint.