Class JRTemplateText
- All Implemented Interfaces:
Serializable,Deduplicable,TextFormat,JRBoxContainer,JRCommonElement,JRCommonText,JRFont,JRParagraphContainer,JRPropertiesHolder,JRStyleContainer,JRTextAlignment
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Floatprotected Stringprotected Booleanprotected Booleanprotected Booleanprotected Booleanprotected Booleanprotected JRLineBoxprotected Stringprotected JRParagraphprotected Stringprotected Stringprotected Stringprotected Stringprotected StringFields inherited from class net.sf.jasperreports.engine.fill.JRTemplateElement
defaultStyleProvider, origin, parentStyleFields inherited from interface net.sf.jasperreports.engine.JRCommonText
MARKUP_HTML, MARKUP_NONE, MARKUP_RTF, MARKUP_STYLED_TEXTFields inherited from interface net.sf.jasperreports.engine.JRFont
DEFAULT_FONT_NAME, DEFAULT_FONT_SIZE, DEFAULT_PDF_EMBEDDED, DEFAULT_PDF_ENCODING, DEFAULT_PDF_FONT_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionJRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider) Creates a template text.protectedJRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRStaticText staticText) protectedJRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRTextField textField) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyLineBox(JRLineBox box) Copies box attributes.voidcopyParagraph(JRParagraph prg) Copies paragraph attributes.floatintReturns a hash code to be used for the deduplicate map.Gets the text horizontal alignment.Retrieves the hyperlink target name for the element.Retrieves the hyperlink type for the element.Returns the hyperlink target name.Returns the hyperlink type.Returns the text markup.getMode()Returns the element transparency mode.Gets the text own rotation.Gets the text rotation.getStyle()Returns this object's style.Gets the text vertical alignment.booleanisBold()booleanisIdentical(Object object) Determines if this instance is identical to another object.booleanisItalic()booleanbooleanbooleanvoidvoidAlternative setBold method which allows also to reset the "own" isBold property.voidsetFontName(String fontName) voidsetFontSize(Float fontSize) Method which allows also to reset the "own" size property.voidsetFormatFactoryClass(String formatFactoryClass) voidsetHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign) Sets the text horizontal alignment.voidAlternative setItalic method which allows also to reset the "own" isItalic property.protected voidsetLinkTarget(String linkTarget) voidsetLinkType(String linkType) Sets the hyperlink type.voidsetLocaleCode(String localeCode) voidSets the text markup attribute.voidsetPattern(String pattern) voidsetPdfEmbedded(Boolean isPdfEmbedded) Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.voidsetPdfEncoding(String pdfEncoding) voidsetPdfFontName(String pdfFontName) voidsetRotation(RotationEnum rotation) Sets the text rotation.protected voidsetStaticText(JRStaticText staticText) voidsetStrikeThrough(Boolean isStrikeThrough) Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.protected voidsetTextElement(JRTextElement textElement) protected voidsetTextField(JRTextField textField) voidsetTextFormat(TextFormat textFormat) voidsetTimeZoneId(String timeZoneId) voidsetUnderline(Boolean isUnderline) Alternative setUnderline method which allows also to reset the "own" isUnderline property.voidsetValueClassName(String valueClassName) voidsetVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign) Gets the text vertical alignment.Methods inherited from class net.sf.jasperreports.engine.fill.JRTemplateElement
addTemplateHash, getBackcolor, getBaseStyle, getDefaultStyleProvider, getForecolor, getHeight, getId, getKey, getOrigin, getOwnBackcolor, getOwnForecolor, getOwnMode, getParentProperties, getPropertiesMap, getStyleNameReference, getStyleResolver, getWidth, hasProperties, setBackcolor, setElement, setForecolor, setKey, setMode, setStyle, templateIdenticalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getWidth, setBackcolor, setForecolor, setModeMethods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyleName, getStyleNameReference
-
Field Details
-
lineBox
-
paragraph
-
fontName
-
isBold
-
isItalic
-
isUnderline
-
isStrikeThrough
-
fontSize
-
pdfFontName
-
pdfEncoding
-
isPdfEmbedded
-
valueClassName
-
pattern
-
formatFactoryClass
-
localeCode
-
timeZoneId
-
-
Constructor Details
-
JRTemplateText
protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRStaticText staticText) -
JRTemplateText
protected JRTemplateText(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRTextField textField) -
JRTemplateText
Creates a template text.- Parameters:
origin- the origin of the elements that will use this templatedefaultStyleProvider- the default style provider to use for this template
-
-
Method Details
-
setStaticText
-
setTextField
-
setTextElement
-
setTextFormat
-
copyLineBox
Copies box attributes.- Parameters:
box- the object to copy attributes from
-
copyParagraph
Copies paragraph attributes.- Parameters:
prg- the object to copy attributes from
-
getMode
Description copied from interface:JRCommonElementReturns the element transparency mode. The default value depends on the type of the report element. Graphic elements like rectangles and lines are opaque by default, but the images are transparent. Both static texts and text fields are transparent by default, and so are the subreport elements.- Specified by:
getModein interfaceJRCommonElement- Overrides:
getModein classJRTemplateElement
-
getHorizontalTextAlign
Description copied from interface:JRTextAlignmentGets the text horizontal alignment.- Specified by:
getHorizontalTextAlignin interfaceJRTextAlignment- Returns:
- a value representing one of the horizontal text alignment constants in
HorizontalTextAlignEnum
-
getOwnHorizontalTextAlign
- Specified by:
getOwnHorizontalTextAlignin interfaceJRTextAlignment
-
setHorizontalTextAlign
Description copied from interface:JRTextAlignmentSets the text horizontal alignment.- Specified by:
setHorizontalTextAlignin interfaceJRTextAlignment- Parameters:
horizontalTextAlign- a value representing one of the horizontal text alignment constants inHorizontalTextAlignEnum
-
getVerticalTextAlign
Description copied from interface:JRTextAlignmentGets the text vertical alignment.- Specified by:
getVerticalTextAlignin interfaceJRTextAlignment- Returns:
- a value representing one of the vertical text alignment constants in
VerticalTextAlignEnum
-
getOwnVerticalTextAlign
- Specified by:
getOwnVerticalTextAlignin interfaceJRTextAlignment
-
setVerticalTextAlign
Description copied from interface:JRTextAlignmentGets the text vertical alignment.- Specified by:
setVerticalTextAlignin interfaceJRTextAlignment- Parameters:
verticalTextAlign- a value representing one of the vertical text alignment constants inVerticalTextAlignEnum
-
getRotation
Description copied from interface:JRCommonTextGets the text rotation.- Specified by:
getRotationin interfaceJRCommonText- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
getOwnRotation
Description copied from interface:JRCommonTextGets the text own rotation.- Specified by:
getOwnRotationin interfaceJRCommonText- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
setRotation
Sets the text rotation.- Specified by:
setRotationin interfaceJRCommonText- Parameters:
rotation- one of values, ornullif this template should not specify a rotation attribute of its own
-
getMarkup
Description copied from interface:JRCommonTextReturns the text markup.- Specified by:
getMarkupin interfaceJRCommonText
-
getOwnMarkup
- Specified by:
getOwnMarkupin interfaceJRCommonText
-
setMarkup
Sets the text markup attribute.- Specified by:
setMarkupin interfaceJRCommonText- Parameters:
markup- the markup attribute- See Also:
-
getLineBox
- Specified by:
getLineBoxin interfaceJRBoxContainer
-
getParagraph
- Specified by:
getParagraphin interfaceJRParagraphContainer
-
getHyperlinkType
Retrieves the hyperlink type for the element.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,CUSTOMis returned.- Returns:
- one of the hyperlink type constants
- See Also:
-
getHyperlinkTarget
Retrieves the hyperlink target name for the element.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,CUSTOMis returned.- Returns:
- one of the hyperlink target name constants
- See Also:
-
getFontName
- Specified by:
getFontNamein interfaceJRFont
-
getOwnFontName
- Specified by:
getOwnFontNamein interfaceJRFont
-
setFontName
- Specified by:
setFontNamein interfaceJRFont
-
isBold
public boolean isBold() -
isOwnBold
-
setBold
Alternative setBold method which allows also to reset the "own" isBold property. -
isItalic
public boolean isItalic() -
isOwnItalic
- Specified by:
isOwnItalicin interfaceJRFont
-
setItalic
Alternative setItalic method which allows also to reset the "own" isItalic property. -
isUnderline
public boolean isUnderline()- Specified by:
isUnderlinein interfaceJRFont
-
isOwnUnderline
- Specified by:
isOwnUnderlinein interfaceJRFont
-
setUnderline
Alternative setUnderline method which allows also to reset the "own" isUnderline property.- Specified by:
setUnderlinein interfaceJRFont
-
isStrikeThrough
public boolean isStrikeThrough()- Specified by:
isStrikeThroughin interfaceJRFont
-
isOwnStrikeThrough
- Specified by:
isOwnStrikeThroughin interfaceJRFont
-
setStrikeThrough
Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.- Specified by:
setStrikeThroughin interfaceJRFont
-
getFontSize
public float getFontSize()- Specified by:
getFontSizein interfaceJRCommonText- Specified by:
getFontSizein interfaceJRFont
-
getOwnFontSize
- Specified by:
getOwnFontSizein interfaceJRFont
-
setFontSize
Method which allows also to reset the "own" size property.- Specified by:
setFontSizein interfaceJRFont
-
getPdfFontName
- Specified by:
getPdfFontNamein interfaceJRFont
-
getOwnPdfFontName
- Specified by:
getOwnPdfFontNamein interfaceJRFont
-
setPdfFontName
- Specified by:
setPdfFontNamein interfaceJRFont
-
getPdfEncoding
- Specified by:
getPdfEncodingin interfaceJRFont
-
getOwnPdfEncoding
- Specified by:
getOwnPdfEncodingin interfaceJRFont
-
setPdfEncoding
- Specified by:
setPdfEncodingin interfaceJRFont
-
isPdfEmbedded
public boolean isPdfEmbedded()- Specified by:
isPdfEmbeddedin interfaceJRFont
-
isOwnPdfEmbedded
- Specified by:
isOwnPdfEmbeddedin interfaceJRFont
-
setPdfEmbedded
Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.- Specified by:
setPdfEmbeddedin interfaceJRFont
-
getStyle
Description copied from interface:JRStyleContainerReturns this object's style.- Specified by:
getStylein interfaceJRStyleContainer- Overrides:
getStylein classJRTemplateElement- Returns:
- this object's style
-
getPattern
- Specified by:
getPatternin interfaceTextFormat
-
setPattern
-
getValueClassName
- Specified by:
getValueClassNamein interfaceTextFormat
-
setValueClassName
-
getFormatFactoryClass
- Specified by:
getFormatFactoryClassin interfaceTextFormat
-
setFormatFactoryClass
-
getLocaleCode
- Specified by:
getLocaleCodein interfaceTextFormat
-
setLocaleCode
-
getTimeZoneId
- Specified by:
getTimeZoneIdin interfaceTextFormat
-
setTimeZoneId
-
getLinkType
Returns the hyperlink type.The type can be one of the built-in types (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage), or can be an arbitrary type.
- Returns:
- the hyperlink type
-
setLinkType
Sets the hyperlink type.The type can be one of the built-in types (Reference, LocalAnchor, LocalPage, RemoteAnchor, RemotePage), or can be an arbitrary type.
- Parameters:
linkType- the hyperlink type
-
setLinkTarget
-
getLinkTarget
Returns the hyperlink target name.The target name can be one of the built-in names (Self, Blank, Top, Parent), or can be an arbitrary name.
- Returns:
- the hyperlink type
-
getDefaultLineColor
- Specified by:
getDefaultLineColorin interfaceJRBoxContainer
-
getHashCode
public int getHashCode()Description copied from interface:DeduplicableReturns a hash code to be used for the deduplicate map. The returned hash code should be consitent wiwhDeduplicable.isIdentical(Object), i.e. if two objects are identical they should have the same hash code.- Specified by:
getHashCodein interfaceDeduplicable- Returns:
- deduplication hash code
-
isIdentical
Description copied from interface:DeduplicableDetermines if this instance is identical to another object.- Specified by:
isIdenticalin interfaceDeduplicable- Parameters:
object- the object to compare with this instance- Returns:
trueif the two objects are identical and can be deduplicated
-
populateStyle
public void populateStyle()- Overrides:
populateStylein classJRTemplateElement
-