public class Fill
extends java.lang.Object
Use the ShapeBase.getFill() or Font.getFill() property to access fill properties of an object. You do not create instances of the Fill class directly.
| Modifier and Type | Method and Description |
|---|---|
java.awt.Color |
getBackColor()
Gets a Color object that represents the background color for the fill.
|
java.awt.Color |
getColor()
Gets a Color object that represents the foreground color for the fill.
|
int |
getFillType()
Gets a fill type.
|
java.awt.Color |
getForeColor()
Gets a Color object that represents the foreground color for the fill.
|
double |
getGradientAngle()
Gets the angle of the gradient fill.
|
GradientStopCollection |
getGradientStops()
Gets a collection of
GradientStop objects for the fill. |
int |
getGradientStyle()
Gets the gradient style
GradientStyle for the fill. |
int |
getGradientVariant()
Gets the gradient variant
GradientVariant for the fill. |
byte[] |
getImageBytes()
Gets the raw bytes of the fill texture or pattern.
|
boolean |
getOn()
Gets value that is
true if the formatting applied to this instance, is visible. |
double |
getOpacity()
Gets the degree of opacity of the specified fill as a value between 0.0 (clear) and 1.0 (opaque).
|
int |
getPattern()
Gets a
PatternType for the fill. |
int |
getPresetTexture()
Gets a
PresetTexture for the fill. |
boolean |
getRotateWithObject()
Gets whether the fill rotates with the specified object.
|
int |
getTextureAlignment()
Gets the alignment for tile texture fill.
|
double |
getTransparency()
Gets the degree of transparency of the specified fill as a value between 0.0 (opaque) and 1.0 (clear).
|
boolean |
getVisible()
Gets value that is
true if the formatting applied to this instance, is visible. |
void |
oneColorGradient(java.awt.Color color,
int style,
int variant,
double degree) |
void |
oneColorGradient(int style,
int variant,
double degree) |
void |
patterned(int patternType) |
void |
patterned(int patternType,
java.awt.Color foreColor,
java.awt.Color backColor) |
void |
presetTextured(int presetTexture) |
void |
setBackColor(java.awt.Color value)
Sets a Color object that represents the background color for the fill.
|
void |
setColor(java.awt.Color value)
Sets a Color object that represents the foreground color for the fill.
|
void |
setForeColor(java.awt.Color value)
Sets a Color object that represents the foreground color for the fill.
|
void |
setGradientAngle(double value)
Sets the angle of the gradient fill.
|
void |
setImage(byte[] imageBytes)
Changes the fill type to single image.
|
void |
setImage(java.io.InputStream stream) |
void |
setImage(java.lang.String fileName)
Changes the fill type to single image.
|
void |
setOn(boolean value)
Sets value that is
true if the formatting applied to this instance, is visible. |
void |
setOpacity(double value)
Sets the degree of opacity of the specified fill as a value between 0.0 (clear) and 1.0 (opaque).
|
void |
setRotateWithObject(boolean value)
Sets whether the fill rotates with the specified object.
|
void |
setTextureAlignment(int value)
Sets the alignment for tile texture fill.
|
void |
setTransparency(double value)
Sets the degree of transparency of the specified fill as a value between 0.0 (opaque) and 1.0 (clear).
|
void |
setVisible(boolean value)
Sets value that is
true if the formatting applied to this instance, is visible. |
void |
solid()
Sets the fill to a uniform color.
|
void |
solid(java.awt.Color color)
Sets the fill to a specified uniform color.
|
void |
twoColorGradient(java.awt.Color color1,
java.awt.Color color2,
int style,
int variant) |
void |
twoColorGradient(int style,
int variant) |
public void solid()
public void solid(java.awt.Color color)
public void presetTextured(int presetTexture)
public void patterned(int patternType)
public void patterned(int patternType,
java.awt.Color foreColor,
java.awt.Color backColor)
public void oneColorGradient(int style,
int variant,
double degree)
public void oneColorGradient(java.awt.Color color,
int style,
int variant,
double degree)
public void twoColorGradient(int style,
int variant)
public void twoColorGradient(java.awt.Color color1,
java.awt.Color color2,
int style,
int variant)
public void setImage(java.lang.String fileName)
throws java.lang.Exception
fileName - The path to the image file.java.lang.Exceptionpublic void setImage(java.io.InputStream stream)
throws java.lang.Exception
java.lang.Exceptionpublic void setImage(byte[] imageBytes)
imageBytes - The image bytes array.public int getPresetTexture()
throws java.lang.Exception
PresetTexture for the fill.PresetTexture for the fill. The returned value is one of PresetTexture constants.java.lang.Exceptionpublic int getPattern()
throws java.lang.Exception
PatternType for the fill.PatternType for the fill. The returned value is one of PatternType constants.java.lang.Exceptionpublic int getTextureAlignment()
TextureAlignment constants.public void setTextureAlignment(int value)
value - The alignment for tile texture fill. The value must be one of TextureAlignment constants.public java.awt.Color getColor()
public void setColor(java.awt.Color value)
value - A Color object that represents the foreground color for the fill.public boolean getOn()
true if the formatting applied to this instance, is visible.true if the formatting applied to this instance, is visible.public void setOn(boolean value)
true if the formatting applied to this instance, is visible.value - Value that is true if the formatting applied to this instance, is visible.public double getOpacity()
getTransparency() / setTransparency(double).public void setOpacity(double value)
getTransparency() / setTransparency(double).value - The degree of opacity of the specified fill as a value between 0.0 (clear) and 1.0 (opaque).public byte[] getImageBytes()
throws java.lang.Exception
The default value is null.
java.lang.Exceptionpublic java.awt.Color getForeColor()
public void setForeColor(java.awt.Color value)
value - A Color object that represents the foreground color for the fill.public java.awt.Color getBackColor()
public void setBackColor(java.awt.Color value)
value - A Color object that represents the background color for the fill.public boolean getVisible()
true if the formatting applied to this instance, is visible.true if the formatting applied to this instance, is visible.public void setVisible(boolean value)
true if the formatting applied to this instance, is visible.value - Value that is true if the formatting applied to this instance, is visible.public double getTransparency()
getOpacity() / setOpacity(double).public void setTransparency(double value)
getOpacity() / setOpacity(double).value - The degree of transparency of the specified fill as a value between 0.0 (opaque) and 1.0 (clear).public boolean getRotateWithObject()
public void setRotateWithObject(boolean value)
value - Whether the fill rotates with the specified object.public int getFillType()
FillType constants.public double getGradientAngle()
public void setGradientAngle(double value)
value - The angle of the gradient fill.public int getGradientVariant()
GradientVariant for the fill.GradientVariant for the fill. The returned value is one of GradientVariant constants.public int getGradientStyle()
GradientStyle for the fill.GradientStyle for the fill. The returned value is one of GradientStyle constants.public GradientStopCollection getGradientStops()
GradientStop objects for the fill.GradientStop objects for the fill.