List of usage examples for com.itextpdf.text.pdf.parser Line Line
public Line(Point2D p1, Point2D p2)
From source file:mkl.testarea.itext5.pdfcleanup.PdfCleanUpRegionFilter.java
License:Open Source License
private static Subpath constructSquare(Point2D squareCenter, double widthHalf, double rotationAngle) { // Orthogonal square is the square with sides parallel to one of the axes. Point2D[] ortogonalSquareVertices = { new Point2D.Double(-widthHalf, -widthHalf), new Point2D.Double(-widthHalf, widthHalf), new Point2D.Double(widthHalf, widthHalf), new Point2D.Double(widthHalf, -widthHalf) }; Point2D[] rotatedSquareVertices = getRotatedSquareVertices(ortogonalSquareVertices, rotationAngle, squareCenter);/*from w ww.ja v a2 s.c o m*/ Subpath square = new Subpath(); square.addSegment(new Line(rotatedSquareVertices[0], rotatedSquareVertices[1])); square.addSegment(new Line(rotatedSquareVertices[1], rotatedSquareVertices[2])); square.addSegment(new Line(rotatedSquareVertices[2], rotatedSquareVertices[3])); square.addSegment(new Line(rotatedSquareVertices[3], rotatedSquareVertices[0])); return square; }