DynamicPDF by ceTe Software

com.cete.dynamicpdf.pageelements
Class TextArea

java.lang.Object
  extended by com.cete.dynamicpdf.PageElement
      extended by com.cete.dynamicpdf.pageelements.TaggablePageElement
          extended by com.cete.dynamicpdf.pageelements.RotatingPageElement
              extended by com.cete.dynamicpdf.pageelements.TextArea
All Implemented Interfaces:
IArea, ICoordinate

public class TextArea
extends RotatingPageElement
implements IArea, ICoordinate

This class can be used to place text on a page. Using the methods GetOverflowText or GetOverflowTextArea and HasOverflowText, users can control the pagination of TextAreas that come from a source of unknown length.

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

View Example


Constructor Summary
TextArea(char[] text, float x, float y, float width, float height, Font font, float fontSize, TextAlign align)
          Initializes a new instance of the TextArea class.
TextArea(char[] text, float x, float y, float width, float height, Font font, float fontSize, TextAlign align, Color textColor)
          Initializes a new instance of the TextArea class.
TextArea(java.lang.String text, float x, float y, float width, float height)
          Initializes a new instance of the TextArea class.
TextArea(java.lang.String text, float x, float y, float width, float height, Font font)
          Initializes a new instance of the TextArea class.
TextArea(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize)
          Initializes a new instance of the TextArea class.
TextArea(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize, Color textColor)
          Initializes a new instance of the TextArea class.
TextArea(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize, TextAlign align)
          Initializes a new instance of the TextArea class.
TextArea(java.lang.String text, float x, float y, float width, float height, Font font, float fontSize, TextAlign align, Color textColor)
          Initializes a new instance of the TextArea class.
 
Method Summary
protected  void drawRotated(PageWriter writer)
          Draws the text area to the given PageWriter object.
 TextAlign getAlign()
          Gets the TextAlign enumeration that specifies the text alignment of the text area.
 boolean getAutoLeading()
          Gets the leading of the text area, calculated automatically.
 boolean getCleanParagraphBreaks()
          Gets the clean paragraph breaks for the paragraphs of the text area.
 Font getFont()
          Gets the Font object used to specify the font of the text for the text area.
 float getFontSize()
          Gets the font size for the text of the text area.
 float getHeight()
          Gets the height of the label.
 boolean getKerningEnabled()
          Gets the kerning property of the text.
 KerningValues getKerningValues()
          Get the Kerning values.
 float getLeading()
          Gets the leading for the text of the text area.
 float getLineTextWidth(int lineIndex)
           
 java.lang.String getOverflowText()
          Returns the text remaining that will be clipped by the text area.
 TextArea getOverflowTextArea()
          Returns a TextArea object containing the overflow text.
 TextArea getOverflowTextArea(float x, float y)
          Returns a TextArea object containing the overflow text.
 TextArea getOverflowTextArea(float x, float y, float width, float height)
          Returns a TextArea object containing the overflow text.
 float getParagraphIndent()
          Gets the paragraph indenting for the paragraphs of the text area.
 float getParagraphSpacing()
          Gets the paragraph spacing for the paragraphs of the text area.
 float getRequiredHeight()
          Returns the height required to fit all of the text supplied.
 boolean getRightToLeft()
          Gets a value indicating if text should be displayed right to left.
 boolean getStrikethrough()
          Gets the strikeThrough for the text outline of the label..
 java.lang.String getText()
          Gets the text of the text area.
 Color getTextColor()
          Gets the Color object to use for the text of the text area.
 float getTextHeight()
          Returns the height of the text that will be drawn.
 Color getTextOutlineColor()
          Gets the Color object to use for the text outline of the text area.
 float getTextOutlineWidth()
          Gets the line width to use for the text outline of the label..
 boolean getUnderline()
          Gets a value indicating if the text area is underlined.
 VAlign getVAlign()
          Gets VAlign enumeration that specifies the vertical text alignment of the text area.
 int getVisibleLineCount()
           
 float getWidth()
          Gets the width of the text area.
 boolean hasOverflowText()
          Returns a value indicating if there is text remaining that will not be drawn to the text area.
 void setAlign(TextAlign align)
          Sets the TextAlign enumeration that specifies the text alignment of the text area.
 void setAutoLeading(boolean value)
          Sets whether the leading of the text area should be calculated automatically.
 void setCleanParagraphBreaks(boolean cleanParagraphBreaks)
          Sets the clean paragraph breaks for the paragraphs of the text area.
 void setFont(Font font)
          Sets the Font object used to specify the font of the text for the text area.
 void setFontSize(float fontSize)
          Sets the font size for the text of the text area.
 void setHeight(float height)
          Sets the height of the label.
 void setKerningEnabled(boolean value)
          Sets the kerning property of the text.
 void setLeading(float leading)
          Sets the leading for the text of the text area.
 void setParagraphIndent(float paragraphIndent)
          Sets the paragraph indenting for the paragraphs of the text area.
 void setParagraphSpacing(float paragraphSpacing)
          Sets the paragraph spacing for the paragraphs of the text area.
 void setRightToLeft(boolean rightToLeft)
          Sets a value indicating if text should be displayed right to left.
 void setStrikethrough(boolean value)
          Sets the strikeThrough for the text outline of the label..
 void setText(java.lang.String text)
          Sets the text of the text area.
 void setTextColor(Color textColor)
          Sets the Color object to use for the text of the text area.
 void setTextOutlineColor(Color textOutlineColor)
          Sets the Color object to use for the text outline of the text area.
 void setTextOutlineWidth(float value)
          Sets the line width to use for the text outline of the label..
 void setUnderline(boolean underline)
          Sets a value indicating if the text area is underlined.
 void setVAlign(VAlign vAlign)
          Sets the VAlign enumeration that specifies the vertical text alignment of the text area.
 void setWidth(float width)
          Sets the width of the text area.
 
