DynamicPDF by ceTe Software

com.cete.dynamicpdf.pageelements
Class Line

java.lang.Object
  extended by com.cete.dynamicpdf.PageElement
      extended by com.cete.dynamicpdf.pageelements.TaggablePageElement
          extended by com.cete.dynamicpdf.pageelements.Line

public class Line
extends TaggablePageElement

This class can be used to place lines of different length, width, color and patterns on a page.

Licensing:
This class is a DynamicPDF Generator Community Edition feature.

View Example


Constructor Summary
Line(float x1, float y1, float x2, float y2)
          Initializes a new instance of the Line class.
Line(float x1, float y1, float x2, float y2, Color color)
          Initializes a new instance of the Line class.
Line(float x1, float y1, float x2, float y2, float width)
          Initializes a new instance of the Line class.
Line(float x1, float y1, float x2, float y2, float width, Color color)
          Initializes a new instance of the Line class.
Line(float x1, float y1, float x2, float y2, float width, Color color, LineStyle style)
          Initializes a new instance of the Line class.
 
Method Summary
 void draw(PageWriter writer)
          Draws the line to the given PageWriter object.
 LineCap getCap()
          Gets the LineCap enumeration used to specify the line cap style of the line.
 Color getColor()
          Gets the Color object to use for the line.
 LineStyle getStyle()
          Gets the LineStyle object to use for the style of the line.
 float getWidth()
          Gets the width of the line.
 float getX1()
          Gets the X1 coordinate of the line.
 float getX2()
          Gets the X2 coordinate of the line.
 float getY1()
          Gets the Y1 coordinate of the line.
 float getY2()
          Gets the Y2 coordinate of the line.
 void setCap(LineCap value)
          Sets the LineCap enumeration used to specify the line cap style of the line.
 void setColor(Color value)
          Sets the Color object to use for the line.
 void setStyle(LineStyle value)
          Sets the LineStyle object to use for the style of the line.
 void setWidth(float value)
          Sets the width of the line.
 void setX1(float value)
          Sets the X1 coordinate of the line.
 void setX2(float value)
          Sets the X2 coordinate of the line.
 void setY1(float value)
          Sets the Y1 coordinate of the line.
 void setY2(float value)
          Sets the Y2 coordinate of the line.
 
Methods inherited from class com.cete.dynamicpdf.pageelements.TaggablePageElement
getTag, getTagOrder, setTag, setTagOrder
 
Methods inherited from class com.cete.dynamicpdf.PageElement
getRequiredLicenseLevel, getStrID, setRequiredLicenseLevel, setStrID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Line

public Line(float x1,
            float y1,
            float x2,
            float y2)
Initializes a new instance of the Line class.

Parameters:
x1 - X1 coordinate of the line.
y1 - Y1 coordinate of the line.
x2 - X2 coordinate of the line.
y2 - Y2 coordinate of the line.
See Also:
Line

Line

public Line(float x1,
            float y1,
            float x2,
            float y2,
            float width)
Initializes a new instance of the Line class.

Parameters:
x1 - X1 coordinate of the line.
y1 - Y1 coordinate of the line.
x2 - X2 coordinate of the line.
y2 - Y2 coordinate of the line.
width - Width of the line.
See Also:
Line

Line

public Line(float x1,
            float y1,
            float x2,
            float y2,
            Color color)
Initializes a new instance of the Line class.

Parameters:
x1 - X1 coordinate of the line.
y1 - Y1 coordinate of the line.
x2 - X2 coordinate of the line.
y2 - Y2 coordinate of the line.
color - Color of the line.
See Also:
Line

Line

public Line(float x1,
            float y1,
            float x2,
            float y2,
            float width,
            Color color)
Initializes a new instance of the Line class.

Parameters:
x1 - X1 coordinate of the line.
y1 - Y1 coordinate of the line.
x2 - X2 coordinate of the line.
y2 - Y2 coordinate of the line.
width - Width of the line.
color - Color of the line.
See Also:
Line

Line

public Line(float x1,
            float y1,
            float x2,
            float y2,
            float width,
            Color color,
            LineStyle style)
Initializes a new instance of the Line class.

Throws:
GeneratorException - If Line width is less than or equal to zero.
Parameters:
x1 - X1 coordinate of the line.
y1 - Y1 coordinate of the line.
x2 - X2 coordinate of the line.
y2 - Y2 coordinate of the line.
width - Width of the line.
color - Color of the line.
style - Style of the line.
See Also:
Line
Method Detail

setStyle

public void setStyle(LineStyle value)
Sets the LineStyle object to use for the style of the line.

Parameters:
value - the line style of the line.
See Also:
LineStyle

getStyle

public LineStyle getStyle()
Gets the LineStyle object to use for the style of the line.

Returns:
the line style of the line.
See Also:
LineStyle

setCap

public void setCap(LineCap value)
Sets the LineCap enumeration used to specify the line cap style of the line.

Parameters:
value - the line cap of the line.
See Also:
LineCap

getCap

public LineCap getCap()
Gets the LineCap enumeration used to specify the line cap style of the line.

Returns:
the line cap of the line.
See Also:
LineCap

setWidth

public void setWidth(float value)
Sets the width of the line.

Throws:
GeneratorException - If Line width is less than or equal to zero.
Parameters:
value - the width of the line.

getWidth

public float getWidth()
Gets the width of the line.

Returns:
the width of the line.

setColor

public void setColor(Color value)
Sets the Color object to use for the line.

Parameters:
value - the color of the line.
See Also:
Color

getColor

public Color getColor()
Gets the Color object to use for the line.

Returns:
the color of the line.
See Also:
Color

setX1

public void setX1(float value)
Sets the X1 coordinate of the line.

Parameters:
value - the X1 coordinate of the line.

getX1

public float getX1()
Gets the X1 coordinate of the line.

Returns:
the X1 coordinate of the line.

setY1

public void setY1(float value)
Sets the Y1 coordinate of the line.

Parameters:
value - the Y1 coordinate of the line.

getY1

public float getY1()
Gets the Y1 coordinate of the line.

Returns:
the Y1 coordinate of the line.

setX2

public void setX2(float value)
Sets the X2 coordinate of the line.

Parameters:
value - the X2 coordinate of the line.

getX2

public float getX2()
Gets the X2 coordinate of the line.

Returns:
the X2 coordinate of the line.

setY2

public void setY2(float value)
Sets the Y2 coordinate of the line.

Parameters:
value - the Y2 coordinate of the line.

getY2

public float getY2()
Gets the Y2 coordinate of the line.

Returns:
the Y2 coordinate of the line.

draw

public void draw(PageWriter writer)
Draws the line to the given PageWriter object.

Overrides:
draw in class TaggablePageElement
Parameters:
writer - PageWriter object to receive the line's output.
See Also:
PageWriter

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.04 for Java generated on September 25, 2019
© Copyright 2019, ceTe Software