aspose.pdf
Class Path

java.lang.Object
  extended by aspose.pdf.Shape
      extended by aspose.pdf.ClosedShape
          extended by aspose.pdf.Path

public class Path
extends ClosedShape

Path is a closed shape (contour) that consists of several unclosed Shapes such as Lines, Bezier curves, Arc. Other shapes are ignored for writing.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec = pdf.getSections().add(); Color color = new aspose.pdf.Color("Red"); Graph graph = new Graph(100,400); sec.getParagraphs().add(graph); Path path = new Path(graph); path.getGraphInfo().setFillColor(color); path.getGraphInfo().setIsFilled(true); path.getGraphInfo().setFillRule("evenodd"); graph.getShapes().add(path); Line line = new Line(new float [] {200, 80, 200, 100}); path.getShapes().add(line); Arc arc = new Arc(200, 50, 50, 90, 270); path.getShapes().add(arc); float [] curPos = arc.getEndPosition(); line = new Line(new float [] {curPos[0], curPos[1], 200, 20}); path.getShapes().add(line); arc = new Arc(200, 50, 30, 270, 90); path.getShapes().add(arc); pdf1.save(....);


Constructor Summary
Path()
          Initializes a new instance of the Path class.
Path(Graph graph)
          Initializes a new instance of the Path class.
 
Method Summary
 void close()
          Closes this path by connecting the first point of the first unclosed shape with the last point of the last unclosed shape with a line segment.
 float[] getBeginPosition()
          Returns the first point of the first unclosed shape.
 float[] getEndPosition()
          Returns the last point of the last unclosed shape.
 java.util.List<UnclosedShape> getShapes()
          Returns a list of unclosed shapes.
 boolean isClosed()
          Checks whether this Path object is closed, that is the first point of the first unclosed shape coincides with the last point of the last unclosed shape.
 void setShapes(java.util.List<UnclosedShape> shapes)
          Set a list of unclosed shapes.
 
Methods inherited from class aspose.pdf.Shape
getGraphInfo, getID, setGraphInfo, setID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Path

public Path()
Initializes a new instance of the Path class.


Path

public Path(Graph graph)
Initializes a new instance of the Path class.

Parameters:
graph - The specified Graph object.

Remarks: This constructor can inherit common property values from the specified Graph object.

Method Detail

getShapes

public java.util.List<UnclosedShape> getShapes()
Returns a list of unclosed shapes.


setShapes

public void setShapes(java.util.List<UnclosedShape> shapes)
Set a list of unclosed shapes.

Parameters:
shapes -

isClosed

public boolean isClosed()
Checks whether this Path object is closed, that is the first point of the first unclosed shape coincides with the last point of the last unclosed shape.

Returns:

getBeginPosition

public float[] getBeginPosition()
Returns the first point of the first unclosed shape.

Returns:

getEndPosition

public float[] getEndPosition()
Returns the last point of the last unclosed shape.

Returns:

close

public void close()
Closes this path by connecting the first point of the first unclosed shape with the last point of the last unclosed shape with a line segment.