com.lowagie.text.pdf.draw

Class LineSeparator

public class LineSeparator extends VerticalPositionMark

Element that draws a solid line from left to right. Can be added directly to a document or column. Can also be used to create a separator chunk.

Since: 2.1.2

Author: Paulo Soares

Field Summary
protected intalignment
The alignment of the line.
protected ColorlineColor
The color of the line.
protected floatlineWidth
The thickness of the line.
protected floatpercentage
The width of the line as a percentage of the available page width.
Constructor Summary
LineSeparator(float lineWidth, float percentage, Color lineColor, int align, float offset)
Creates a new instance of the LineSeparator class.
LineSeparator()
Creates a new instance of the LineSeparator class with default values: lineWidth 1 user unit, width 100%, centered with offset 0.
Method Summary
voiddraw(PdfContentByte canvas, float llx, float lly, float urx, float ury, float y)
voiddrawLine(PdfContentByte canvas, float leftX, float rightX, float y)
Draws a horizontal line.
intgetAlignment()
Getter for the alignment of the line.
ColorgetLineColor()
Getter for the color of the line that will be drawn.
floatgetLineWidth()
Getter for the line width.
floatgetPercentage()
Setter for the width as a percentage of the available width.
voidsetAlignment(int align)
Setter for the alignment of the line.
voidsetLineColor(Color color)
Setter for the color of the line that will be drawn.
voidsetLineWidth(float lineWidth)
Setter for the line width.
voidsetPercentage(float percentage)
Setter for the width as a percentage of the available width.

Field Detail

alignment

protected int alignment
The alignment of the line.

lineColor

protected Color lineColor
The color of the line.

lineWidth

protected float lineWidth
The thickness of the line.

percentage

protected float percentage
The width of the line as a percentage of the available page width.

Constructor Detail

LineSeparator

public LineSeparator(float lineWidth, float percentage, Color lineColor, int align, float offset)
Creates a new instance of the LineSeparator class.

Parameters: lineWidth the thickness of the line percentage the width of the line as a percentage of the available page width lineColor the color of the line align the alignment offset the offset of the line relative to the current baseline (negative = under the baseline)

LineSeparator

public LineSeparator()
Creates a new instance of the LineSeparator class with default values: lineWidth 1 user unit, width 100%, centered with offset 0.

Method Detail

draw

public void draw(PdfContentByte canvas, float llx, float lly, float urx, float ury, float y)

See Also: DrawInterface

drawLine

public void drawLine(PdfContentByte canvas, float leftX, float rightX, float y)
Draws a horizontal line.

Parameters: canvas the canvas to draw on leftX the left x coordinate rightX the right x coordindate y the y coordinate

getAlignment

public int getAlignment()
Getter for the alignment of the line.

Returns: an alignment value

getLineColor

public Color getLineColor()
Getter for the color of the line that will be drawn.

Returns: a color

getLineWidth

public float getLineWidth()
Getter for the line width.

Returns: the thickness of the line that will be drawn.

getPercentage

public float getPercentage()
Setter for the width as a percentage of the available width.

Returns: a width percentage

setAlignment

public void setAlignment(int align)
Setter for the alignment of the line.

Parameters: align an alignment value

setLineColor

public void setLineColor(Color color)
Setter for the color of the line that will be drawn.

Parameters: color a color

setLineWidth

public void setLineWidth(float lineWidth)
Setter for the line width.

Parameters: lineWidth the thickness of the line that will be drawn.

setPercentage

public void setPercentage(float percentage)
Setter for the width as a percentage of the available width.

Parameters: percentage a width percentage