FlipOrientation

Inheritance: java.lang.Object

public class FlipOrientation

Possible values for the orientation of a shape.

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");
 

Fields

FieldDescription
BOTHFlip along both the y- and x-axis.
HORIZONTALFlip along the y-axis, reversing the x-coordinates.
NONECoordinates are not flipped.
VERTICALFlip along the x-axis, reversing the y-coordinates.
length

Methods

MethodDescription
fromName(String flipOrientationName)
fromNames(Set flipOrientationNames)
getName(int flipOrientation)
getNames(int flipOrientation)
getValues()
toString(int flipOrientation)
toStringSet(int attr)

BOTH

public static int BOTH

Flip along both the y- and x-axis.

HORIZONTAL

public static int HORIZONTAL

Flip along the y-axis, reversing the x-coordinates.

NONE

public static int NONE

Coordinates are not flipped.

VERTICAL

public static int VERTICAL

Flip along the x-axis, reversing the y-coordinates.

length

public static int length

fromName(String flipOrientationName)

public static int fromName(String flipOrientationName)

Parameters:

ParameterTypeDescription
flipOrientationNamejava.lang.String

Returns: int

fromNames(Set flipOrientationNames)

public static int fromNames(Set flipOrientationNames)

Parameters:

ParameterTypeDescription
flipOrientationNamesjava.util.Set

Returns: int

getName(int flipOrientation)

public static String getName(int flipOrientation)

Parameters:

ParameterTypeDescription
flipOrientationint

Returns: java.lang.String

getNames(int flipOrientation)

public static Set getNames(int flipOrientation)

Parameters:

ParameterTypeDescription
flipOrientationint

Returns: java.util.Set

getValues()

public static int[] getValues()

Returns: int[]

toString(int flipOrientation)

public static String toString(int flipOrientation)

Parameters:

ParameterTypeDescription
flipOrientationint

Returns: java.lang.String

toStringSet(int attr)

public static String toStringSet(int attr)

Parameters:

ParameterTypeDescription
attrint

Returns: java.lang.String