Package org.jfree.chart.ui
Class StandardGradientPaintTransformer
java.lang.Object
org.jfree.chart.ui.StandardGradientPaintTransformer
- All Implemented Interfaces:
Serializable,Cloneable,GradientPaintTransformer,PublicCloneable
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.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new transformer with the typeGradientPaintTransformType.VERTICAL.Creates a new transformer with the specified type. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a clone of the transformer.booleanTests this instance for equality with an arbitrary object.getType()Returns the type of transform.inthashCode()Returns a hash code for this object.transform(GradientPaint paint, Shape target) Transforms aGradientPaintinstance to fit the specifiedtargetshape.
-
Constructor Details
-
StandardGradientPaintTransformer
public StandardGradientPaintTransformer()Creates a new transformer with the typeGradientPaintTransformType.VERTICAL. -
StandardGradientPaintTransformer
Creates a new transformer with the specified type.- Parameters:
type- the transform type (nullnot permitted).
-
-
Method Details
-
getType
Returns the type of transform.- Returns:
- The type of transform (never
null).
-
transform
Transforms aGradientPaintinstance to fit the specifiedtargetshape.- Specified by:
transformin interfaceGradientPaintTransformer- Parameters:
paint- the original paint (nullnot permitted).target- the target shape (nullnot permitted).- Returns:
- The transformed paint.
-
equals
Tests this instance for equality with an arbitrary object. -
clone
Returns a clone of the transformer. Note that instances of this class are immutable, so cloning an instance isn't really necessary.- Specified by:
clonein interfacePublicCloneable- Overrides:
clonein classObject- Returns:
- A clone.
- Throws:
CloneNotSupportedException- not thrown by this class, but subclasses (if any) might.
-
hashCode
Returns a hash code for this object.
-