Class DashedLine
- java.lang.Object
-
- com.itextpdf.kernel.pdf.canvas.draw.DashedLine
-
- All Implemented Interfaces:
ILineDrawer
public class DashedLine extends java.lang.Object implements ILineDrawer
Implementation ofILineDrawer
which draws a dashed horizontal line over the middle of the specified rectangle.
-
-
Constructor Summary
Constructors Constructor Description DashedLine()
DashedLine(float lineWidth)
Creates an instance ofDashedLine
with the specified line width.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
draw(PdfCanvas canvas, Rectangle drawArea)
Performs configurable drawing operations related to specific region coordinates on a canvas.Color
getColor()
Gets the color of the linefloat
getLineWidth()
Gets line width in points.void
setColor(Color color)
Sets line colorvoid
setLineWidth(float lineWidth)
Sets line width in points.
-
-
-
Field Detail
-
lineWidth
private float lineWidth
-
color
private Color color
-
-
Constructor Detail
-
DashedLine
public DashedLine()
-
DashedLine
public DashedLine(float lineWidth)
Creates an instance ofDashedLine
with the specified line width.- Parameters:
lineWidth
- the line width
-
-
Method Detail
-
draw
public void draw(PdfCanvas canvas, Rectangle drawArea)
Description copied from interface:ILineDrawer
Performs configurable drawing operations related to specific region coordinates on a canvas.- Specified by:
draw
in interfaceILineDrawer
- Parameters:
canvas
- the canvas to draw ondrawArea
- the rectangle in relation to which to fulfill drawing instructions
-
getLineWidth
public float getLineWidth()
Gets line width in points.- Specified by:
getLineWidth
in interfaceILineDrawer
- Returns:
- line thickness
-
setLineWidth
public void setLineWidth(float lineWidth)
Sets line width in points.- Specified by:
setLineWidth
in interfaceILineDrawer
- Parameters:
lineWidth
- new line width
-
getColor
public Color getColor()
Description copied from interface:ILineDrawer
Gets the color of the line- Specified by:
getColor
in interfaceILineDrawer
- Returns:
- color of the line
-
setColor
public void setColor(Color color)
Description copied from interface:ILineDrawer
Sets line color- Specified by:
setColor
in interfaceILineDrawer
- Parameters:
color
- new line color
-
-