Class DottedLine

java.lang.Object
com.itextpdf.kernel.pdf.canvas.draw.DottedLine
All Implemented Interfaces:
ILineDrawer

public class DottedLine extends Object implements ILineDrawer
Implementation of ILineDrawer which draws a dotted horizontal line along the bottom edge of the specified rectangle.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected float
    gap
    the gap between the dots.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle.
    DottedLine(float lineWidth)
    Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle.
    DottedLine(float lineWidth, float gap)
    Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    draw(PdfCanvas canvas, Rectangle drawArea)
    Performs configurable drawing operations related to specific region coordinates on a canvas.
    Gets the color of the line
    float
    getGap()
    Getter for the gap between the center of the dots of the dotted line.
    float
    Gets line width in points
    void
    setColor(Color color)
    Sets line color
    void
    setGap(float gap)
    Setter for the gap between the center of the dots of the dotted line.
    void
    setLineWidth(float lineWidth)
    Sets line width in points

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • gap

      protected float gap
      the gap between the dots.
  • Constructor Details

    • DottedLine

      public DottedLine()
      Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle.
    • DottedLine

      public DottedLine (float lineWidth, float gap)
      Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle.
      Parameters:
      lineWidth - the width of the line
      gap - the gap between the center of the dots of the dotted line.
    • DottedLine

      public DottedLine (float lineWidth)
      Constructs a dotted horizontal line which will be drawn along the bottom edge of the specified rectangle.
      Parameters:
      lineWidth - the width of the line
  • Method Details

    • 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 interface ILineDrawer
      Parameters:
      canvas - the canvas to draw on
      drawArea - the rectangle in relation to which to fulfill drawing instructions
    • getGap

      public float getGap()
      Getter for the gap between the center of the dots of the dotted line.
      Returns:
      the gap between the center of the dots
    • setGap

      public void setGap (float gap)
      Setter for the gap between the center of the dots of the dotted line.
      Parameters:
      gap - the gap between the center of the dots
    • getLineWidth

      public float getLineWidth()
      Gets line width in points
      Specified by:
      getLineWidth in interface ILineDrawer
      Returns:
      line thickness
    • setLineWidth

      public void setLineWidth (float lineWidth)
      Sets line width in points
      Specified by:
      setLineWidth in interface ILineDrawer
      Parameters:
      lineWidth - new line width
    • getColor

      public Color getColor()
      Description copied from interface: ILineDrawer
      Gets the color of the line
      Specified by:
      getColor in interface ILineDrawer
      Returns:
      color of the line
    • setColor

      public void setColor (Color color)
      Description copied from interface: ILineDrawer
      Sets line color
      Specified by:
      setColor in interface ILineDrawer
      Parameters:
      color - new line color