com.itextpdf.text.pdf.parser
Class Path

java.lang.Object
  extended by com.itextpdf.text.pdf.parser.Path

public class Path
extends Object

Paths define shapes, trajectories, and regions of all sorts. They shall be used to draw lines, define the shapes of filled areas, and specify boundaries for clipping other graphics. A path shall be composed of straight and curved line segments, which may connect to one another or may be disconnected.

Since:
5.5.6

Constructor Summary
Path()
           
Path(List<? extends Subpath> subpaths)
           
 
Method Summary
 void closeAllSubpaths()
          Closes all subpathes contained in this path.
 void closeSubpath()
          Closes the current subpath.
 void curveFromTo(float x1, float y1, float x3, float y3)
          Appends a cubic Bezier curve to the current path.
 void curveTo(float x2, float y2, float x3, float y3)
          Appends a cubic Bezier curve to the current path.
 void curveTo(float x1, float y1, float x2, float y2, float x3, float y3)
          Appends a cubic Bezier curve to the current path.
 Point2D getCurrentPoint()
          The current point is the trailing endpoint of the segment most recently added to the current path.
 List<Subpath> getSubpaths()
           
 boolean isEmpty()
          Path is empty if it contains no subpaths.
 void lineTo(float x, float y)
          Appends a straight line segment from the current point to the point (x, y).
 void moveTo(float x, float y)
          Begins a new subpath by moving the current point to coordinates (x, y).
 void rectangle(float x, float y, float w, float h)
          Appends a rectangle to the current path as a complete subpath.
 List<Integer> replaceCloseWithLine()
          Adds additional line to each closed subpath and makes the subpath unclosed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Path

public Path()

Path

public Path(List<? extends Subpath> subpaths)
Method Detail

getSubpaths

public List<Subpath> getSubpaths()
Returns:
A List of subpaths forming this path.

getCurrentPoint

public Point2D getCurrentPoint()
The current point is the trailing endpoint of the segment most recently added to the current path.

Returns:
The current point.

moveTo

public void moveTo(float x,
                   float y)
Begins a new subpath by moving the current point to coordinates (x, y).


lineTo

public void lineTo(float x,
                   float y)
Appends a straight line segment from the current point to the point (x, y).


curveTo

public void curveTo(float x1,
                    float y1,
                    float x2,
                    float y2,
                    float x3,
                    float y3)
Appends a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3).


curveTo

public void curveTo(float x2,
                    float y2,
                    float x3,
                    float y3)
Appends a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3) with the note that the current point represents two control points.


curveFromTo

public void curveFromTo(float x1,
                        float y1,
                        float x3,
                        float y3)
Appends a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3) with the note that the (x3, y3) point represents two control points.


rectangle

public void rectangle(float x,
                      float y,
                      float w,
                      float h)
Appends a rectangle to the current path as a complete subpath.


closeSubpath

public void closeSubpath()
Closes the current subpath.


closeAllSubpaths

public void closeAllSubpaths()
Closes all subpathes contained in this path.


replaceCloseWithLine

public List<Integer> replaceCloseWithLine()
Adds additional line to each closed subpath and makes the subpath unclosed. The line connects the last and the first points of the subpaths.


isEmpty

public boolean isEmpty()
Path is empty if it contains no subpaths.



Copyright © 2015. All Rights Reserved.