- java.lang.Object
-
- org.jfree.chart.util.StandardGradientPaintTransformer
-
- All Implemented Interfaces:
Serializable,Cloneable,PublicCloneable,GradientPaintTransformer
public class StandardGradientPaintTransformer extends Object implements GradientPaintTransformer, Cloneable, PublicCloneable, Serializable
Transforms aGradientPaintto range over the width of a target shape. Instances of this class are immutable.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description StandardGradientPaintTransformer()Creates a new transformer with the typeGradientPaintTransformType.VERTICAL.StandardGradientPaintTransformer(GradientPaintTransformType type)Creates a new transformer with the specified type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 aGradientPaintinstance to fit the specifiedtargetshape.
-
-
-
Constructor Detail
-
StandardGradientPaintTransformer
public StandardGradientPaintTransformer()
Creates a new transformer with the typeGradientPaintTransformType.VERTICAL.
-
StandardGradientPaintTransformer
public StandardGradientPaintTransformer(GradientPaintTransformType type)
Creates a new transformer with the specified type.- Parameters:
type- the transform type (nullnot permitted).
-
-
Method Detail
-
getType
public GradientPaintTransformType getType()
Returns the type of transform.- Returns:
- The type of transform (never
null).
-
transform
public GradientPaint transform(GradientPaint paint, Shape target)
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
public boolean equals(Object obj)
Tests this instance for equality with an arbitrary object.
-
clone
public Object clone() throws CloneNotSupportedException
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.
-
-