Interface JRLine

All Superinterfaces:
Cloneable, JRChild, JRCloneable, JRCommonElement, JRCommonGraphicElement, JRElement, JRGraphicElement, JRIdentifiable, JRPenContainer, JRPropertiesHolder, JRStyleContainer, JRVisitable
All Known Implementing Classes:
JRBaseLine, JRDesignLine, JRFillLine

public interface JRLine extends JRGraphicElement
An abstract representation of a graphic element representing a straight line.

When displaying a line element, JasperReports draws one of the two diagonals of the rectangle represented by the x, y, width, and height attributes specified for this element.

The direction attribute (see getDirection()) determines which one of the two diagonals of the rectangle should be drawn:

  • TopDown - draws a diagonal line from the top-left corner of the rectangle to the bottom-right corner.
  • BottomUp - draws a diagonal line from the bottom-left corner to the upper-right corner.

The default direction for a line is top-down.

One can draw vertical lines by specifying width="1" and horizontal lines by setting height="1". For vertical lines, the direction is not important.

Author:
Teodor Danciu (teodord@users.sourceforge.net)
  • Method Details

    • getDirection

      LineDirectionEnum getDirection()
      Gets the line direction.
      Returns:
      a value representing one of the line direction constants in LineDirectionEnum
    • setDirection

      void setDirection(LineDirectionEnum lineDirection)
      Sets the line direction.
      Parameters:
      lineDirection - a value representing one of the line direction constants in LineDirectionEnum