FillType
Contents
[
Hide
]Inheritance: java.lang.Object
public class FillType
Specifies fill type for a fillable object.
Examples:
Shows how to convert any of the fills back to solid fill.
Document doc = new Document(getMyDir() + "Two color gradient.docx");
// Get Fill object for Font of the first Run.
Fill fill = doc.getFirstSection().getBody().getParagraphs().get(0).getRuns().get(0).getFont().getFill();
// Check Fill properties of the Font.
System.out.println(MessageFormat.format("The type of the fill is: {0}",fill.getFillType()));
System.out.println(MessageFormat.format("The foreground color of the fill is: {0}",fill.getForeColor()));
System.out.println(MessageFormat.format("The fill is transparent at {0}%",fill.getTransparency() * 100.0));
// Change type of the fill to Solid with uniform green color.
fill.solid(Color.GREEN);
System.out.println("\nThe fill is changed:");
System.out.println(MessageFormat.format("The type of the fill is: {0}",fill.getFillType()));
System.out.println(MessageFormat.format("The foreground color of the fill is: {0}",fill.getForeColor()));
System.out.println(MessageFormat.format("The fill transparency is {0}%",fill.getTransparency() * 100.0));
doc.save(getArtifactsDir() + "Drawing.FillSolid.docx");
Fields
Field | Description |
---|---|
BACKGROUND | Fill is the same as the background. |
GRADIENT | Gradient fill. |
PATTERNED | Patterned fill. |
PICTURE | Picture fill. |
SOLID | Solid fill. |
TEXTURED | Textured fill. |
length |
Methods
Method | Description |
---|---|
fromName(String fillTypeName) | |
getName(int fillType) | |
getValues() | |
toString(int fillType) |
BACKGROUND
public static int BACKGROUND
Fill is the same as the background.
GRADIENT
public static int GRADIENT
Gradient fill.
PATTERNED
public static int PATTERNED
Patterned fill.
PICTURE
public static int PICTURE
Picture fill.
SOLID
public static int SOLID
Solid fill.
TEXTURED
public static int TEXTURED
Textured fill.
length
public static int length
fromName(String fillTypeName)
public static int fromName(String fillTypeName)
Parameters:
Parameter | Type | Description |
---|---|---|
fillTypeName | java.lang.String |
Returns: int
getName(int fillType)
public static String getName(int fillType)
Parameters:
Parameter | Type | Description |
---|---|---|
fillType | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int fillType)
public static String toString(int fillType)
Parameters:
Parameter | Type | Description |
---|---|---|
fillType | int |
Returns: java.lang.String