public class FillType
extends java.lang.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");
| Modifier and Type | Field and Description |
|---|---|
static int |
BACKGROUND
Fill is the same as the background.
|
static int |
GRADIENT
Gradient fill.
|
static int |
length |
static int |
PATTERNED
Patterned fill.
|
static int |
PICTURE
Picture fill.
|
static int |
SOLID
Solid fill.
|
static int |
TEXTURED
Textured fill.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String fillTypeName) |
static java.lang.String |
getName(int fillType) |
static int[] |
getValues() |
static java.lang.String |
toString(int fillType) |
public static int SOLID
public static int PATTERNED
public static int GRADIENT
public static int TEXTURED
public static int BACKGROUND
public static int PICTURE
public static int length