Methods inherited from class com.cete.dynamicpdf.pageelements.RotatingPageElement
draw, getAngle, getX, getY, setAngle, setX, setY
 
Methods inherited from class com.cete.dynamicpdf.pageelements.TaggablePageElement
getTag, getTagOrder, setTag, setTagOrder
 
Methods inherited from class com.cete.dynamicpdf.PageElement
getRequiredLicenseLevel, getStrID, setRequiredLicenseLevel, setStrID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cete.dynamicpdf.pageelements.ICoordinate
getX, getY, setX, setY
 

Constructor Detail

TextArea

public TextArea(java.lang.String text,
                float x,
                float y,
                float width,
                float height)
Initializes a new instance of the TextArea class.

Parameters:
text - Text to display in the text area.
x - X coordinate of the text area.
y - Y coordinate of the text area.
width - Width of the text area.
height - Height of the text area.

TextArea

public TextArea(java.lang.String text,
                float x,
                float y,
                float width,
                float height,
                Font font)
Initializes a new instance of the TextArea class.

Parameters:
text - Text to display in the text area.
x - X coordinate of the text area.
y - Y coordinate of the text area.
width - Width of the text area.
height - Height of the text area.
font - Font for the text of the text area.
See Also:
Font

TextArea

public TextArea(java.lang.String text,
                float x,
                float y,
                float width,
                float height,
                Font font,
                float fontSize)
Initializes a new instance of the TextArea class.

Parameters:
text - Text to display in the text area.
x - X coordinate of the text area.
y - Y coordinate of the text area.
width - Width of the text area.
height - Height of the text area.
font - Font for the text of the text area.
fontSize - Font size of the text of the text area.
See Also:
Font

TextArea

public TextArea(java.lang.String text,
                float x,
                float y,
                float width,
                float height,
                Font font,
                float fontSize,
                TextAlign align)
Initializes a new instance of the TextArea class.

Parameters:
text - Text to display in the text area.
x - X coordinate of the text area.
y - Y coordinate of the text area.
width - Width of the text area.
height - Height of the text area.
font - Font for the text of the text area.
fontSize - Font size of the text of the text area.
align - Alignment of the text of the text area.
See Also:
Font, Align

TextArea

public TextArea(java.lang.String text,
                float x,
                float y,
                float width,
                float height,
                Font font,
                float fontSize,
                Color textColor)
Initializes a new instance of the TextArea class.

Parameters:
text - Text to display in the text area.
x - X coordinate of the text area.
y - Y coordinate of the text area.
width - Width of the text area.
height - Height of the text area.
font - Font for the text of the text area.
fontSize - Font size of the text of the text area.
textColor - Color of the text of the text area.
See Also:
Font, Color

TextArea

public TextArea(java.lang.String text,
                float x,
                float y,
                float width,
                float height,
                Font font,
                float fontSize,
                TextAlign align,
                Color textColor)
Initializes a new instance of the TextArea class.

Parameters:
text - Text to display in the text area.
x - X coordinate of the text area.
y - Y coordinate of the text area.
width - Width of the text area.
height - Height of the text area.
font - Font for the text of the text area.
fontSize - Font size of the text of the text area.
align - Alignment of the text of the text area.
textColor - Color of the text of the text area.
See Also:
Font, TextAlign, Color

TextArea

public TextArea(char[] text,
                float x,
                float y,
                float width,
                float height,
                Font font,
                float fontSize,
                TextAlign align)
