DynamicPDF by ceTe Software

com.cete.dynamicpdf.text
Class TextLineList

java.lang.Object
  extended by com.cete.dynamicpdf.text.TextLineList
Direct Known Subclasses:
LatinTextLineList, UniversalTextLineList

public abstract class TextLineList
extends java.lang.Object

Represents a list of text lines.

Licensing:
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:


Constructor Summary
protected TextLineList(char[] text, int start, int length, float width, float height, Font font, float fontSize, boolean initialLineIsNewParagraph)
          Initializes a new instance of the TextLineList class.
protected TextLineList(int start, float width, float height, boolean initialLineIsNewParagraph, TextLineList textLineList)
          Initializes a new instance of the TextLineList class.
 
Method Summary
protected  void add(TextLine line)
          Add a text line to the text line list.
protected abstract  boolean calculateLines(com.cete.dynamicpdf.text.LineCalculationMode mode)
          Calculates the lines of the text line list.
 void draw(OperatorWriter writer, float x, float y, TextAlign align, Color textColor, boolean underline, boolean rightToLeft)
          Draws the text line list to the given OperatorWriter object.
 void draw(OperatorWriter writer, float x, float y, TextAlign align, Color textColor, boolean underline, int startLine, int lineCount, boolean rightToLeft)
           
 void draw(OperatorWriter writer, float x, float y, TextAlign align, Color textColor, boolean underline, int startLine, int lineCount, boolean rightToLeft, boolean strikeThrough)
          Draws the text line list to the given OperatorWriter object.
 void draw(OperatorWriter writer, float x, float y, TextAlign align, Color textColor, Color textOutlineColor, float textOutlineWidth, boolean underline, boolean rightToLeft, boolean strikeThrough)
          Draws the text line list to the given OperatorWriter object.
 boolean getAutoLeading()
          Gets the leading of the text line list, calculated automatically.
protected  float getBaseLine()
          Gets the baseline value for the text line list.
 boolean getCleanParagraphBreaks()
          Gets if the text line list should have clean paragraph breaks.
protected  int getEnd()
          Gets the ending index for text in the text line list.
 Font getFont()
          Gets the font of the text line list.
 float getFontSize()
          Gets the font size of the text line list.
 float getHeight()
          Gets the height of the text line list.
 boolean getkerningEnabled()
           
 float getLeading()
          Gets the leading of the text line list.
protected  int getLineCount()
          Gets the line count of the text line list.
 int getLineCount(int startLine, float height)
          Returns the number of lines that will draw for the given height.
 float getMaximumWidth()
          Get the maximum width of text in the line list.
abstract  TextLineList getOverflow(float width, float height)
          Returns an overflow TextLineList.
abstract  java.lang.String getOverflowText()
          Returns the overflow text of the text line list.
 float getParagraphIndent()
          Gets the paragraph indention of the text line list.
 float getParagraphSpacing()
          Gets the paragraph spacing of the text line list.
 float getRequiredHeight(int startLine)
          Returns the required height for the all the text to display.
protected  int getStart()
          Gets the start index for text in the text line list.
 java.lang.String getText()
          Returns the text of the text line list.
protected  char[] getTextArray()
          Gets the text of the text line list.
 float getTextHeight()
          Returns the height of the visible text.
 float getTextHeight(int lineCount)
          Returns the height of the visible text.
protected  TextLine getTextLine(int index)
          Gets the text line at the given index.
 int getVisibleLineCount()
          Gets the number of lines that will be drawn.
 float getWidth()
          Gets the width of the text line list.
abstract  boolean hasOverflow()
          Returns a value indicating if the text line list has overflow lines.
protected abstract  void initializeLines(boolean newParagraph)
          Initializes the text line list.
 void setAutoLeading(boolean value)
          Sets whether the leading of the text line list should be calculated automatically.
 void setCleanParagraphBreaks(boolean cleanParagraphBreaks)
          Sets if the text line list should have clean paragraph breaks.
protected  void setEnd(int end)
          Sets the ending index for text in the text line list.
 void setFont(Font font)
          Sets the font of the text line list.
 void setFontSize(float fontSize)
          Sets the font size of the text line list.
 void setHeight(float height)
          Sets the height of the text line list.
 boolean setkerningEnabled(boolean value)
           
 void setLeading(float leading)
          Sets the leading of the text line list.
protected  void setLines(boolean setAllLines)
          Sets the lines of the line list.
 void setParagraphIndent(float paragraphIndent)
          Sets the paragraph indention of the text line list.
 void setParagraphSpacing(float paragraphSpacing)
          Sets the paragraph spacing of the text line list.
protected  void setStart(int start)
          Sets the start index for text in the text line list.
 void setText(char[] text)
          Sets the text of the text line list to a new value.
 void setText(java.lang.String text)
          Sets the text of the text line list to a new value.
protected  void setTextArray(char[] text)
          Sets the text of the text line list.
 void setWidth(float width)
          Set the width of the text line list.
 int size()
          Gets the number of lines in the text line list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextLineList

