Package org.jfree.chart.ui
Class StandardGradientPaintTransformer
- java.lang.Object
-
- org.jfree.chart.ui.StandardGradientPaintTransformer
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,GradientPaintTransformer
,PublicCloneable
public class StandardGradientPaintTransformer extends java.lang.Object implements GradientPaintTransformer, java.lang.Cloneable, PublicCloneable, java.io.Serializable
Transforms aGradientPaint
to range over the width of a target shape. Instances of this class are immutable.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
For serialization.private GradientPaintTransformType
type
The transform type.
-
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 java.lang.Object
clone()
Returns a clone of the transformer.boolean
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.GradientPaintTransformType
getType()
Returns the type of transform.int
hashCode()
Returns a hash code for this object.java.awt.GradientPaint
transform(java.awt.GradientPaint paint, java.awt.Shape target)
Transforms aGradientPaint
instance to fit the specifiedtarget
shape.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
type
private GradientPaintTransformType type
The transform type.
-
-
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 (null
not permitted).
-
-
Method Detail
-
getType
public GradientPaintTransformType getType()
Returns the type of transform.- Returns:
- The type of transform (never
null
).
-
transform
public java.awt.GradientPaint transform(java.awt.GradientPaint paint, java.awt.Shape target)
Transforms aGradientPaint
instance to fit the specifiedtarget
shape.- Specified by:
transform
in interfaceGradientPaintTransformer
- Parameters:
paint
- the original paint (null
not permitted).target
- the target shape (null
not permitted).- Returns:
- The transformed paint.
-
equals
public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object (null
permitted).- Returns:
- A boolean.
-
clone
public java.lang.Object clone() throws java.lang.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:
clone
in interfacePublicCloneable
- Overrides:
clone
in classjava.lang.Object
- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException
- not thrown by this class, but subclasses (if any) might.
-
hashCode
public int hashCode()
Returns a hash code for this object.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- A hash code.
-
-