public interface JRPrintText extends JRPrintElement, JRAlignment, JRTextAlignment, JRPrintAnchor, JRPrintHyperlink, JRFont, JRCommonText, TextFormat
| Modifier and Type | Field and Description |
|---|---|
static short[] |
ZERO_LINE_BREAK_OFFSETS
Zero-length line break offset array used for
getLineBreakOffsets()
when the text does not have any line breaks. |
UNSET_PRINT_ELEMENT_ID, UNSET_SOURCE_ELEMENT_IDPROPERTY_IGNORE_HYPERLINK_SUFFIXDEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_PDF_EMBEDDED, DEFAULT_PDF_ENCODING, DEFAULT_PDF_FONT_NAMEMARKUP_HTML, MARKUP_NONE, MARKUP_RTF, MARKUP_STYLED_TEXT| Modifier and Type | Method and Description |
|---|---|
String |
getFormatFactoryClass()
Returns the name of the class implementing the
FormatFactory
interface to use with this text element, in case it is not the same as the one for the overall document. |
JRStyledText |
getFullStyledText(JRStyledTextAttributeSelector attributeSelector)
Returns the full styled text of this object.
|
String |
getFullText()
Returns the full (not truncated) text of this object.
|
float |
getLeadingOffset() |
short[] |
getLineBreakOffsets()
Returns the line break offsets for the text if saved during report fill.
|
float |
getLineSpacingFactor() |
String |
getLocaleCode()
Returns the code of the
java.util.Locale which was used
while formatting the source value of the text. |
String |
getOriginalText()
Returns the original text that was set in this object.
|
LineSpacingEnum |
getOwnLineSpacingValue()
Deprecated.
Replaced by
JRParagraph.getOwnLineSpacing(). |
String |
getOwnMarkup() |
RotationEnum |
getOwnRotationValue()
Gets the text own rotation.
|
String |
getPattern()
Returns the pattern used to format a value that was the source of this text.
|
RunDirectionEnum |
getRunDirectionValue()
Gets the text run direction.
|
float |
getTextHeight() |
Integer |
getTextTruncateIndex()
Returns the index to which this object's text is to be truncated.
|
String |
getTextTruncateSuffix()
Returns the suffix that is to be appended to the truncated text
(as returned by
JRStyledTextUtil.getTruncatedText(JRPrintText). |
String |
getTimeZoneId()
Returns the
ID of the java.util.TimeZone
used to format this text's date source value. |
Object |
getValue() |
String |
getValueClassName()
Returns the type of the value which was used to generate this text.
|
void |
setLeadingOffset(float leadingOffset) |
void |
setLineBreakOffsets(short[] lineBreakOffsets)
Sets the line break offsets for the text.
|
void |
setLineSpacing(LineSpacingEnum lineSpacing)
Deprecated.
Replaced by
JRParagraph.setLineSpacing(LineSpacingEnum). |
void |
setLineSpacingFactor(float lineSpacingFactor) |
void |
setMarkup(String markup) |
void |
setRotation(RotationEnum rotationEnum)
Sets the text rotation.
|
void |
setRunDirection(RunDirectionEnum runDirectionEnum)
Sets the text run direction.
|
void |
setText(String text)
Set the text for this object.
|
void |
setTextFormat(TextFormat textFormat) |
void |
setTextHeight(float textHeight) |
void |
setTextTruncateIndex(Integer index)
Sets the index to which this object's text is to be truncated.
|
void |
setTextTruncateSuffix(String suffix)
Sets the suffix to be appended to the truncated text.
|
void |
setValue(Object value) |
accept, getHeight, getKey, getOrigin, getPrintElementId, getSourceElementId, getWidth, getX, getY, setHeight, setStyle, setUUID, setWidth, setX, setYgetParentProperties, getPropertiesMap, hasPropertiesgetUUIDgetHorizontalAlignmentValue, getOwnHorizontalAlignmentValue, getOwnVerticalAlignmentValue, getVerticalAlignmentValue, setHorizontalAlignment, setVerticalAlignmentgetHorizontalTextAlign, getOwnHorizontalTextAlign, getOwnVerticalTextAlign, getVerticalTextAlign, setHorizontalTextAlign, setVerticalTextAligngetAnchorName, getBookmarkLevel, setAnchorName, setBookmarkLevelgetHyperlinkAnchor, getHyperlinkPage, getHyperlinkParameters, getHyperlinkReference, getHyperlinkTargetValue, getHyperlinkTooltip, getHyperlinkTypeValue, getLinkTarget, getLinkType, setHyperlinkAnchor, setHyperlinkPage, setHyperlinkParameters, setHyperlinkReference, setHyperlinkTarget, setHyperlinkTooltip, setHyperlinkType, setLinkTarget, setLinkTypegetFontName, getFontsize, getFontSize, getOwnFontName, getOwnFontsize, getOwnFontSize, getOwnPdfEncoding, getOwnPdfFontName, getPdfEncoding, getPdfFontName, isBold, isItalic, isOwnBold, isOwnItalic, isOwnPdfEmbedded, isOwnStrikeThrough, isOwnUnderline, isPdfEmbedded, isStrikeThrough, isUnderline, setBold, setBold, setFontName, setFontSize, setFontSize, setFontSize, setItalic, setItalic, setPdfEmbedded, setPdfEmbedded, setPdfEncoding, setPdfFontName, setStrikeThrough, setStrikeThrough, setUnderline, setUnderlinegetFontsize, getFontSize, getLineSpacingValue, getMarkup, getRotationValuegetBackcolor, getForecolor, getModeValue, getOwnBackcolor, getOwnForecolor, getOwnModeValue, setBackcolor, setForecolor, setModegetDefaultLineColor, getLineBoxgetParagraphgetDefaultStyleProvider, getStyle, getStyleNameReferencestatic final short[] ZERO_LINE_BREAK_OFFSETS
getLineBreakOffsets()
when the text does not have any line breaks.void setText(String text)
text - the textsetTextTruncateIndex(Integer)Object getValue()
void setValue(Object value)
Integer getTextTruncateIndex()
JRTextElement.PROPERTY_PRINT_KEEP_FULL_TEXT,
getTextTruncateSuffix()void setTextTruncateIndex(Integer index)
JRStyledTextUtil.getTruncatedText(JRPrintText) or getFullStyledText(JRStyledTextAttributeSelector)
are called.index - the index to which this object's text is to be truncatedString getTextTruncateSuffix()
JRStyledTextUtil.getTruncatedText(JRPrintText).JRTextElement.PROPERTY_TRUNCATE_SUFFIXvoid setTextTruncateSuffix(String suffix)
suffix - the suffix to be appended to the truncated textgetTextTruncateSuffix()String getFullText()
JRStyledTextUtil.getTruncatedText(JRPrintText),
getTextTruncateIndex()String getOriginalText()
JRStyledText getFullStyledText(JRStyledTextAttributeSelector attributeSelector)
attributeSelector - the styled text attribute selectorgetFullText()void setTextFormat(TextFormat textFormat)
float getLineSpacingFactor()
void setLineSpacingFactor(float lineSpacingFactor)
float getLeadingOffset()
void setLeadingOffset(float leadingOffset)
RotationEnum getOwnRotationValue()
getOwnRotationValue in interface JRCommonTextRotationEnumvoid setRotation(RotationEnum rotationEnum)
setRotation in interface JRCommonTextrotationEnum - a value representing one of the text rotation constants in RotationEnumRunDirectionEnum getRunDirectionValue()
RunDirectionEnumvoid setRunDirection(RunDirectionEnum runDirectionEnum)
runDirectionEnum - a value representing one of the text run direction constants in RunDirectionEnumfloat getTextHeight()
void setTextHeight(float textHeight)
LineSpacingEnum getOwnLineSpacingValue()
JRParagraph.getOwnLineSpacing().getOwnLineSpacingValue in interface JRCommonTextvoid setLineSpacing(LineSpacingEnum lineSpacing)
JRParagraph.setLineSpacing(LineSpacingEnum).setLineSpacing in interface JRCommonTextString getOwnMarkup()
getOwnMarkup in interface JRCommonTextvoid setMarkup(String markup)
setMarkup in interface JRCommonTextString getValueClassName()
Text fields that have a non-String expression
save the value type using this attribute. This information can be used by
exporters to treat numerical or date texts (for instance) in a special manner.
getValueClassName in interface TextFormatString getPattern()
The pattern can be used to parse the text back to its source value.
getPattern in interface TextFormatgetValueClassName()String getFormatFactoryClass()
FormatFactory
interface to use with this text element, in case it is not the same as the one for the overall document.getFormatFactoryClass in interface TextFormatString getLocaleCode()
java.util.Locale which was used
while formatting the source value of the text.
The code is created using the java.util.Locale.toString()
convention.
When this attribute is null, the locale returned by
JasperPrint.getLocaleCode() is used.
This way, the locale is specified in a single place when all the (or many ) texts from a print object
were formatted using the same locale.
getLocaleCode in interface TextFormatjava.util.Locale used when formatting this text's source valueString getTimeZoneId()
ID of the java.util.TimeZone
used to format this text's date source value.
When this attribute is null, the time zone returned by
JasperPrint.getTimeZoneId() is used.
getTimeZoneId in interface TextFormatID of the java.util.TimeZone
used to format this text's date source valueshort[] getLineBreakOffsets()
The array of offsets is incremental, each offset adds to the
previous value. I.e. the positions at which line breaks occur
are offset[0], offset[0] + offset[1],
offset[0] + offset[1] + offset[2] and so on.
This array does not include positions for explicit line breaks in the text, i.e. for line breaks that occur due to new line characters in the text. The array only includes line break positions within a paragraph in the text.
If the text was meant to have saved line break offsets but no (non
explicit) breaks were detected (e.g. if the text is a single line),
this method will return a zero-length array. If the text was not meant
to include saved line breaks, the method will return null.
null if no line break positions were saved during the fillJRTextElement.PROPERTY_SAVE_LINE_BREAKSvoid setLineBreakOffsets(short[] lineBreakOffsets)
lineBreakOffsets - the line break offsetsgetLineBreakOffsets()Copyright © 2017. All rights reserved.