public class JRTemplateText extends JRTemplateElement implements JRAlignment, JRTextAlignment, JRFont, JRCommonText, TextFormat
JRTemplatePrintText
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected String |
fontName |
protected Float |
fontsize |
protected String |
formatFactoryClass |
protected Boolean |
isBold |
protected Boolean |
isItalic |
protected Boolean |
isPdfEmbedded |
protected Boolean |
isStrikeThrough |
protected Boolean |
isUnderline |
protected JRLineBox |
lineBox |
protected String |
localeCode |
protected JRParagraph |
paragraph |
protected String |
pattern |
protected String |
pdfEncoding |
protected String |
pdfFontName |
protected String |
timeZoneId |
protected String |
valueClassName |
defaultStyleProvider, origin, parentStyle
DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_PDF_EMBEDDED, DEFAULT_PDF_ENCODING, DEFAULT_PDF_FONT_NAME
MARKUP_HTML, MARKUP_NONE, MARKUP_RTF, MARKUP_STYLED_TEXT
Modifier | Constructor and Description |
---|---|
|
JRTemplateText(JROrigin origin,
JRDefaultStyleProvider defaultStyleProvider)
Creates a template text.
|
protected |
JRTemplateText(JROrigin origin,
JRDefaultStyleProvider defaultStyleProvider,
JRStaticText staticText) |
protected |
JRTemplateText(JROrigin origin,
JRDefaultStyleProvider defaultStyleProvider,
JRTextField textField) |
Modifier and Type | Method and Description |
---|---|
void |
copyLineBox(JRLineBox box)
Copies box attributes.
|
void |
copyParagraph(JRParagraph prg)
Copies paragraph attributes.
|
Color |
getDefaultLineColor() |
JRFont |
getFont()
Deprecated.
|
String |
getFontName() |
float |
getFontsize() |
int |
getFontSize()
Deprecated.
Replaced by
getFontsize() . |
String |
getFormatFactoryClass() |
int |
getHashCode()
Returns a hash code to be used for the deduplicate map.
|
HorizontalAlignEnum |
getHorizontalAlignmentValue()
Deprecated.
Replaced by
getHorizontalTextAlign() . |
HorizontalTextAlignEnum |
getHorizontalTextAlign()
Gets the text horizontal alignment.
|
byte |
getHyperlinkTarget()
Deprecated.
|
HyperlinkTargetEnum |
getHyperlinkTargetValue()
Retrieves the hyperlink target name for the element.
|
HyperlinkTypeEnum |
getHyperlinkTypeValue()
Retrieves the hyperlink type for the element.
|
JRLineBox |
getLineBox() |
LineSpacingEnum |
getLineSpacingValue()
Deprecated.
Replaced by
JRParagraph.getLineSpacing() . |
String |
getLinkTarget()
Returns the hyperlink target name.
|
String |
getLinkType()
Returns the hyperlink type.
|
String |
getLocaleCode() |
String |
getMarkup()
Returns the text markup.
|
ModeEnum |
getModeValue()
Returns the element transparency mode.
|
String |
getOwnFontName() |
Float |
getOwnFontsize() |
Integer |
getOwnFontSize()
Deprecated.
Replaced by
getOwnFontsize() . |
HorizontalAlignEnum |
getOwnHorizontalAlignmentValue()
Deprecated.
Replaced by
getOwnHorizontalTextAlign() . |
HorizontalTextAlignEnum |
getOwnHorizontalTextAlign() |
LineSpacingEnum |
getOwnLineSpacingValue()
Deprecated.
Replaced by
JRParagraph.getOwnLineSpacing() . |
String |
getOwnMarkup() |
String |
getOwnPdfEncoding() |
String |
getOwnPdfFontName() |
RotationEnum |
getOwnRotationValue()
Gets the text own rotation.
|
VerticalAlignEnum |
getOwnVerticalAlignmentValue()
Deprecated.
Replaced by
getOwnVerticalTextAlign() . |
VerticalTextAlignEnum |
getOwnVerticalTextAlign() |
JRParagraph |
getParagraph() |
String |
getPattern() |
String |
getPdfEncoding() |
String |
getPdfFontName() |
RotationEnum |
getRotationValue()
Gets the text rotation.
|
JRStyle |
getStyle()
Returns this object's style.
|
String |
getTimeZoneId() |
String |
getValueClassName() |
VerticalAlignEnum |
getVerticalAlignmentValue()
Deprecated.
Replaced by
getVerticalTextAlign() . |
VerticalTextAlignEnum |
getVerticalTextAlign()
Gets the text vertical alignment.
|
boolean |
isBold() |
boolean |
isIdentical(Object object)
Determines if this instance is identical to another object.
|
boolean |
isItalic() |
Boolean |
isOwnBold() |
Boolean |
isOwnItalic() |
Boolean |
isOwnPdfEmbedded() |
Boolean |
isOwnStrikeThrough() |
Boolean |
isOwnUnderline() |
boolean |
isPdfEmbedded() |
boolean |
isStrikeThrough() |
boolean |
isUnderline() |
void |
setBold(boolean isBold) |
void |
setBold(Boolean isBold)
Alternative setBold method which allows also to reset
the "own" isBold property.
|
void |
setFontName(String fontName) |
void |
setFontSize(Float fontSize)
Method which allows also to reset the "own" size property.
|
void |
setFontSize(int fontSize)
Deprecated.
Replaced by
setFontSize(Float) . |
void |
setFontSize(Integer fontSize)
Deprecated.
Replaced by
setFontSize(Float) . |
void |
setFormatFactoryClass(String formatFactoryClass) |
void |
setHorizontalAlignment(HorizontalAlignEnum horizontalAlignmentValue)
Deprecated.
Replaced by
setHorizontalTextAlign(HorizontalTextAlignEnum) . |
void |
setHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign)
Sets the text horizontal alignment.
|
void |
setItalic(boolean isItalic) |
void |
setItalic(Boolean isItalic)
Alternative setItalic method which allows also to reset
the "own" isItalic property.
|
void |
setLineSpacing(LineSpacingEnum lineSpacing)
Deprecated.
Replaced by
JRParagraph.setLineSpacing(LineSpacingEnum) . |
protected void |
setLinkTarget(String linkTarget) |
void |
setLinkType(String linkType)
Sets the hyperlink type.
|
void |
setLocaleCode(String localeCode) |
void |
setMarkup(String markup)
Sets the text markup attribute.
|
void |
setPattern(String pattern) |
void |
setPdfEmbedded(boolean isPdfEmbedded) |
void |
setPdfEmbedded(Boolean isPdfEmbedded)
Alternative setPdfEmbedded method which allows also to reset
the "own" isPdfEmbedded property.
|
void |
setPdfEncoding(String pdfEncoding) |
void |
setPdfFontName(String pdfFontName) |
void |
setRotation(RotationEnum rotationValue)
Sets the text rotation.
|
protected void |
setStaticText(JRStaticText staticText) |
void |
setStrikeThrough(boolean isStrikeThrough) |
void |
setStrikeThrough(Boolean isStrikeThrough)
Alternative setStrikeThrough method which allows also to reset
the "own" isStrikeThrough property.
|
protected void |
setTextElement(JRTextElement textElement) |
protected void |
setTextField(JRTextField textField) |
void |
setTextFormat(TextFormat textFormat) |
void |
setTimeZoneId(String timeZoneId) |
void |
setUnderline(boolean isUnderline) |
void |
setUnderline(Boolean isUnderline)
Alternative setUnderline method which allows also to reset
the "own" isUnderline property.
|
void |
setValueClassName(String valueClassName) |
void |
setVerticalAlignment(VerticalAlignEnum verticalAlignmentValue)
Deprecated.
Replaced by
setVerticalTextAlign(VerticalTextAlignEnum) . |
void |
setVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign)
Gets the text vertical alignment.
|
addTemplateHash, getBackcolor, getBaseStyle, getDefaultStyleProvider, getForecolor, getHeight, getId, getKey, getOrigin, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getParentProperties, getPropertiesMap, getStyleNameReference, getStyleResolver, getWidth, hasProperties, setBackcolor, setElement, setForecolor, setKey, setMode, setStyle, templateIdentical
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBackcolor, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getWidth, setBackcolor, setForecolor, setMode
getDefaultStyleProvider, getStyleNameReference
protected JRLineBox lineBox
protected JRParagraph paragraph
protected String fontName
protected Boolean isBold
protected Boolean isItalic
protected Boolean isUnderline
protected Boolean isStrikeThrough
protected Float fontsize
protected String pdfFontName
protected String pdfEncoding
protected Boolean isPdfEmbedded
protected String valueClassName
protected String pattern
protected String formatFactoryClass
protected String localeCode
protected String timeZoneId
protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRStaticText staticText)
protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRTextField textField)
public JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider)
origin
- the origin of the elements that will use this templatedefaultStyleProvider
- the default style provider to use for
this templateprotected void setStaticText(JRStaticText staticText)
protected void setTextField(JRTextField textField)
protected void setTextElement(JRTextElement textElement)
public void setTextFormat(TextFormat textFormat)
public void copyLineBox(JRLineBox box)
box
- the object to copy attributes frompublic void copyParagraph(JRParagraph prg)
prg
- the object to copy attributes frompublic ModeEnum getModeValue()
JRCommonElement
getModeValue
in interface JRCommonElement
getModeValue
in class JRTemplateElement
public HorizontalAlignEnum getHorizontalAlignmentValue()
getHorizontalTextAlign()
.JRAlignment
getHorizontalAlignmentValue
in interface JRAlignment
HorizontalAlignEnum
public HorizontalAlignEnum getOwnHorizontalAlignmentValue()
getOwnHorizontalTextAlign()
.getOwnHorizontalAlignmentValue
in interface JRAlignment
public void setHorizontalAlignment(HorizontalAlignEnum horizontalAlignmentValue)
setHorizontalTextAlign(HorizontalTextAlignEnum)
.JRAlignment
setHorizontalAlignment
in interface JRAlignment
horizontalAlignmentValue
- a value representing one of the horizontal alignment constants in HorizontalAlignEnum
public VerticalAlignEnum getVerticalAlignmentValue()
getVerticalTextAlign()
.JRAlignment
getVerticalAlignmentValue
in interface JRAlignment
VerticalAlignEnum
public VerticalAlignEnum getOwnVerticalAlignmentValue()
getOwnVerticalTextAlign()
.getOwnVerticalAlignmentValue
in interface JRAlignment
public void setVerticalAlignment(VerticalAlignEnum verticalAlignmentValue)
setVerticalTextAlign(VerticalTextAlignEnum)
.JRAlignment
setVerticalAlignment
in interface JRAlignment
verticalAlignmentValue
- a value representing one of the vertical alignment constants in VerticalAlignEnum
public HorizontalTextAlignEnum getHorizontalTextAlign()
JRTextAlignment
getHorizontalTextAlign
in interface JRTextAlignment
HorizontalTextAlignEnum
public HorizontalTextAlignEnum getOwnHorizontalTextAlign()
getOwnHorizontalTextAlign
in interface JRTextAlignment
public void setHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign)
JRTextAlignment
setHorizontalTextAlign
in interface JRTextAlignment
horizontalTextAlign
- a value representing one of the horizontal text alignment constants in HorizontalTextAlignEnum
public VerticalTextAlignEnum getVerticalTextAlign()
JRTextAlignment
getVerticalTextAlign
in interface JRTextAlignment
VerticalTextAlignEnum
public VerticalTextAlignEnum getOwnVerticalTextAlign()
getOwnVerticalTextAlign
in interface JRTextAlignment
public void setVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign)
JRTextAlignment
setVerticalTextAlign
in interface JRTextAlignment
verticalTextAlign
- a value representing one of the vertical text alignment constants in VerticalTextAlignEnum
public RotationEnum getRotationValue()
JRCommonText
getRotationValue
in interface JRCommonText
RotationEnum
public RotationEnum getOwnRotationValue()
JRCommonText
getOwnRotationValue
in interface JRCommonText
RotationEnum
public void setRotation(RotationEnum rotationValue)
setRotation
in interface JRCommonText
rotationValue
- one of
values, or null
if this template
should not specify a rotation attribute of its ownpublic LineSpacingEnum getLineSpacingValue()
JRParagraph.getLineSpacing()
.getLineSpacingValue
in interface JRCommonText
public LineSpacingEnum getOwnLineSpacingValue()
JRParagraph.getOwnLineSpacing()
.getOwnLineSpacingValue
in interface JRCommonText
public void setLineSpacing(LineSpacingEnum lineSpacing)
JRParagraph.setLineSpacing(LineSpacingEnum)
.setLineSpacing
in interface JRCommonText
public String getMarkup()
JRCommonText
getMarkup
in interface JRCommonText
public String getOwnMarkup()
getOwnMarkup
in interface JRCommonText
public void setMarkup(String markup)
setMarkup
in interface JRCommonText
markup
- the markup attributegetMarkup()
public JRLineBox getLineBox()
getLineBox
in interface JRBoxContainer
public JRParagraph getParagraph()
getParagraph
in interface JRParagraphContainer
public JRFont getFont()
public HyperlinkTypeEnum getHyperlinkTypeValue()
The actual hyperlink type is determined by getLinkType()
.
This method can is used to determine whether the hyperlink type is one of the
built-in types or a custom type.
O * When hyperlink is of custom type, CUSTOM
is returned.
getLinkType()
public byte getHyperlinkTarget()
public HyperlinkTargetEnum getHyperlinkTargetValue()
The actual hyperlink target name is determined by getLinkTarget()
.
This method is used to determine whether the hyperlink target name is one of the
built-in names or a custom one.
When hyperlink target has a custom name, CUSTOM
is returned.
getLinkTarget()
public String getFontName()
getFontName
in interface JRFont
public String getOwnFontName()
getOwnFontName
in interface JRFont
public void setFontName(String fontName)
setFontName
in interface JRFont
public void setBold(Boolean isBold)
public Boolean isOwnItalic()
isOwnItalic
in interface JRFont
public void setItalic(Boolean isItalic)
public boolean isUnderline()
isUnderline
in interface JRFont
public Boolean isOwnUnderline()
isOwnUnderline
in interface JRFont
public void setUnderline(boolean isUnderline)
setUnderline
in interface JRFont
public void setUnderline(Boolean isUnderline)
setUnderline
in interface JRFont
public boolean isStrikeThrough()
isStrikeThrough
in interface JRFont
public Boolean isOwnStrikeThrough()
isOwnStrikeThrough
in interface JRFont
public void setStrikeThrough(boolean isStrikeThrough)
setStrikeThrough
in interface JRFont
public void setStrikeThrough(Boolean isStrikeThrough)
setStrikeThrough
in interface JRFont
public float getFontsize()
getFontsize
in interface JRCommonText
getFontsize
in interface JRFont
public Float getOwnFontsize()
getOwnFontsize
in interface JRFont
public void setFontSize(Float fontSize)
setFontSize
in interface JRFont
public int getFontSize()
getFontsize()
.getFontSize
in interface JRCommonText
getFontSize
in interface JRFont
public Integer getOwnFontSize()
getOwnFontsize()
.getOwnFontSize
in interface JRFont
public void setFontSize(int fontSize)
setFontSize(Float)
.setFontSize
in interface JRFont
public void setFontSize(Integer fontSize)
setFontSize(Float)
.setFontSize
in interface JRFont
public String getPdfFontName()
getPdfFontName
in interface JRFont
public String getOwnPdfFontName()
getOwnPdfFontName
in interface JRFont
public void setPdfFontName(String pdfFontName)
setPdfFontName
in interface JRFont
public String getPdfEncoding()
getPdfEncoding
in interface JRFont
public String getOwnPdfEncoding()
getOwnPdfEncoding
in interface JRFont
public void setPdfEncoding(String pdfEncoding)
setPdfEncoding
in interface JRFont
public boolean isPdfEmbedded()
isPdfEmbedded
in interface JRFont
public Boolean isOwnPdfEmbedded()
isOwnPdfEmbedded
in interface JRFont
public void setPdfEmbedded(boolean isPdfEmbedded)
setPdfEmbedded
in interface JRFont
public void setPdfEmbedded(Boolean isPdfEmbedded)
setPdfEmbedded
in interface JRFont
public JRStyle getStyle()
JRStyleContainer
getStyle
in interface JRStyleContainer
getStyle
in class JRTemplateElement
public String getPattern()
getPattern
in interface TextFormat
public void setPattern(String pattern)
public String getValueClassName()
getValueClassName
in interface TextFormat
public void setValueClassName(String valueClassName)
public String getFormatFactoryClass()
getFormatFactoryClass
in interface TextFormat
public void setFormatFactoryClass(String formatFactoryClass)
public String getLocaleCode()
getLocaleCode
in interface TextFormat
public void setLocaleCode(String localeCode)
public String getTimeZoneId()
getTimeZoneId
in interface TextFormat
public void setTimeZoneId(String timeZoneId)
public String getLinkType()
The type can be one of the built-in types (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage), or can be an arbitrary type.
public void setLinkType(String linkType)
The type can be one of the built-in types (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage), or can be an arbitrary type.
linkType
- the hyperlink typeprotected void setLinkTarget(String linkTarget)
public String getLinkTarget()
The target name can be one of the built-in names (Self, Blank, Top, Parent), or can be an arbitrary name.
public Color getDefaultLineColor()
getDefaultLineColor
in interface JRBoxContainer
public int getHashCode()
Deduplicable
Deduplicable.isIdentical(Object)
,
i.e. if two objects are identical they should have the same hash code.getHashCode
in interface Deduplicable
public boolean isIdentical(Object object)
Deduplicable
isIdentical
in interface Deduplicable
object
- the object to compare with this instancetrue
if the two objects are identical and can be deduplicatedCopyright © 2016. All rights reserved.