Initializes a new instance of the TextArea class.

Parameters:
text - Text to display in the text area.
x - X coordinate of the text area.
y - Y coordinate of the text area.
width - Width of the text area.
height - Height of the text area.
font - Font for the text of the text area.
fontSize - Font size of the text of the text area.
align - Alignment of the text of the text area.
See Also:
Font, Align

TextArea

public TextArea(char[] text,
                float x,
                float y,
                float width,
                float height,
                Font font,
                float fontSize,
                TextAlign align,
                Color textColor)
Initializes a new instance of the TextArea class.

Parameters:
text - Text to display in the text area.
x - X coordinate of the text area.
y - Y coordinate of the text area.
width - Width of the text area.
height - Height of the text area.
font - Font for the text of the text area.
fontSize - Font size of the text of the text area.
align - Alignment of the text of the text area.
textColor - Color of the text of the text area.
See Also:
Font, TextAlign, Color
Method Detail

setAlign

public void setAlign(TextAlign align)
Sets the TextAlign enumeration that specifies the text alignment of the text area.

Parameters:
align - TextAlign enumeration that specifies the text alignment of the text area.
See Also:
TextAlign

getAlign

public TextAlign getAlign()
Gets the TextAlign enumeration that specifies the text alignment of the text area.

Returns:
TextAlign enumeration that specifies the text alignment of the text area.
See Also:
TextAlign

setVAlign

public void setVAlign(VAlign vAlign)
Sets the VAlign enumeration that specifies the vertical text alignment of the text area.

Parameters:
vAlign - VAlign enumeration that specifies the vertical text alignment of the text area.
See Also:
VAlign

getVAlign

public VAlign getVAlign()
Gets VAlign enumeration that specifies the vertical text alignment of the text area.

Returns:
VAlign enumeration that specifies the vertical text alignment of the text area.
See Also:
VAlign

setUnderline

public void setUnderline(boolean underline)
Sets a value indicating if the text area is underlined.

Parameters:
underline - value indicating if the text area is underlined.

getUnderline

public boolean getUnderline()
Gets a value indicating if the text area is underlined.

Returns:
value indicating if the text area is underlined.

setRightToLeft

public void setRightToLeft(boolean rightToLeft)
Sets a value indicating if text should be displayed right to left.

Parameters:
rightToLeft - value indicating if text should be displayed right to left.

getRightToLeft

public boolean getRightToLeft()
Gets a value indicating if text should be displayed right to left.

Returns:
value indicating if text should be displayed right to left.

setText

public void setText(java.lang.String text)
Sets the text of the text area.

Parameters:
text - the text of the text area.

getText

public java.lang.String getText()
Gets the text of the text area.

Returns:
text of the text area.

setTextColor

public void setTextColor(Color textColor)
Sets the Color object to use for the text of the text area.

Parameters:
textColor - Color object to use for the text of the text area.
See Also:
Color

getTextColor

public Color getTextColor()
Gets the Color object to use for the text of the text area.

Returns:
Color object to use for the text of the text area.
See Also:
Color

setTextOutlineColor

public void setTextOutlineColor(Color textOutlineColor)
Sets the Color object to use for the text outline of the text area.

Parameters:
textOutlineColor - Color object to use for the text outline of the text area
See Also:
Color

getTextOutlineColor

public Color getTextOutlineColor()
Gets the Color object to use for the text outline of the text area.

Returns:
Color object to use for the text outline of the text area.
See Also:
Color

getTextOutlineWidth

public float getTextOutlineWidth()
Gets the line width to use for the text outline of the label..

Returns:
the text width of the text outline of the label.

setTextOutlineWidth

public void setTextOutlineWidth(float value)
Sets the line width to use for the text outline of the label..

Parameters:
value - the text width of the text outline of the label.

getStrikethrough

public boolean getStrikethrough()
Gets the strikeThrough for the text outline of the label..

Returns:
the strikeThrough of the text outline of the label.

setStrikethrough

public void setStrikethrough(boolean value)
Sets the strikeThrough for the text outline of the label..

Parameters:
value - strikeThrough of the text outline of the label.

setFont

public void setFont(Font font)
Sets the Font object used to specify the font of the text for the text area.

Parameters:
font - Font object used to specify the font of the text for the text area.
See Also:
Font

getFont

public Font getFont()
Gets the Font object used to specify the font of the text for the text area.

Returns:
Font object used to specify the font of the text for the text area.
See Also:
Font

setFontSize

public void setFontSize(float fontSize)
Sets the font size for the text of the text area.

Parameters:
fontSize - font size for the text of the text area.

getFontSize

public float getFontSize()
Gets the font size for the text of the text area.

