Package net.sf.jasperreports.engine.base
Class JRBaseTextElement
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBaseElement
-
- net.sf.jasperreports.engine.base.JRBaseTextElement
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,JRChangeEventsSupport,JRBoxContainer,JRChild,JRCloneable,JRCommonElement,JRCommonText,JRElement,JRFont,JRIdentifiable,JRParagraphContainer,JRPropertiesHolder,JRStyleContainer,JRTextAlignment,JRTextElement,JRVisitable
- Direct Known Subclasses:
JRBaseStaticText,JRBaseTextField
public abstract class JRBaseTextElement extends JRBaseElement implements JRTextElement
This class provides functionality common to text elements. It provides implementation for the methods described in JRTextElement.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringfontNameprotected java.lang.Floatfontsizeprotected HorizontalTextAlignEnumhorizontalTextAlignprotected java.lang.BooleanisBoldprotected java.lang.BooleanisItalicprotected java.lang.BooleanisPdfEmbeddedprotected java.lang.BooleanisStrikeThroughprotected java.lang.BooleanisUnderlineprotected JRLineBoxlineBoxprotected java.lang.Stringmarkupprotected JRParagraphparagraphprotected java.lang.StringpdfEncodingprotected java.lang.StringpdfFontNameprotected RotationEnumrotationValueprotected VerticalTextAlignEnumverticalTextAlign-
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseElement
backcolor, defaultStyleProvider, elementGroup, forecolor, height, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, key, modeValue, parentStyle, parentStyleNameReference, positionTypeValue, printWhenExpression, printWhenGroupChanges, PROPERTY_POSITION_TYPE, PROPERTY_PRINT_IN_FIRST_WHOLE_BAND, PROPERTY_PRINT_REPEATED_VALUES, PROPERTY_PRINT_WHEN_DETAIL_OVERFLOWS, PROPERTY_REMOVE_LINE_WHEN_BLANK, PROPERTY_STRETCH_TYPE, PROPERTY_WIDTH, PROPERTY_X, stretchTypeValue, styleExpression, uuid, width, x, y
-
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.JRElement
PROPERTY_ELEMENT_TEMPLATE_POPULATE_STYLE
-
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
-
Fields inherited from interface net.sf.jasperreports.engine.JRTextElement
PROPERTY_PRINT_KEEP_FULL_TEXT, PROPERTY_SAVE_LINE_BREAKS, PROPERTY_TRUNCATE_AT_CHAR, PROPERTY_TRUNCATE_SUFFIX
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedJRBaseTextElement(JRTextElement textElement, JRBaseObjectFactory factory)Initializes properties that are specific to text elements.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Objectclone()java.awt.ColorgetDefaultLineColor()JRFontgetFont()Deprecated.java.lang.StringgetFontName()floatgetFontsize()HorizontalTextAlignEnumgetHorizontalTextAlign()Gets the text horizontal alignment.JRLineBoxgetLineBox()java.lang.StringgetMarkup()Returns the text markup.ModeEnumgetModeValue()Returns the element transparency mode.java.lang.StringgetOwnFontName()java.lang.FloatgetOwnFontsize()HorizontalTextAlignEnumgetOwnHorizontalTextAlign()java.lang.StringgetOwnMarkup()java.lang.StringgetOwnPdfEncoding()java.lang.StringgetOwnPdfFontName()RotationEnumgetOwnRotationValue()Gets the text own rotation.VerticalTextAlignEnumgetOwnVerticalTextAlign()JRParagraphgetParagraph()java.lang.StringgetPdfEncoding()java.lang.StringgetPdfFontName()RotationEnumgetRotationValue()Gets the text rotation.VerticalTextAlignEnumgetVerticalTextAlign()Gets the text vertical alignment.booleanisBold()booleanisItalic()java.lang.BooleanisOwnBold()java.lang.BooleanisOwnItalic()java.lang.BooleanisOwnPdfEmbedded()java.lang.BooleanisOwnStrikeThrough()java.lang.BooleanisOwnUnderline()booleanisPdfEmbedded()booleanisStrikeThrough()booleanisUnderline()voidsetBold(java.lang.Boolean isBold)Alternative setBold method which allows also to reset the "own" isBold property.voidsetFontName(java.lang.String fontName)voidsetFontSize(java.lang.Float fontSize)Method which allows also to reset the "own" size property.voidsetHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign)Sets the text horizontal alignment.voidsetItalic(java.lang.Boolean isItalic)Alternative setItalic method which allows also to reset the "own" isItalic property.voidsetMarkup(java.lang.String markup)voidsetPdfEmbedded(java.lang.Boolean isPdfEmbedded)Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.voidsetPdfEncoding(java.lang.String pdfEncoding)voidsetPdfFontName(java.lang.String pdfFontName)voidsetRotation(RotationEnum rotationValue)Sets the text rotation.voidsetStrikeThrough(java.lang.Boolean isStrikeThrough)Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.voidsetUnderline(java.lang.Boolean isUnderline)Alternative setUnderline method which allows also to reset the "own" isUnderline property.voidsetVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign)Gets the text vertical alignment.-
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseElement
clone, clone, getBackcolor, getBaseStyle, getDefaultStyleProvider, getElementGroup, getEventSupport, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getParentProperties, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getPropertyExpressions, getStretchTypeValue, getStyle, getStyleExpression, getStyleNameReference, getStyleResolver, getUUID, getWidth, getX, getY, hasProperties, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setUUID, setWidth, setX
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.jasperreports.engine.JRCommonElement
getBackcolor, getForecolor, getHeight, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getWidth, setBackcolor, setForecolor, setMode
-
Methods inherited from interface net.sf.jasperreports.engine.JRElement
clone, collectExpressions, getElementGroup, getKey, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchTypeValue, getStyleExpression, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
-
Methods inherited from interface net.sf.jasperreports.engine.JRIdentifiable
getUUID
-
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
-
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleNameReference
-
Methods inherited from interface net.sf.jasperreports.engine.JRVisitable
visit
-
-
-
-
Field Detail
-
horizontalTextAlign
protected HorizontalTextAlignEnum horizontalTextAlign
-
verticalTextAlign
protected VerticalTextAlignEnum verticalTextAlign
-
rotationValue
protected RotationEnum rotationValue
-
markup
protected java.lang.String markup
-
lineBox
protected JRLineBox lineBox
-
paragraph
protected JRParagraph paragraph
-
fontName
protected java.lang.String fontName
-
isBold
protected java.lang.Boolean isBold
-
isItalic
protected java.lang.Boolean isItalic
-
isUnderline
protected java.lang.Boolean isUnderline
-
isStrikeThrough
protected java.lang.Boolean isStrikeThrough
-
fontsize
protected java.lang.Float fontsize
-
pdfFontName
protected java.lang.String pdfFontName
-
pdfEncoding
protected java.lang.String pdfEncoding
-
isPdfEmbedded
protected java.lang.Boolean isPdfEmbedded
-
-
Constructor Detail
-
JRBaseTextElement
protected JRBaseTextElement(JRTextElement textElement, JRBaseObjectFactory factory)
Initializes properties that are specific to text elements. Common properties are initialized by its parent constructor.- Parameters:
textElement- an element whose properties are copied to this element. Usually it is aJRDesignTextElementthat must be transformed into an JRBaseTextElement at compile time.factory- a factory used in the compile process
-
-
Method Detail
-
getHorizontalTextAlign
public HorizontalTextAlignEnum 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
public HorizontalTextAlignEnum getOwnHorizontalTextAlign()
- Specified by:
getOwnHorizontalTextAlignin interfaceJRTextAlignment
-
setHorizontalTextAlign
public void setHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign)
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
public VerticalTextAlignEnum 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
public VerticalTextAlignEnum getOwnVerticalTextAlign()
- Specified by:
getOwnVerticalTextAlignin interfaceJRTextAlignment
-
setVerticalTextAlign
public void setVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign)
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
-
getRotationValue
public RotationEnum getRotationValue()
Description copied from interface:JRCommonTextGets the text rotation.- Specified by:
getRotationValuein interfaceJRCommonText- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
getOwnRotationValue
public RotationEnum getOwnRotationValue()
Description copied from interface:JRCommonTextGets the text own rotation.- Specified by:
getOwnRotationValuein interfaceJRCommonText- Returns:
- a value representing one of the text rotation constants in
RotationEnum
-
setRotation
public void setRotation(RotationEnum rotationValue)
Description copied from interface:JRCommonTextSets the text rotation.- Specified by:
setRotationin interfaceJRCommonText- Parameters:
rotationValue- a value representing one of the text rotation constants inRotationEnum
-
getMarkup
public java.lang.String getMarkup()
Description copied from interface:JRCommonTextReturns the text markup.- Specified by:
getMarkupin interfaceJRCommonText
-
getOwnMarkup
public java.lang.String getOwnMarkup()
- Specified by:
getOwnMarkupin interfaceJRCommonText
-
setMarkup
public void setMarkup(java.lang.String markup)
- Specified by:
setMarkupin interfaceJRCommonText
-
getLineBox
public JRLineBox getLineBox()
- Specified by:
getLineBoxin interfaceJRBoxContainer
-
getParagraph
public JRParagraph getParagraph()
- Specified by:
getParagraphin interfaceJRParagraphContainer
-
getFont
public JRFont getFont()
Deprecated.
-
getModeValue
public ModeEnum getModeValue()
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:
getModeValuein interfaceJRCommonElement- Overrides:
getModeValuein classJRBaseElement
-
getFontName
public java.lang.String getFontName()
- Specified by:
getFontNamein interfaceJRFont
-
getOwnFontName
public java.lang.String getOwnFontName()
- Specified by:
getOwnFontNamein interfaceJRFont
-
setFontName
public void setFontName(java.lang.String fontName)
- Specified by:
setFontNamein interfaceJRFont
-
setBold
public void setBold(java.lang.Boolean isBold)
Alternative setBold method which allows also to reset the "own" isBold property.
-
isOwnItalic
public java.lang.Boolean isOwnItalic()
- Specified by:
isOwnItalicin interfaceJRFont
-
setItalic
public void setItalic(java.lang.Boolean isItalic)
Alternative setItalic method which allows also to reset the "own" isItalic property.
-
isUnderline
public boolean isUnderline()
- Specified by:
isUnderlinein interfaceJRFont
-
isOwnUnderline
public java.lang.Boolean isOwnUnderline()
- Specified by:
isOwnUnderlinein interfaceJRFont
-
setUnderline
public void setUnderline(java.lang.Boolean isUnderline)
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
public java.lang.Boolean isOwnStrikeThrough()
- Specified by:
isOwnStrikeThroughin interfaceJRFont
-
setStrikeThrough
public void setStrikeThrough(java.lang.Boolean isStrikeThrough)
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
public java.lang.Float getOwnFontsize()
- Specified by:
getOwnFontsizein interfaceJRFont
-
setFontSize
public void setFontSize(java.lang.Float fontSize)
Method which allows also to reset the "own" size property.- Specified by:
setFontSizein interfaceJRFont
-
getPdfFontName
public java.lang.String getPdfFontName()
- Specified by:
getPdfFontNamein interfaceJRFont
-
getOwnPdfFontName
public java.lang.String getOwnPdfFontName()
- Specified by:
getOwnPdfFontNamein interfaceJRFont
-
setPdfFontName
public void setPdfFontName(java.lang.String pdfFontName)
- Specified by:
setPdfFontNamein interfaceJRFont
-
getPdfEncoding
public java.lang.String getPdfEncoding()
- Specified by:
getPdfEncodingin interfaceJRFont
-
getOwnPdfEncoding
public java.lang.String getOwnPdfEncoding()
- Specified by:
getOwnPdfEncodingin interfaceJRFont
-
setPdfEncoding
public void setPdfEncoding(java.lang.String pdfEncoding)
- Specified by:
setPdfEncodingin interfaceJRFont
-
isPdfEmbedded
public boolean isPdfEmbedded()
- Specified by:
isPdfEmbeddedin interfaceJRFont
-
isOwnPdfEmbedded
public java.lang.Boolean isOwnPdfEmbedded()
- Specified by:
isOwnPdfEmbeddedin interfaceJRFont
-
setPdfEmbedded
public void setPdfEmbedded(java.lang.Boolean isPdfEmbedded)
Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.- Specified by:
setPdfEmbeddedin interfaceJRFont
-
getDefaultLineColor
public java.awt.Color getDefaultLineColor()
- Specified by:
getDefaultLineColorin interfaceJRBoxContainer
-
clone
public java.lang.Object clone()
- Specified by:
clonein interfaceJRCloneable- Overrides:
clonein classJRBaseElement
-
-