public class RadialGradientBrush extends Brush
| Constructor and Description |
|---|
RadialGradientBrush()
Initializes a new instance of the
RadialGradientBrush class. |
RadialGradientBrush(boolean extended)
Initializes a new instance of the
RadialGradientBrush class. |
RadialGradientBrush(java.awt.Color centerColor,
java.awt.Color surroundingColor)
Initializes a new instance of the
RadialGradientBrush class. |
RadialGradientBrush(java.awt.Color centerColor,
java.awt.Color surroundingColor,
double x,
double y)
Initializes a new instance of the
RadialGradientBrush class. |
RadialGradientBrush(float[] fractions,
java.awt.Color[] colors,
double x,
double y)
Initializes a new instance of the
RadialGradientBrush class. |
| Modifier and Type | Method and Description |
|---|---|
void |
applyTo(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D bounds)
Applies the brush to the specified graphics.
|
RadialGradientBrush |
clone()
Creates a clone of the brush.
|
java.awt.Color |
getCenterColor()
Gets the center color.
|
java.awt.Color[] |
getColors() |
java.awt.MultipleGradientPaint.CycleMethod |
getCycleMethod() |
float[] |
getFractions() |
double |
getRadius() |
java.awt.Color |
getSurroundingColor()
Gets the surrounding color.
|
java.awt.geom.AffineTransform |
getTransform() |
java.util.List<java.awt.geom.AffineTransform> |
getTransformList() |
double |
getX()
Gets the relative x-coordinate of the center point.
|
double |
getY()
Gets the relative y-coordinate of the center point.
|
void |
readExternal(java.io.ObjectInput in)
Implements Externalizable.
|
void |
setCenterColor(java.awt.Color value)
Sets the center color.
|
void |
setColors(java.awt.Color[] value) |
void |
setCycleMethod(java.awt.MultipleGradientPaint.CycleMethod value) |
void |
setFractions(float[] value) |
void |
setPercentRadius(boolean value) |
void |
setPercentX(boolean value) |
void |
setPercentY(boolean value) |
void |
setRadius(double value) |
void |
setSurroundingColor(java.awt.Color value)
Sets the surrounding color.
|
void |
setTransform(java.awt.geom.AffineTransform value) |
void |
setX(double value)
Sets the relative x-coordinate of the center point.
|
void |
setY(double value)
Sets the relative y-coordinate of the center point.
|
java.awt.Color |
toColor()
Returns a single color approximation of the brush.
|
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable.
|
public RadialGradientBrush(java.awt.Color centerColor,
java.awt.Color surroundingColor)
RadialGradientBrush class.centerColor - A Color object representing the color at the center point.surroundingColor - A Color object representing the surrounding color.public RadialGradientBrush(java.awt.Color centerColor,
java.awt.Color surroundingColor,
double x,
double y)
RadialGradientBrush class.centerColor - A Color object representing the color at the center point.surroundingColor - A Color object representing the surrounding color.x - The relative x-coordinate of the center point.
Value 0.5 indicates the middle of the destination rectangle.y - The relative y-coordinate of the center point.
Value 0.5 indicates the middle of the destination rectangle.public RadialGradientBrush(float[] fractions,
java.awt.Color[] colors,
double x,
double y)
RadialGradientBrush class.
Instances of the RadialGradientBrush class created using this constructor are currently not serialized.
fractions - An array of float numbers specifying the positions of the colors along the gradient.colors - An array of Color objects representing the colors of the gradient.x - The relative x-coordinate of the center point.
Value 0.5 indicates the middle of the destination rectangle.y - The relative y-coordinate of the center point.
Value 0.5 indicates the middle of the destination rectangle.public RadialGradientBrush()
RadialGradientBrush class.public RadialGradientBrush(boolean extended)
RadialGradientBrush class.extended - turns on the extended brush mode for drawing svgpublic void applyTo(java.awt.Graphics2D g,
java.awt.geom.Rectangle2D bounds)
Brushpublic RadialGradientBrush clone()
clone in class BrushRadialGradientBrush instance.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
java.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic java.awt.Color getCenterColor()
public void setCenterColor(java.awt.Color value)
value - A Color object representing the center color.public java.awt.Color getSurroundingColor()
public void setSurroundingColor(java.awt.Color value)
value - A Color object representing the surrounding color.public double getX()
public void setX(double value)
value - A double value specifying the relative x-coordinate.public double getY()
public void setY(double value)
value - A double value specifying the relative x-coordinate.public float[] getFractions()
public void setFractions(float[] value)
public java.awt.Color[] getColors()
public void setColors(java.awt.Color[] value)
public void setTransform(java.awt.geom.AffineTransform value)
public java.awt.geom.AffineTransform getTransform()
public java.awt.Color toColor()
public void setCycleMethod(java.awt.MultipleGradientPaint.CycleMethod value)
public java.awt.MultipleGradientPaint.CycleMethod getCycleMethod()
public java.util.List<java.awt.geom.AffineTransform> getTransformList()
public void setRadius(double value)
public double getRadius()
public void setPercentX(boolean value)
public void setPercentY(boolean value)
public void setPercentRadius(boolean value)