Returns:
font size for the text of the text area.

setLeading

public void setLeading(float leading)
Sets the leading for the text of the text area.

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

Parameters:
leading - the leading for the text of the text area.

getLeading

public float getLeading()
Gets the leading for the text of the text area.

Returns:
leading for the text of the text area.

getAutoLeading

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

Returns:
The leading of the text area automatically calculated, true by default.
See Also:
setLeading(float)

setAutoLeading

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

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

Parameters:
value - the auto leading status of the text area.

setParagraphSpacing

public void setParagraphSpacing(float paragraphSpacing)
Sets the paragraph spacing for the paragraphs of the text area.

Parameters:
paragraphSpacing - paragraph spacing for the paragraphs of the text area.

getParagraphSpacing

public float getParagraphSpacing()
Gets the paragraph spacing for the paragraphs of the text area.

Returns:
paragraph spacing for the paragraphs of the text area.

setParagraphIndent

public void setParagraphIndent(float paragraphIndent)
Sets the paragraph indenting for the paragraphs of the text area.

Parameters:
paragraphIndent - paragraph indenting for the paragraphs of the text area.

getParagraphIndent

public float getParagraphIndent()
Gets the paragraph indenting for the paragraphs of the text area.

Returns:
paragraph indenting for the paragraphs of the text area.

setCleanParagraphBreaks

public void setCleanParagraphBreaks(boolean cleanParagraphBreaks)
Sets the clean paragraph breaks for the paragraphs of the text area.

Parameters:
cleanParagraphBreaks - clean paragraph breaks for the paragraphs of the text area.

getCleanParagraphBreaks

public boolean getCleanParagraphBreaks()
Gets the clean paragraph breaks for the paragraphs of the text area.

Returns:
clean paragraph breaks for the paragraphs of the text area.

setWidth

public void setWidth(float width)
Sets the width of the text area.

Specified by:
setWidth in interface IArea
Parameters:
width - the width of the text area.

getWidth

public float getWidth()
Gets the width of the text area.

Specified by:
getWidth in interface IArea
Returns:
width of the text area.

setHeight

public void setHeight(float height)
Sets the height of the label.

Specified by:
setHeight in interface IArea
Overrides:
setHeight in class RotatingPageElement
Parameters:
height - the height of the label.

getHeight

public float getHeight()
Gets the height of the label.

Specified by:
getHeight in interface IArea
Overrides:
getHeight in class RotatingPageElement
Returns:
height of the label.

getKerningEnabled

public boolean getKerningEnabled()
Gets the kerning property of the text.

Returns:
the kerning property of the text.

setKerningEnabled

public void setKerningEnabled(boolean value)
Sets the kerning property of the text.

Parameters:
value - boolean value used to set the kerning property of the text.

drawRotated

protected void drawRotated(PageWriter writer)
Draws the text area to the given PageWriter object.

Specified by:
drawRotated in class RotatingPageElement
Parameters:
writer - PageWriter object to receive the text area's output.
See Also:
PageWriter

getRequiredHeight

public float getRequiredHeight()
Returns the height required to fit all of the text supplied.

Returns:
The required height to display all text.

getTextHeight

public float getTextHeight()
Returns the height of the text that will be drawn.

Returns:
The height of visible text.

getOverflowText

public java.lang.String getOverflowText()
Returns the text remaining that will be clipped by the text area.

Returns:
The overflow text as a String.

getOverflowTextArea

public TextArea getOverflowTextArea()
Returns a TextArea object containing the overflow text. View Example

Returns:
a TextArea object.

getOverflowTextArea

public TextArea getOverflowTextArea(float x,
                                    float y)
Returns a TextArea object containing the overflow text. View Example

Parameters:
x - X coordinate of the new text area.
y - Y coordinate of the new text area.
Returns:
a TextArea object.

getOverflowTextArea

public TextArea getOverflowTextArea(float x,
                                    float y,
                                    float width,
                                    float height)
Returns a TextArea object containing the overflow text. View Example

Parameters:
x - X coordinate of the new text area.
y - Y coordinate of the new text area.
width - Width of the new text area.
height - Height of the new text area.
Returns:
a TextArea object.

hasOverflowText

public boolean hasOverflowText()
Returns a value indicating if there is text remaining that will not be drawn to the text area.

Returns:
boolean value indication whether or not overflow text exists.

getKerningValues

public KerningValues getKerningValues()
Get the Kerning values.

Returns:
the Kerning values.

getVisibleLineCount

public int getVisibleLineCount()

getLineTextWidth

public float getLineTextWidth(int lineIndex)

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.07 for Java generated on Aug 12, 2020
© Copyright 2020, ceTe Software