com.aspose.words

Class FlipOrientation

  • java.lang.Object
    • com.aspose.words.FlipOrientation
public class FlipOrientation 
extends java.lang.Object

Utility class containing constants. Possible values for the orientation of a shape.

Example:

Shows how to create line shapes and set specific location and size.
Document doc = new Document();

// The lines will cross the whole page
float pageWidth = (float) doc.getFirstSection().getPageSetup().getPageWidth();
float pageHeight = (float) doc.getFirstSection().getPageSetup().getPageHeight();

// This line goes from top left to bottom right by default
Shape lineA = new Shape(doc, ShapeType.LINE);
{
    lineA.setBounds(new Rectangle2D.Float(0f, 0f, pageWidth, pageHeight));
    lineA.setRelativeHorizontalPosition(RelativeHorizontalPosition.PAGE);
    lineA.setRelativeVerticalPosition(RelativeVerticalPosition.PAGE);
}

Assert.assertEquals(new Rectangle2D.Float(0f, 0f, pageWidth, pageHeight), lineA.getBoundsInPoints());

// This line goes from bottom left to top right because we flipped it
Shape lineB = new Shape(doc, ShapeType.LINE);
{
    lineB.setBounds(new Rectangle2D.Float(0f, 0f, pageWidth, pageHeight));
    lineB.setFlipOrientation(FlipOrientation.HORIZONTAL);
    lineB.setRelativeHorizontalPosition(RelativeHorizontalPosition.PAGE);
    lineB.setRelativeVerticalPosition(RelativeVerticalPosition.PAGE);
}

Assert.assertEquals(new Rectangle2D.Float(0f, 0f, pageWidth, pageHeight), lineB.getBoundsInPoints());

// Add lines to the document
doc.getFirstSection().getBody().getFirstParagraph().appendChild(lineA);
doc.getFirstSection().getBody().getFirstParagraph().appendChild(lineB);

doc.save(getArtifactsDir() + "Shape.LineFlipOrientation.docx");
See Also:
ShapeBase.FlipOrientation

Field Summary
static final intNONE = 0
Coordinates are not flipped.
static final intHORIZONTAL = 1
Flip along the y-axis, reversing the x-coordinates.
static final intVERTICAL = 2
Flip along the x-axis, reversing the y-coordinates.
static final intBOTH = 3
Flip along both the y- and x-axis.
 

    • Field Detail

      • NONE = 0

        public static final int NONE
        Coordinates are not flipped.
      • HORIZONTAL = 1

        public static final int HORIZONTAL
        Flip along the y-axis, reversing the x-coordinates.
      • VERTICAL = 2

        public static final int VERTICAL
        Flip along the x-axis, reversing the y-coordinates.
      • BOTH = 3

        public static final int BOTH
        Flip along both the y- and x-axis.