PatternType
Inheritance: java.lang.Object
public class PatternType
Specifies the fill pattern to be used to fill a shape.
Examples:
Shows how to set pattern for a shape.
Document doc = new Document(getMyDir() + "Shape stroke pattern border.docx");
Shape shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Fill fill = shape.getFill();
System.out.println(MessageFormat.format("Pattern value is: {0}",fill.getPattern()));
// There are several ways specified fill to a pattern.
// 1 - Apply pattern to the shape fill:
fill.patterned(PatternType.DIAGONAL_BRICK);
// 2 - Apply pattern with foreground and background colors to the shape fill:
fill.patterned(PatternType.DIAGONAL_BRICK, Color.yellow, Color.blue);
doc.save(getArtifactsDir() + "Shape.FillPattern.docx");
Fields
Field | Description |
---|---|
CROSS | Cross. |
DARK_DOWNWARD_DIAGONAL | Dark downward diagonal. |
DARK_HORIZONTAL | Dark horizontal. |
DARK_UPWARD_DIAGONAL | Dark upward diagonal. |
DARK_VERTICAL | Dark vertical. |
DASHED_DOWNWARD_DIAGONAL | Dashed downward diagonal. |
DASHED_HORIZONTAL | Dashed horizontal. |
DASHED_UPWARD_DIAGONAL | Dashed upward diagonal. |
DASHED_VERTICAL | Dashed vertical. |
DIAGONAL_BRICK | Diagonal brick. |
DIAGONAL_CROSS | Diagonal cross. |
DIVOT | Pattern divot. |
DOTTED_DIAMOND | Dotted diamond. |
DOTTED_GRID | Dotted grid. |
DOWNWARD_DIAGONAL | Downward diagonal. |
HORIZONTAL | Horizontal. |
HORIZONTAL_BRICK | Horizontal brick. |
LARGE_CHECKER_BOARD | Large checker board. |
LARGE_CONFETTI | Large confetti. |
LARGE_GRID | Large grid. |
LIGHT_DOWNWARD_DIAGONAL | Light downward diagonal. |
LIGHT_HORIZONTAL | Light horizontal. |
LIGHT_UPWARD_DIAGONAL | Light upward diagonal. |
LIGHT_VERTICAL | Light vertical. |
NARROW_HORIZONTAL | Narrow horizontal. |
NARROW_VERTICAL | Narrow vertical. |
NONE | No pattern. |
OUTLINED_DIAMOND | Outlined diamond. |
PERCENT_10 | 10% of the foreground color. |
PERCENT_20 | 20% of the foreground color. |
PERCENT_25 | 25% of the foreground color. |
PERCENT_30 | 30% of the foreground color. |
PERCENT_40 | 40% of the foreground color |
PERCENT_5 | 5% of the foreground color. |
PERCENT_50 | 50% of the foreground color |
PERCENT_60 | 60% of the foreground color. |
PERCENT_70 | 70% of the foreground color. |
PERCENT_75 | 75% of the foreground color. |
PERCENT_80 | 80% of the foreground color. |
PERCENT_90 | 90% of the foreground color. |
PLAID | Plaid. |
SHINGLE | Shingle. |
SMALL_CHECKER_BOARD | Small checker board. |
SMALL_CONFETTI | Small confetti. |
SMALL_GRID | Small grid. |
SOLID_DIAMOND | Solid diamond. |
SPHERE | Sphere. |
TRELLIS | Trellis. |
UPWARD_DIAGONAL | Upward diagonal. |
VERTICAL | Vertical. |
WAVE | Wave. |
WEAVE | Weave. |
WIDE_DOWNWARD_DIAGONAL | Wide downward diagonal. |
WIDE_UPWARD_DIAGONAL | Wide upward diagonal. |
ZIG_ZAG | Zig zag. |
length |
Methods
Method | Description |
---|---|
fromName(String patternTypeName) | |
getName(int patternType) | |
getValues() | |
toString(int patternType) |
CROSS
public static int CROSS
Cross.
DARK_DOWNWARD_DIAGONAL
public static int DARK_DOWNWARD_DIAGONAL
Dark downward diagonal.
DARK_HORIZONTAL
public static int DARK_HORIZONTAL
Dark horizontal.
DARK_UPWARD_DIAGONAL
public static int DARK_UPWARD_DIAGONAL
Dark upward diagonal.
DARK_VERTICAL
public static int DARK_VERTICAL
Dark vertical.
DASHED_DOWNWARD_DIAGONAL
public static int DASHED_DOWNWARD_DIAGONAL
Dashed downward diagonal.
DASHED_HORIZONTAL
public static int DASHED_HORIZONTAL
Dashed horizontal.
DASHED_UPWARD_DIAGONAL
public static int DASHED_UPWARD_DIAGONAL
Dashed upward diagonal.
DASHED_VERTICAL
public static int DASHED_VERTICAL
Dashed vertical.
DIAGONAL_BRICK
public static int DIAGONAL_BRICK
Diagonal brick.
DIAGONAL_CROSS
public static int DIAGONAL_CROSS
Diagonal cross.
DIVOT
public static int DIVOT
Pattern divot.
DOTTED_DIAMOND
public static int DOTTED_DIAMOND
Dotted diamond.
DOTTED_GRID
public static int DOTTED_GRID
Dotted grid.
DOWNWARD_DIAGONAL
public static int DOWNWARD_DIAGONAL
Downward diagonal.
HORIZONTAL
public static int HORIZONTAL
Horizontal.
HORIZONTAL_BRICK
public static int HORIZONTAL_BRICK
Horizontal brick.
LARGE_CHECKER_BOARD
public static int LARGE_CHECKER_BOARD
Large checker board.
LARGE_CONFETTI
public static int LARGE_CONFETTI
Large confetti.
LARGE_GRID
public static int LARGE_GRID
Large grid.
LIGHT_DOWNWARD_DIAGONAL
public static int LIGHT_DOWNWARD_DIAGONAL
Light downward diagonal.
LIGHT_HORIZONTAL
public static int LIGHT_HORIZONTAL
Light horizontal.
LIGHT_UPWARD_DIAGONAL
public static int LIGHT_UPWARD_DIAGONAL
Light upward diagonal.
LIGHT_VERTICAL
public static int LIGHT_VERTICAL
Light vertical.
NARROW_HORIZONTAL
public static int NARROW_HORIZONTAL
Narrow horizontal.
NARROW_VERTICAL
public static int NARROW_VERTICAL
Narrow vertical.
NONE
public static int NONE
No pattern.
OUTLINED_DIAMOND
public static int OUTLINED_DIAMOND
Outlined diamond.
PERCENT_10
public static int PERCENT_10
10% of the foreground color.
PERCENT_20
public static int PERCENT_20
20% of the foreground color.
PERCENT_25
public static int PERCENT_25
25% of the foreground color.
PERCENT_30
public static int PERCENT_30
30% of the foreground color.
PERCENT_40
public static int PERCENT_40
40% of the foreground color
PERCENT_5
public static int PERCENT_5
5% of the foreground color.
PERCENT_50
public static int PERCENT_50
50% of the foreground color
PERCENT_60
public static int PERCENT_60
60% of the foreground color.
PERCENT_70
public static int PERCENT_70
70% of the foreground color.
PERCENT_75
public static int PERCENT_75
75% of the foreground color.
PERCENT_80
public static int PERCENT_80
80% of the foreground color.
PERCENT_90
public static int PERCENT_90
90% of the foreground color.
PLAID
public static int PLAID
Plaid.
SHINGLE
public static int SHINGLE
Shingle.
SMALL_CHECKER_BOARD
public static int SMALL_CHECKER_BOARD
Small checker board.
SMALL_CONFETTI
public static int SMALL_CONFETTI
Small confetti.
SMALL_GRID
public static int SMALL_GRID
Small grid.
SOLID_DIAMOND
public static int SOLID_DIAMOND
Solid diamond.
SPHERE
public static int SPHERE
Sphere.
TRELLIS
public static int TRELLIS
Trellis.
UPWARD_DIAGONAL
public static int UPWARD_DIAGONAL
Upward diagonal.
VERTICAL
public static int VERTICAL
Vertical.
WAVE
public static int WAVE
Wave.
WEAVE
public static int WEAVE
Weave.
WIDE_DOWNWARD_DIAGONAL
public static int WIDE_DOWNWARD_DIAGONAL
Wide downward diagonal.
WIDE_UPWARD_DIAGONAL
public static int WIDE_UPWARD_DIAGONAL
Wide upward diagonal.
ZIG_ZAG
public static int ZIG_ZAG
Zig zag.
length
public static int length
fromName(String patternTypeName)
public static int fromName(String patternTypeName)
Parameters:
Parameter | Type | Description |
---|---|---|
patternTypeName | java.lang.String |
Returns: int
getName(int patternType)
public static String getName(int patternType)
Parameters:
Parameter | Type | Description |
---|---|---|
patternType | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int patternType)
public static String toString(int patternType)
Parameters:
Parameter | Type | Description |
---|---|---|
patternType | int |
Returns: java.lang.String