protected TextLineList(char[] text,
                       int start,
                       int length,
                       float width,
                       float height,
                       Font font,
                       float fontSize,
                       boolean initialLineIsNewParagraph)
Initializes a new instance of the TextLineList class.

Parameters:
text - Text of the text line list.
start - Start index of the text for the text line list.
length - Length of the text for the text line list.
width - Width of the text line list.
height - Height of the text line list.
font - Font to use for text of the text line list.
fontSize - Font size to use for text of the text line list.
initialLineIsNewParagraph - Specifies if the first line of the text line list is a new paragraph.
See Also:
Font

TextLineList

protected TextLineList(int start,
                       float width,
                       float height,
                       boolean initialLineIsNewParagraph,
                       TextLineList textLineList)
Initializes a new instance of the TextLineList class.

Parameters:
start - Start index of the text for the text line list.
width - Width of the text line list.
height - Height of the text line list.
initialLineIsNewParagraph - Specifies if the first line of the text line list is a new paragraph.
textLineList - Previous text line list.
Method Detail

setLines

protected void setLines(boolean setAllLines)
Sets the lines of the line list.

Parameters:
setAllLines - Specifies if all lines should be set.

getkerningEnabled

public boolean getkerningEnabled()

setkerningEnabled

public boolean setkerningEnabled(boolean value)

calculateLines

protected abstract boolean calculateLines(com.cete.dynamicpdf.text.LineCalculationMode mode)
Calculates the lines of the text line list.

Parameters:
mode - Mode to use for the calculation.
Returns:
A value indicating if all the lines were calculated.

initializeLines

protected abstract void initializeLines(boolean newParagraph)
Initializes the text line list.

Parameters:
newParagraph -

getOverflow

public abstract TextLineList getOverflow(float width,
                                         float height)
Returns an overflow TextLineList.

Parameters:
width - Width of the overflow text line list.
height - Height of the overflow text line list.
Returns:
A TextLineList containing the overflowed lines.
See Also:
TextLineList

hasOverflow

public abstract boolean hasOverflow()
Returns a value indicating if the text line list has overflow lines.

Returns:
A value indicating if overflow lines exist.

getOverflowText

public abstract java.lang.String getOverflowText()
Returns the overflow text of the text line list.

Returns:
The overflow text.

getText

public java.lang.String getText()
Returns the text of the text line list.

Returns:
Text of the text line list.

setText

public void setText(java.lang.String text)
Sets the text of the text line list to a new value.

Parameters:
text - Text to set as the text of the text line list.

setText

public void setText(char[] text)
Sets the text of the text line list to a new value.

Parameters:
text - Character array to set as the text of the text line list.

setStart

protected void setStart(int start)
Sets the start index for text in the text line list.

Parameters:
start - Start index for text in the text line list.

getStart

protected int getStart()
Gets the start index for text in the text line list.

Returns:
Start index for text in the text line list.

setEnd

protected void setEnd(int end)
Sets the ending index for text in the text line list.

Parameters:
end - Ending index for text in the text line list.

getEnd

protected int getEnd()
Gets the ending index for text in the text line list.

Returns:
Ending index for text in the text line list.

add

protected void add(TextLine line)
Add a text line to the text line list.

Parameters:
line - TextLine which is to be added to the text line list.
See Also:
TextLine

getLineCount

protected int getLineCount()
Gets the line count of the text line list.

Returns:
line count of the text line list.

getVisibleLineCount

public int getVisibleLineCount()
Gets the number of lines that will be drawn.

Returns:
Number of lines that will be drawn.

getBaseLine

protected float getBaseLine()
Gets the baseline value for the text line list.

Returns:
Baseline value for the text line list.

getTextLine

protected TextLine getTextLine(int index)
Gets the text line at the given index.

Parameters:
index - Index from which text line is accessed.
Returns:
TextLine at the given index.
See Also:
TextLine

setTextArray

protected void setTextArray(char[] text)
Sets the text of the text line list.

Parameters:
text - Text of the text line list.

getTextArray

protected char[] getTextArray()
Gets the text of the text line list.

Returns:
Text of the text line list.

setWidth

public void setWidth(float width)
Set the width of the text line list.

Parameters:
width - Width of the text line list.

getWidth

public float getWidth()
Gets the width of the text line list.

Returns:
Width of the text line list.

setCleanParagraphBreaks

public void setCleanParagraphBreaks(boolean cleanParagraphBreaks)
Sets if the text line list should have clean paragraph breaks.

Parameters:
cleanParagraphBreaks - Specifies if the text line list should have clean paragraph breaks.

getCleanParagraphBreaks

public boolean getCleanParagraphBreaks()
Gets if the text line list should have clean paragraph breaks.

Returns:
Specifies if the text line list should have clean paragraph breaks.

setHeight

public void setHeight(float height)
Sets the height of the text line list.

Parameters:
height - Height of the text line list.

getHeight

public float getHeight()
Gets the height of the text line list.

Returns:
Height of the text line list.

setFont

public void setFont(Font font)
Sets the font of the text line list.

Parameters:
font - Font of the text line list.
See Also:
Font

