public class PatternType
extends java.lang.Object
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");
| Modifier and Type | Field and Description |
|---|---|
static int |
CROSS
Cross.
|
static int |
DARK_DOWNWARD_DIAGONAL
Dark downward diagonal.
|
static int |
DARK_HORIZONTAL
Dark horizontal.
|
static int |
DARK_UPWARD_DIAGONAL
Dark upward diagonal.
|
static int |
DARK_VERTICAL
Dark vertical.
|
static int |
DASHED_DOWNWARD_DIAGONAL
Dashed downward diagonal.
|
static int |
DASHED_HORIZONTAL
Dashed horizontal.
|
static int |
DASHED_UPWARD_DIAGONAL
Dashed upward diagonal.
|
static int |
DASHED_VERTICAL
Dashed vertical.
|
static int |
DIAGONAL_BRICK
Diagonal brick.
|
static int |
DIAGONAL_CROSS
Diagonal cross.
|
static int |
DIVOT
Pattern divot.
|
static int |
DOTTED_DIAMOND
Dotted diamond.
|
static int |
DOTTED_GRID
Dotted grid.
|
static int |
DOWNWARD_DIAGONAL
Downward diagonal.
|
static int |
HORIZONTAL
Horizontal.
|
static int |
HORIZONTAL_BRICK
Horizontal brick.
|
static int |
LARGE_CHECKER_BOARD
Large checker board.
|
static int |
LARGE_CONFETTI
Large confetti.
|
static int |
LARGE_GRID
Large grid.
|
static int |
length |
static int |
LIGHT_DOWNWARD_DIAGONAL
Light downward diagonal.
|
static int |
LIGHT_HORIZONTAL
Light horizontal.
|
static int |
LIGHT_UPWARD_DIAGONAL
Light upward diagonal.
|
static int |
LIGHT_VERTICAL
Light vertical.
|
static int |
NARROW_HORIZONTAL
Narrow horizontal.
|
static int |
NARROW_VERTICAL
Narrow vertical.
|
static int |
NONE
No pattern.
|
static int |
OUTLINED_DIAMOND
Outlined diamond.
|
static int |
PERCENT_10
10% of the foreground color.
|
static int |
PERCENT_20
20% of the foreground color.
|
static int |
PERCENT_25
25% of the foreground color.
|
static int |
PERCENT_30
30% of the foreground color.
|
static int |
PERCENT_40
40% of the foreground color
|
static int |
PERCENT_5
5% of the foreground color.
|
static int |
PERCENT_50
50% of the foreground color
|
static int |
PERCENT_60
60% of the foreground color.
|
static int |
PERCENT_70
70% of the foreground color.
|
static int |
PERCENT_75
75% of the foreground color.
|
static int |
PERCENT_80
80% of the foreground color.
|
static int |
PERCENT_90
90% of the foreground color.
|
static int |
PLAID
Plaid.
|
static int |
SHINGLE
Shingle.
|
static int |
SMALL_CHECKER_BOARD
Small checker board.
|
static int |
SMALL_CONFETTI
Small confetti.
|
static int |
SMALL_GRID
Small grid.
|
static int |
SOLID_DIAMOND
Solid diamond.
|
static int |
SPHERE
Sphere.
|
static int |
TRELLIS
Trellis.
|
static int |
UPWARD_DIAGONAL
Upward diagonal.
|
static int |
VERTICAL
Vertical.
|
static int |
WAVE
Wave.
|
static int |
WEAVE
Weave.
|
static int |
WIDE_DOWNWARD_DIAGONAL
Wide downward diagonal.
|
static int |
WIDE_UPWARD_DIAGONAL
Wide upward diagonal.
|
static int |
ZIG_ZAG
Zig zag.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String patternTypeName) |
static java.lang.String |
getName(int patternType) |
static int[] |
getValues() |
static java.lang.String |
toString(int patternType) |
public static int NONE
public static int PERCENT_10
public static int PERCENT_20
public static int PERCENT_25
public static int PERCENT_30
public static int PERCENT_40
public static int PERCENT_50
public static int PERCENT_5
public static int PERCENT_60
public static int PERCENT_70
public static int PERCENT_75
public static int PERCENT_80
public static int PERCENT_90
public static int CROSS
public static int DARK_DOWNWARD_DIAGONAL
public static int DARK_HORIZONTAL
public static int DARK_UPWARD_DIAGONAL
public static int DARK_VERTICAL
public static int DASHED_DOWNWARD_DIAGONAL
public static int DASHED_HORIZONTAL
public static int DASHED_UPWARD_DIAGONAL
public static int DASHED_VERTICAL
public static int DIAGONAL_BRICK
public static int DIAGONAL_CROSS
public static int DIVOT
public static int DOTTED_DIAMOND
public static int DOTTED_GRID
public static int DOWNWARD_DIAGONAL
public static int HORIZONTAL
public static int HORIZONTAL_BRICK
public static int LARGE_CHECKER_BOARD
public static int LARGE_CONFETTI
public static int LARGE_GRID
public static int LIGHT_DOWNWARD_DIAGONAL
public static int LIGHT_HORIZONTAL
public static int LIGHT_UPWARD_DIAGONAL
public static int LIGHT_VERTICAL
public static int NARROW_HORIZONTAL
public static int NARROW_VERTICAL
public static int OUTLINED_DIAMOND
public static int PLAID
public static int SHINGLE
public static int SMALL_CHECKER_BOARD
public static int SMALL_CONFETTI
public static int SMALL_GRID
public static int SOLID_DIAMOND
public static int SPHERE
public static int TRELLIS
public static int UPWARD_DIAGONAL
public static int VERTICAL
public static int WAVE
public static int WEAVE
public static int WIDE_DOWNWARD_DIAGONAL
public static int WIDE_UPWARD_DIAGONAL
public static int ZIG_ZAG
public static int length