public class Underline extends Object
This class is to be used as a property for an element or renderer,
as the value for Property.UNDERLINE.
| Modifier and Type | Field and Description |
|---|---|
protected int |
lineCapStyle |
protected float |
thickness |
protected float |
thicknessMul |
protected TransparentColor |
transparentColor |
protected float |
yPosition |
protected float |
yPositionMul |
| Constructor and Description |
|---|
Underline(Color color,
float opacity,
float thickness,
float thicknessMul,
float yPosition,
float yPositionMul,
int lineCapStyle)
Creates an Underline.
|
Underline(Color color,
float thickness,
float thicknessMul,
float yPosition,
float yPositionMul,
int lineCapStyle)
Creates an Underline.
|
| Modifier and Type | Method and Description |
|---|---|
Color |
getColor()
Gets the color of the underline.
|
float[] |
getDashArray()
Gets dash array part of the dash pattern to be used when paths are stroked.
|
float |
getDashPhase()
Gets dash phase part of the dash pattern to be used when paths are stroked.
|
int |
getLineCapStyle()
Gets the
PdfCanvasConstants.LineCapStyle of the text underline. |
float |
getOpacity()
Gets the opacity of the underline color.
|
TransparentColor |
getStrokeColor()
Gets the color of the underline stroke.
|
float |
getStrokeWidth()
Gets the thickness of the underline stroke.
|
float |
getThickness(float fontSize)
Gets the total thickness of the underline (fixed + variable part).
|
float |
getYPosition(float fontSize)
Gets the vertical position of the underline (fixed + variable part).
|
float |
getYPositionMul()
Gets the multiplier for the vertical positioning of the text underline.
|
Underline |
setDashPattern(float[] dashArray,
float dashPhase)
Sets a description of the dash pattern to be used when paths are stroked.
|
Underline |
setStrokeColor(TransparentColor strokeColor)
Sets the stroke color of the underline.
|
Underline |
setStrokeWidth(float strokeWidth)
Sets the thickness of the underline stroke.
|
protected TransparentColor transparentColor
protected float thickness
protected float thicknessMul
protected float yPosition
protected float yPositionMul
protected int lineCapStyle
public Underline(Color color, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
thicknessMul to 0;
if you want a thickness solely dependent on the font size, set
thickness to 0.
Mutatis mutandis for the y-position.color - the Color of the underlinethickness - a float defining the minimum thickness in points of the underlinethicknessMul - a float defining the font size dependent component of the thickness of the underlineyPosition - a float defining the default absolute vertical distance in points from the text's base lineyPositionMul - a float defining the font size dependent component of the vertical positioning of the underlinelineCapStyle - the way the underline finishes at its edges. PdfCanvasConstants.LineCapStylepublic Underline(Color color, float opacity, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
thicknessMul to 0;
if you want a thickness solely dependent on the font size, set
thickness to 0.
Mutatis mutandis for the y-position.color - the Color of the underlineopacity - a float defining the opacity of the underline; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparentthickness - a float defining the minimum thickness in points of the underlinethicknessMul - a float defining the font size dependent component of the thickness of the underlineyPosition - a float defining the default absolute vertical distance in points from the text's base lineyPositionMul - a float defining the font size dependent component of the vertical positioning of the underlinelineCapStyle - the way the underline finishes at its edges. PdfCanvasConstants.LineCapStylepublic float getOpacity()
public float getThickness(float fontSize)
fontSize - the font size for which to calculate the variable thicknessfloat, in pointspublic float getYPosition(float fontSize)
fontSize - the font size for which to calculate the variable positionfloat, in pointspublic float getYPositionMul()
floatpublic int getLineCapStyle()
PdfCanvasConstants.LineCapStyle of the text underline.int referring to
the values of PdfCanvasConstants.LineCapStylepublic TransparentColor getStrokeColor()
TransparentColor stroke colorpublic Underline setStrokeColor(TransparentColor strokeColor)
strokeColor - TransparentColor stroke colorUnderline instancepublic float getStrokeWidth()
public Underline setStrokeWidth(float strokeWidth)
strokeWidth - float value of the stroke widthUnderline instancepublic float[] getDashArray()
The line dash pattern is expressed as an array of the form [ dashArray dashPhase ], where dashArray is itself an array and dashPhase is an integer.
An empty dash array (first element in the array) and zero phase (second element in the array) can be used to restore the dash pattern to a solid line.
public float getDashPhase()
The line dash pattern is expressed as an array of the form [ dashArray dashPhase ], where dashArray is itself an array and dashPhase is an integer.
An empty dash array (first element in the array) and zero phase (second element in the array) can be used to restore the dash pattern to a solid line.
public Underline setDashPattern(float[] dashArray, float dashPhase)
The line dash pattern is expressed as an array of the form [ dashArray dashPhase ], where dashArray is itself an array and dashPhase is a number.
An empty dash array (first element in the array) and zero phase (second element in the array) can be used to restore the dash pattern to a solid line.
dashArray - dash arraydashPhase - dash phase valueUnderline instanceCopyright © 1998–2025 Apryse Group NV. All rights reserved.