Element
, DrawInterface
DottedLineSeparator
public class LineSeparator extends VerticalPositionMark
Modifier and Type | Field | Description |
---|---|---|
protected int |
alignment |
The alignment of the line.
|
protected BaseColor |
lineColor |
The color of the line.
|
protected float |
lineWidth |
The thickness of the line.
|
protected float |
percentage |
The width of the line as a percentage of the available page width.
|
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, BODY, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CHAPTER, CHUNK, CREATIONDATE, CREATOR, DIV, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LANGUAGE, LIST, LISTITEM, MARKED, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, SECTION, SUBJECT, TITLE, WRITABLE_DIRECT, YMARK
drawInterface, offset
Constructor | Description |
---|---|
LineSeparator() |
Creates a new instance of the LineSeparator class with
default values: lineWidth 1 user unit, width 100%, centered with offset 0.
|
LineSeparator(float lineWidth,
float percentage,
BaseColor lineColor,
int align,
float offset) |
Creates a new instance of the LineSeparator class.
|
LineSeparator(Font font) |
Creates a new instance of the LineSeparator class.
|
Modifier and Type | Method | Description |
---|---|---|
void |
draw(PdfContentByte canvas,
float llx,
float lly,
float urx,
float ury,
float y) |
Implement this method if you want to draw something at the current Y position
(for instance a line).
|
void |
drawLine(PdfContentByte canvas,
float leftX,
float rightX,
float y) |
Draws a horizontal line.
|
int |
getAlignment() |
Getter for the alignment of the line.
|
BaseColor |
getLineColor() |
Getter for the color of the line that will be drawn.
|
float |
getLineWidth() |
Getter for the line width.
|
float |
getPercentage() |
Setter for the width as a percentage of the available width.
|
void |
setAlignment(int align) |
Setter for the alignment of the line.
|
void |
setLineColor(BaseColor color) |
Setter for the color of the line that will be drawn.
|
void |
setLineWidth(float lineWidth) |
Setter for the line width.
|
void |
setPercentage(float percentage) |
Setter for the width as a percentage of the available width.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getChunks, getDrawInterface, getOffset, isContent, isNestable, process, setDrawInterface, setOffset, type
protected float lineWidth
protected float percentage
protected BaseColor lineColor
protected int alignment
public LineSeparator(float lineWidth, float percentage, BaseColor lineColor, int align, float offset)
lineWidth
- the thickness of the linepercentage
- the width of the line as a percentage of the available page widthlineColor
- the color of the linealign
- the alignmentoffset
- the offset of the line relative to the current baseline (negative = under the baseline)public LineSeparator(Font font)
font
- the fontpublic LineSeparator()
public void draw(PdfContentByte canvas, float llx, float lly, float urx, float ury, float y)
DrawInterface
draw
in interface DrawInterface
draw
in class VerticalPositionMark
canvas
- the canvas on which you can drawllx
- the x coordinate of the left page marginlly
- the y coordinate of the bottom page marginurx
- the x coordinate of the right page marginury
- the y coordinate of the top page marginy
- the current y position on the pageDrawInterface.draw(com.itextpdf.text.pdf.PdfContentByte, float, float, float, float, float)
public void drawLine(PdfContentByte canvas, float leftX, float rightX, float y)
canvas
- the canvas to draw onleftX
- the left x coordinaterightX
- the right x coordindatey
- the y coordinatepublic float getLineWidth()
public void setLineWidth(float lineWidth)
lineWidth
- the thickness of the line that will be drawn.public float getPercentage()
public void setPercentage(float percentage)
percentage
- a width percentagepublic BaseColor getLineColor()
public void setLineColor(BaseColor color)
color
- a colorpublic int getAlignment()
public void setAlignment(int align)
align
- an alignment valueCopyright © 2018. All rights reserved.