public class FlipOrientation
extends java.lang.Object
Examples:
Shows how to flip a shape on an axis.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Insert an image shape and leave its orientation in its default state.
Shape shape = builder.insertShape(ShapeType.RECTANGLE, RelativeHorizontalPosition.LEFT_MARGIN, 100.0,
RelativeVerticalPosition.TOP_MARGIN, 100.0, 100.0, 100.0, WrapType.NONE);
shape.getImageData().setImage(getImageDir() + "Logo.jpg");
Assert.assertEquals(FlipOrientation.NONE, shape.getFlipOrientation());
shape = builder.insertShape(ShapeType.RECTANGLE, RelativeHorizontalPosition.LEFT_MARGIN, 250.0,
RelativeVerticalPosition.TOP_MARGIN, 100.0, 100.0, 100.0, WrapType.NONE);
shape.getImageData().setImage(getImageDir() + "Logo.jpg");
// Set the "FlipOrientation" property to "FlipOrientation.Horizontal" to flip the second shape on the y-axis,
// making it into a horizontal mirror image of the first shape.
shape.setFlipOrientation(FlipOrientation.HORIZONTAL);
shape = builder.insertShape(ShapeType.RECTANGLE, RelativeHorizontalPosition.LEFT_MARGIN, 100.0,
RelativeVerticalPosition.TOP_MARGIN, 250.0, 100.0, 100.0, WrapType.NONE);
shape.getImageData().setImage(getImageDir() + "Logo.jpg");
// Set the "FlipOrientation" property to "FlipOrientation.Horizontal" to flip the third shape on the x-axis,
// making it into a vertical mirror image of the first shape.
shape.setFlipOrientation(FlipOrientation.VERTICAL);
shape = builder.insertShape(ShapeType.RECTANGLE, RelativeHorizontalPosition.LEFT_MARGIN, 250.0,
RelativeVerticalPosition.TOP_MARGIN, 250.0, 100.0, 100.0, WrapType.NONE);
shape.getImageData().setImage(getImageDir() + "Logo.jpg");
// Set the "FlipOrientation" property to "FlipOrientation.Horizontal" to flip the fourth shape on both the x and y axes,
// making it into a horizontal and vertical mirror image of the first shape.
shape.setFlipOrientation(FlipOrientation.BOTH);
doc.save(getArtifactsDir() + "Shape.FlipShapeOrientation.docx");
| Modifier and Type | Field and Description |
|---|---|
static int |
BOTH
Flip along both the y- and x-axis.
|
static int |
HORIZONTAL
Flip along the y-axis, reversing the x-coordinates.
|
static int |
length |
static int |
NONE
Coordinates are not flipped.
|
static int |
VERTICAL
Flip along the x-axis, reversing the y-coordinates.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String flipOrientationName) |
static int |
fromNames(java.util.Set flipOrientationNames) |
static java.lang.String |
getName(int flipOrientation) |
static java.util.Set |
getNames(int flipOrientation) |
static int[] |
getValues() |
static java.lang.String |
toString(int flipOrientation) |
static java.lang.String |
toStringSet(int attr) |
public static int NONE
public static int HORIZONTAL
public static int VERTICAL
public static int BOTH
public static int length
public static java.lang.String getName(int flipOrientation)
public static java.util.Set getNames(int flipOrientation)
public static java.lang.String toString(int flipOrientation)
public static java.lang.String toStringSet(int attr)
public static int fromName(java.lang.String flipOrientationName)
public static int fromNames(java.util.Set flipOrientationNames)
public static int[] getValues()