FillType

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

FieldDescription
BACKGROUNDFill is the same as the background.
GRADIENTGradient fill.
PATTERNEDPatterned fill.
PICTUREPicture fill.
SOLIDSolid fill.
TEXTUREDTextured fill.
length

Methods

MethodDescription
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:

ParameterTypeDescription
fillTypeNamejava.lang.String

Returns: int

getName(int fillType)

public static String getName(int fillType)

Parameters:

ParameterTypeDescription
fillTypeint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int fillType)

public static String toString(int fillType)

Parameters:

ParameterTypeDescription
fillTypeint

Returns: java.lang.String