public class TextureAlignment
extends java.lang.Object
Examples:
Shows how to fill and tiling the texture inside the shape.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.insertShape(ShapeType.RECTANGLE, 80.0, 80.0);
// Apply texture alignment to the shape fill.
shape.getFill().presetTextured(PresetTexture.CANVAS);
shape.getFill().setTextureAlignment(TextureAlignment.TOP_RIGHT);
// Use the compliance option to define the shape using DML if you want to get "TextureAlignment"
// property after the document saves.
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions(); { saveOptions.setCompliance(OoxmlCompliance.ISO_29500_2008_STRICT); }
doc.save(getArtifactsDir() + "Shape.TextureFill.docx", saveOptions);
doc = new Document(getArtifactsDir() + "Shape.TextureFill.docx");
shape = (Shape)doc.getChild(NodeType.SHAPE, 0, true);
Assert.assertEquals(TextureAlignment.TOP_RIGHT, shape.getFill().getTextureAlignment());
Assert.assertEquals(PresetTexture.CANVAS, shape.getFill().getPresetTexture());
| Modifier and Type | Field and Description |
|---|---|
static int |
BOTTOM
Bottom texture alignment.
|
static int |
BOTTOM_LEFT
Bottom left texture alignment.
|
static int |
BOTTOM_RIGHT
Bottom right texture alignment.
|
static int |
CENTER
Center texture alignment.
|
static int |
LEFT
Left texture alignment.
|
static int |
length |
static int |
NONE
None texture alignment.
|
static int |
RIGHT
Right texture alignment.
|
static int |
TOP
Top texture alignment.
|
static int |
TOP_LEFT
Top left texture alignment.
|
static int |
TOP_RIGHT
Top right texture alignment.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String textureAlignmentName) |
static java.lang.String |
getName(int textureAlignment) |
static int[] |
getValues() |
static java.lang.String |
toString(int textureAlignment) |
public static int TOP_LEFT
public static int TOP
public static int TOP_RIGHT
public static int LEFT
public static int CENTER
public static int RIGHT
public static int BOTTOM_LEFT
public static int BOTTOM
public static int BOTTOM_RIGHT
public static int NONE
public static int length