aspose.pdf
Class Line

java.lang.Object
  extended by aspose.pdf.Shape
      extended by aspose.pdf.UnclosedShape
          extended by aspose.pdf.Line

public class Line
extends UnclosedShape

Represents a line Shape in a Graph.

Typical usages are the following:

[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); Graph graph1 = new Graph(200,400); sec1.getParagraphs().add(graph1); float[] posArr = new float[]{100,0,300,0}; Line l1= new Line(graph1,posArr); l1.getGraphInfo().setColor(new Color("Red")); graph1.getShapes().add(l1); posArr = new float[]{100,50,300,50}; Line l2 = new Line(graph1,posArr); l2.getGraphInfo().setColor(new Color((byte)0,(byte)128,(byte)128)); graph1.getShapes().add(l2); posArr = new float[]{100,100,300,100}; Line l3 = new Line(graph1,posArr); l3.getGraphInfo().setColor(new Color((byte)0,(byte)128,(byte)64,(byte)0)); graph1.getShapes().add(l3); posArr = new float[]{100,150,300,150}; Line l4 = new Line(graph1,posArr); l4.getGraphInfo().setColor(new Color((byte)140)); graph1.getShapes().add(l4); pdf1.save(....); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Graph Height="200" Width="400"> <Line Color="Red" Position="100 0 300 0" /> <Line Color="rgb 0 128 128" Position="100 50 300 50" /> <Line Color="cmyk 0 128 64 0" Position="100 100 300 100" /> <Line Color="gray 140" Position="100 150 300 150" /> </Graph> </Section> </Pdf>


Constructor Summary
Line()
          Initializes a new instance of the Graph class.
Line(float[] positionArray)
          Initializes a new instance of the Graph class.
Line(Graph graph)
          Initializes a new instance of the Graph class.
Line(Graph graph, float[] positionArray)
          Initializes a new instance of the Line class.
 
Method Summary
 java.lang.Object clone()
          Duplicate a new Line object
 void drawArrow(Graph graph)
          Draw the arrow of line.
 float[] getEndPosition()
          Return the last point of unclosed shape.
 PositionArray getPositionArray()
          Gets a PositionArray object that indicates the position array.The array is composed by coordinates of each control point of the line.Note that you can use the Graph constructor to create a Line object and need not use this class directly.
 float[] getStartPosition()
          Return the first point of unclosed shape.
 boolean isClosed()
           
 void setPositionArray(float[] posArr)
           
 void setPositionArray(PositionArray posArr)
          Sets a PositionArray object that indicates the position array.The array is composed by coordinates of each control point of the line.Note that you can use the Graph constructor to create a Line object and need not use this class directly.
 
Methods inherited from class aspose.pdf.Shape
getGraphInfo, getID, setGraphInfo, setID
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Line

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


Line

public Line(float[] positionArray)
Initializes a new instance of the Graph class.

Parameters:
positionArray - The line position array.

Line

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

Parameters:
graph - The specified Graph object.

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


Line

public Line(Graph graph,
            float[] positionArray)
Initializes a new instance of the Line class.

Parameters:
graph - The specified Graph object.
positionArray - The line position array.The array is composed by coordinates of each control point of the line.

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

Method Detail

getPositionArray

public PositionArray getPositionArray()
Gets a PositionArray object that indicates the position array.The array is composed by coordinates of each control point of the line.Note that you can use the Graph constructor to create a Line object and need not use this class directly.


setPositionArray

public void setPositionArray(PositionArray posArr)
Sets a PositionArray object that indicates the position array.The array is composed by coordinates of each control point of the line.Note that you can use the Graph constructor to create a Line object and need not use this class directly.

Parameters:
posArr -

setPositionArray

public void setPositionArray(float[] posArr)

drawArrow

public void drawArrow(Graph graph)
Draw the arrow of line.

Parameters:
graph -

clone

public java.lang.Object clone()
Duplicate a new Line object

Overrides:
clone in class java.lang.Object

isClosed

public boolean isClosed()

getStartPosition

public float[] getStartPosition()
Description copied from class: UnclosedShape
Return the first point of unclosed shape.

Specified by:
getStartPosition in class UnclosedShape

getEndPosition

public float[] getEndPosition()
Description copied from class: UnclosedShape
Return the last point of unclosed shape.

Specified by:
getEndPosition in class UnclosedShape