getFont

public Font getFont()
Gets the font of the text line list.

Returns:
Font of the text line list.
See Also:
Font

setFontSize

public void setFontSize(float fontSize)
Sets the font size of the text line list.

Parameters:
fontSize - Font size of the text line list.

getFontSize

public float getFontSize()
Gets the font size of the text line list.

Returns:
Font size of the text line list.

setLeading

public void setLeading(float leading)
Sets the leading of the text line list.

Setting this property will automatically set the AutoLeading property to false.

Parameters:
leading - Leading of the text line list.

getLeading

public float getLeading()
Gets the leading of the text line list.

Returns:
Leading of the text line list.

getAutoLeading

public boolean getAutoLeading()
Gets the leading of the text line list, calculated automatically.

Returns:
The leading of the text line list calculated automatically, true by default.

setAutoLeading

public void setAutoLeading(boolean value)
Sets whether the leading of the text line list should be calculated automatically.

This property is automatically set to false any time the Leading property is set.

Parameters:
value - The leading of the text line list should be calculated automatically.

size

public int size()
Gets the number of lines in the text line list.

Returns:
Number of lines in the text line list.

setParagraphIndent

public void setParagraphIndent(float paragraphIndent)
Sets the paragraph indention of the text line list.

Parameters:
paragraphIndent - Paraghraph indention of the text line list.

getParagraphIndent

public float getParagraphIndent()
Gets the paragraph indention of the text line list.

Returns:
Paraghraph indention of the text line list.

setParagraphSpacing

public void setParagraphSpacing(float paragraphSpacing)
Sets the paragraph spacing of the text line list.

Parameters:
paragraphSpacing - Paragraph spacing of the text line list.

getParagraphSpacing

public float getParagraphSpacing()
Gets the paragraph spacing of the text line list.

Returns:
Paragraph spacing of the text line list.

getRequiredHeight

public float getRequiredHeight(int startLine)
Returns the required height for the all the text to display.

Parameters:
startLine - Start text line index.
Returns:
The required height of the text.

getTextHeight

public float getTextHeight(int lineCount)
Returns the height of the visible text.

Parameters:
lineCount - the number of lines to use for the calculation.
Returns:
the height of the text.

getMaximumWidth

public float getMaximumWidth()
Get the maximum width of text in the line list.

Returns:
the maximum width of text in the line list.

getTextHeight

public float getTextHeight()
Returns the height of the visible text.

Returns:
The height of the text.

getLineCount

public int getLineCount(int startLine,
                        float height)
Returns the number of lines that will draw for the given height.

Parameters:
startLine - Start text line index.
height - Height used for the calculation.
Returns:
the number of lines that will be drawn.

draw

public void draw(OperatorWriter writer,
                 float x,
                 float y,
                 TextAlign align,
                 Color textColor,
                 boolean underline,
                 boolean rightToLeft)
Draws the text line list to the given OperatorWriter object.

Parameters:
writer - OperatorWriter object to receive the link's output.
x - X coordinate of the text.
y - Y coordinate of the text.
align - Alignment of the text.
textColor - Color of the text.
underline - Specifies if the text should be underlined.
rightToLeft - Specifies if the text should be drawn right to left.
See Also:
OperatorWriter

draw

public void draw(OperatorWriter writer,
                 float x,
                 float y,
                 TextAlign align,
                 Color textColor,
                 boolean underline,
                 int startLine,
                 int lineCount,
                 boolean rightToLeft,
                 boolean strikeThrough)
Draws the text line list to the given OperatorWriter object.

Parameters:
writer - OperatorWriter object to receive the link's output.
x - X coordinate of the text.
y - Y coordinate of the text.
align - Alignment of the text.
textColor - Color of the text.
underline - Specifies if the text should be underlined.
startLine - Start line for the text.
lineCount - Number of lines to draw.
rightToLeft - Specifies if the text should be drawn right to left.
strikeThrough - Specifies if the text should be StrikeThrough
See Also:
OperatorWriter

draw

public void draw(OperatorWriter writer,
                 float x,
                 float y,
                 TextAlign align,
                 Color textColor,
                 Color textOutlineColor,
                 float textOutlineWidth,
                 boolean underline,
                 boolean rightToLeft,
                 boolean strikeThrough)
Draws the text line list to the given OperatorWriter object.

Parameters:
writer - OperatorWriter object to receive the link's output.
x - X coordinate of the text.
y - Y coordinate of the text.
align - Alignment of the text.
textColor - Color of the text.
textOutlineColor - Text outline color of the text.
textOutlineWidth - width of the text outline.
underline - Specifies if the text should be underlined.
rightToLeft - Specifies if the text should be drawn right to left.
strikeThrough - Specifies if the text should be StrikeThrough
See Also:
OperatorWriter

draw

public void draw(OperatorWriter writer,
                 float x,
                 float y,
                 TextAlign align,
                 Color textColor,
                 boolean underline,
                 int startLine,
                 int lineCount,
                 boolean rightToLeft)

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.04 for Java generated on September 25, 2019
© Copyright 2019, ceTe Software