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 String
protected Float
protected String
protected Boolean
protected Boolean
protected Boolean
protected Boolean
protected Boolean
protected JRLineBox
protected String
protected JRParagraph
protected String
protected String
protected String
protected String
protected String
Fields inherited from class net.sf.jasperreports.engine.fill.JRTemplateElement
defaultStyleProvider, origin, parentStyle
Fields inherited from interface net.sf.jasperreports.engine.JRCommonText
MARKUP_HTML, MARKUP_NONE, MARKUP_RTF, MARKUP_STYLED_TEXT
Fields 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.protected
JRTemplateText
(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRStaticText staticText) protected
JRTemplateText
(JROrigin origin, JRDefaultStyleProvider defaultStyleProvider, JRTextField textField) -
Method Summary
Modifier and TypeMethodDescriptionvoid
copyLineBox
(JRLineBox box) Copies box attributes.void
copyParagraph
(JRParagraph prg) Copies paragraph attributes.float
int
Returns 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.boolean
isBold()
boolean
isIdentical
(Object object) Determines if this instance is identical to another object.boolean
isItalic()
boolean
boolean
boolean
void
void
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
setFormatFactoryClass
(String formatFactoryClass) void
setHorizontalTextAlign
(HorizontalTextAlignEnum horizontalTextAlign) Sets the text horizontal alignment.void
Alternative setItalic method which allows also to reset the "own" isItalic property.protected void
setLinkTarget
(String linkTarget) void
setLinkType
(String linkType) Sets the hyperlink type.void
setLocaleCode
(String localeCode) void
Sets the text markup attribute.void
setPattern
(String pattern) 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 rotation) Sets the text rotation.protected void
setStaticText
(JRStaticText staticText) 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) Alternative setUnderline method which allows also to reset the "own" isUnderline property.void
setValueClassName
(String valueClassName) void
setVerticalTextAlign
(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, templateIdentical
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getWidth, setBackcolor, setForecolor, setMode
Methods 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:JRCommonElement
Returns 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:
getMode
in interfaceJRCommonElement
- Overrides:
getMode
in classJRTemplateElement
-
getHorizontalTextAlign
Description copied from interface:JRTextAlignment
Gets the text horizontal alignment.- Specified by:
getHorizontalTextAlign
in interfaceJRTextAlignment
- Returns:
- a value representing one of the horizontal text alignment constants in
HorizontalTextAlignEnum
-
getOwnHorizontalTextAlign
- Specified by:
getOwnHorizontalTextAlign
in interfaceJRTextAlignment
-
setHorizontalTextAlign
Description copied from interface:JRTextAlignment
Sets the text horizontal alignment.- Specified by:
setHorizontalTextAlign
in interfaceJRTextAlignment
- Parameters:
horizontalTextAlign
- a value representing one of the horizontal text alignment constants inHorizontalTextAlignEnum
-
getVerticalTextAlign
Description copied from interface:JRTextAlignment
Gets the text vertical alignment.- Specified by:
getVerticalTextAlign
in interfaceJRTextAlignment
- Returns:
- a value representing one of the vertical text alignment constants in
VerticalTextAlignEnum
-
getOwnVerticalTextAlign
- Specified by:
getOwnVerticalTextAlign
in interfaceJRTextAlignment
-
setVerticalTextAlign
Description copied from interface:JRTextAlignment
Gets the text vertical alignment.- Specified by:
setVerticalTextAlign
in interfaceJRTextAlignment
- Parameters:
verticalTextAlign
- a value representing one of the vertical text alignment constants inVerticalTextAlignEnum
-
getRotation
Description copied from interface:JRCommonText
Gets the text rotation.- Specified by:
getRotation
in interfaceJRCommonText
- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
getOwnRotation
Description copied from interface:JRCommonText
Gets the text own rotation.- Specified by:
getOwnRotation
in interfaceJRCommonText
- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
setRotation
Sets the text rotation.- Specified by:
setRotation
in interfaceJRCommonText
- Parameters:
rotation
- one of values, ornull
if this template should not specify a rotation attribute of its own
-
getMarkup
Description copied from interface:JRCommonText
Returns the text markup.- Specified by:
getMarkup
in interfaceJRCommonText
-
getOwnMarkup
- Specified by:
getOwnMarkup
in interfaceJRCommonText
-
setMarkup
Sets the text markup attribute.- Specified by:
setMarkup
in interfaceJRCommonText
- Parameters:
markup
- the markup attribute- See Also:
-
getLineBox
- Specified by:
getLineBox
in interfaceJRBoxContainer
-
getParagraph
- Specified by:
getParagraph
in 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,CUSTOM
is 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,CUSTOM
is returned.- Returns:
- one of the hyperlink target name constants
- See Also:
-
getFontName
- Specified by:
getFontName
in interfaceJRFont
-
getOwnFontName
- Specified by:
getOwnFontName
in interfaceJRFont
-
setFontName
- Specified by:
setFontName
in 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:
isOwnItalic
in interfaceJRFont
-
setItalic
Alternative setItalic method which allows also to reset the "own" isItalic property. -
isUnderline
public boolean isUnderline()- Specified by:
isUnderline
in interfaceJRFont
-
isOwnUnderline
- Specified by:
isOwnUnderline
in interfaceJRFont
-
setUnderline
Alternative setUnderline method which allows also to reset the "own" isUnderline property.- Specified by:
setUnderline
in interfaceJRFont
-
isStrikeThrough
public boolean isStrikeThrough()- Specified by:
isStrikeThrough
in interfaceJRFont
-
isOwnStrikeThrough
- Specified by:
isOwnStrikeThrough
in interfaceJRFont
-
setStrikeThrough
Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.- Specified by:
setStrikeThrough
in interfaceJRFont
-
getFontSize
public float getFontSize()- Specified by:
getFontSize
in interfaceJRCommonText
- Specified by:
getFontSize
in interfaceJRFont
-
getOwnFontSize
- Specified by:
getOwnFontSize
in interfaceJRFont
-
setFontSize
Method which allows also to reset the "own" size property.- Specified by:
setFontSize
in interfaceJRFont
-
getPdfFontName
- Specified by:
getPdfFontName
in interfaceJRFont
-
getOwnPdfFontName
- Specified by:
getOwnPdfFontName
in interfaceJRFont
-
setPdfFontName
- Specified by:
setPdfFontName
in interfaceJRFont
-
getPdfEncoding
- Specified by:
getPdfEncoding
in interfaceJRFont
-
getOwnPdfEncoding
- Specified by:
getOwnPdfEncoding
in interfaceJRFont
-
setPdfEncoding
- Specified by:
setPdfEncoding
in interfaceJRFont
-
isPdfEmbedded
public boolean isPdfEmbedded()- Specified by:
isPdfEmbedded
in interfaceJRFont
-
isOwnPdfEmbedded
- Specified by:
isOwnPdfEmbedded
in interfaceJRFont
-
setPdfEmbedded
Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.- Specified by:
setPdfEmbedded
in interfaceJRFont
-
getStyle
Description copied from interface:JRStyleContainer
Returns this object's style.- Specified by:
getStyle
in interfaceJRStyleContainer
- Overrides:
getStyle
in classJRTemplateElement
- Returns:
- this object's style
-
getPattern
- Specified by:
getPattern
in interfaceTextFormat
-
setPattern
-
getValueClassName
- Specified by:
getValueClassName
in interfaceTextFormat
-
setValueClassName
-
getFormatFactoryClass
- Specified by:
getFormatFactoryClass
in interfaceTextFormat
-
setFormatFactoryClass
-
getLocaleCode
- Specified by:
getLocaleCode
in interfaceTextFormat
-
setLocaleCode
-
getTimeZoneId
- Specified by:
getTimeZoneId
in 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:
getDefaultLineColor
in interfaceJRBoxContainer
-
getHashCode
public int getHashCode()Description copied from interface:Deduplicable
Returns 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:
getHashCode
in interfaceDeduplicable
- Returns:
- deduplication hash code
-
isIdentical
Description copied from interface:Deduplicable
Determines if this instance is identical to another object.- Specified by:
isIdentical
in interfaceDeduplicable
- Parameters:
object
- the object to compare with this instance- Returns:
true
if the two objects are identical and can be deduplicated
-
populateStyle
public void populateStyle()- Overrides:
populateStyle
in classJRTemplateElement
-