Class JRDesignTextElement
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBaseElement
-
- net.sf.jasperreports.engine.design.JRDesignElement
-
- net.sf.jasperreports.engine.design.JRDesignTextElement
-
- All Implemented Interfaces:
Serializable
,Cloneable
,JRChangeEventsSupport
,JRBoxContainer
,JRChild
,JRCloneable
,JRCommonElement
,JRCommonText
,JRElement
,JRFont
,JRIdentifiable
,JRParagraphContainer
,JRPropertiesHolder
,JRStyleContainer
,JRTextAlignment
,JRTextElement
,JRVisitable
- Direct Known Subclasses:
JRDesignStaticText
,JRDesignTextField
public abstract class JRDesignTextElement extends JRDesignElement implements JRTextElement
This class provides functionality common to design text elements. It provides implementation for the methods described in JRTextElement and setters for text element attributes that can only be modified at design time.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String
fontName
protected Float
fontSize
protected HorizontalTextAlignEnum
horizontalTextAlign
protected Boolean
isBold
protected Boolean
isItalic
protected Boolean
isPdfEmbedded
protected Boolean
isStrikeThrough
protected Boolean
isUnderline
protected JRLineBox
lineBox
protected String
markup
protected JRParagraph
paragraph
protected String
pdfEncoding
protected String
pdfFontName
protected RotationEnum
rotation
protected VerticalTextAlignEnum
verticalTextAlign
-
Fields inherited from class net.sf.jasperreports.engine.design.JRDesignElement
PROPERTY_ELEMENT_GROUP, PROPERTY_HEIGHT, PROPERTY_KEY, PROPERTY_PARENT_STYLE, PROPERTY_PARENT_STYLE_NAME_REFERENCE, PROPERTY_PRINT_WHEN_EXPRESSION, PROPERTY_PRINT_WHEN_GROUP_CHANGES, PROPERTY_PROPERTY_EXPRESSIONS, PROPERTY_STYLE_EXPRESSION, PROPERTY_Y
-
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseElement
backcolor, defaultStyleProvider, elementGroup, forecolor, height, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, key, mode, parentStyle, parentStyleNameReference, positionType, 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, stretchType, 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 protected
JRDesignTextElement(JRDefaultStyleProvider defaultStyleProvider)
Creates a new text element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Color
getDefaultLineColor()
String
getFontName()
float
getFontSize()
HorizontalTextAlignEnum
getHorizontalTextAlign()
Gets the text horizontal alignment.JRLineBox
getLineBox()
String
getMarkup()
Returns the text markup.ModeEnum
getMode()
Returns the element transparency mode.String
getOwnFontName()
Float
getOwnFontSize()
HorizontalTextAlignEnum
getOwnHorizontalTextAlign()
String
getOwnMarkup()
String
getOwnPdfEncoding()
String
getOwnPdfFontName()
RotationEnum
getOwnRotation()
Gets the text own rotation.VerticalTextAlignEnum
getOwnVerticalTextAlign()
JRParagraph
getParagraph()
String
getPdfEncoding()
String
getPdfFontName()
RotationEnum
getRotation()
Gets the text rotation.VerticalTextAlignEnum
getVerticalTextAlign()
Gets the text vertical alignment.boolean
isBold()
boolean
isItalic()
Boolean
isOwnBold()
Boolean
isOwnItalic()
Boolean
isOwnPdfEmbedded()
Boolean
isOwnStrikeThrough()
Boolean
isOwnUnderline()
boolean
isPdfEmbedded()
boolean
isStrikeThrough()
boolean
isUnderline()
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
setHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign)
Sets the text horizontal alignment.void
setItalic(Boolean isItalic)
Alternative setItalic method which allows also to reset the "own" isItalic property.void
setMarkup(String markup)
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.void
setStrikeThrough(Boolean isStrikeThrough)
Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.void
setUnderline(Boolean isUnderline)
Alternative setUnderline method which allows also to reset the "own" isUnderline property.void
setVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign)
Gets the text vertical alignment.-
Methods inherited from class net.sf.jasperreports.engine.design.JRDesignElement
addPropertyExpression, getPropertyExpressions, getPropertyExpressionsList, removePropertyExpression, removePropertyExpression, setElementGroup, setHeight, setKey, setPrintWhenExpression, setPrintWhenGroupChanges, setStyle, setStyleExpression, setStyleNameReference, setY
-
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseElement
clone, clone, getBackcolor, getBaseStyle, getDefaultStyleProvider, getElementGroup, getEventSupport, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getParentProperties, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getStretchType, 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, getKey, getOwnBackcolor, getOwnForecolor, getOwnMode, getWidth, setBackcolor, setForecolor, setMode
-
Methods inherited from interface net.sf.jasperreports.engine.JRElement
clone, collectExpressions, getElementGroup, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchType, 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, getStyleName, getStyleNameReference
-
Methods inherited from interface net.sf.jasperreports.engine.JRVisitable
visit
-
-
-
-
Field Detail
-
horizontalTextAlign
protected HorizontalTextAlignEnum horizontalTextAlign
-
verticalTextAlign
protected VerticalTextAlignEnum verticalTextAlign
-
rotation
protected RotationEnum rotation
-
markup
protected String markup
-
lineBox
protected JRLineBox lineBox
-
paragraph
protected JRParagraph paragraph
-
fontName
protected String fontName
-
isBold
protected Boolean isBold
-
isItalic
protected Boolean isItalic
-
isUnderline
protected Boolean isUnderline
-
isStrikeThrough
protected Boolean isStrikeThrough
-
fontSize
protected Float fontSize
-
pdfFontName
protected String pdfFontName
-
pdfEncoding
protected String pdfEncoding
-
isPdfEmbedded
protected Boolean isPdfEmbedded
-
-
Constructor Detail
-
JRDesignTextElement
protected JRDesignTextElement(JRDefaultStyleProvider defaultStyleProvider)
Creates a new text element.
-
-
Method Detail
-
getMode
public ModeEnum 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 classJRBaseElement
-
getHorizontalTextAlign
public HorizontalTextAlignEnum 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
public HorizontalTextAlignEnum getOwnHorizontalTextAlign()
- Specified by:
getOwnHorizontalTextAlign
in interfaceJRTextAlignment
-
setHorizontalTextAlign
public void setHorizontalTextAlign(HorizontalTextAlignEnum horizontalTextAlign)
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
public VerticalTextAlignEnum 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
public VerticalTextAlignEnum getOwnVerticalTextAlign()
- Specified by:
getOwnVerticalTextAlign
in interfaceJRTextAlignment
-
setVerticalTextAlign
public void setVerticalTextAlign(VerticalTextAlignEnum verticalTextAlign)
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
public RotationEnum 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
public 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
public void setRotation(RotationEnum rotation)
Description copied from interface:JRCommonText
Sets the text rotation.- Specified by:
setRotation
in interfaceJRCommonText
- Parameters:
rotation
- a value representing one of the text rotation constants inRotationEnum
-
getMarkup
public String getMarkup()
Description copied from interface:JRCommonText
Returns the text markup.- Specified by:
getMarkup
in interfaceJRCommonText
-
getOwnMarkup
public String getOwnMarkup()
- Specified by:
getOwnMarkup
in interfaceJRCommonText
-
setMarkup
public void setMarkup(String markup)
- Specified by:
setMarkup
in interfaceJRCommonText
-
getLineBox
public JRLineBox getLineBox()
- Specified by:
getLineBox
in interfaceJRBoxContainer
-
getParagraph
public JRParagraph getParagraph()
- Specified by:
getParagraph
in interfaceJRParagraphContainer
-
getFontName
public String getFontName()
- Specified by:
getFontName
in interfaceJRFont
-
getOwnFontName
public String getOwnFontName()
- Specified by:
getOwnFontName
in interfaceJRFont
-
setFontName
public void setFontName(String fontName)
- Specified by:
setFontName
in interfaceJRFont
-
setBold
public void setBold(Boolean isBold)
Alternative setBold method which allows also to reset the "own" isBold property.
-
isOwnItalic
public Boolean isOwnItalic()
- Specified by:
isOwnItalic
in interfaceJRFont
-
setItalic
public void setItalic(Boolean isItalic)
Alternative setItalic method which allows also to reset the "own" isItalic property.
-
isUnderline
public boolean isUnderline()
- Specified by:
isUnderline
in interfaceJRFont
-
isOwnUnderline
public Boolean isOwnUnderline()
- Specified by:
isOwnUnderline
in interfaceJRFont
-
setUnderline
public void setUnderline(Boolean isUnderline)
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
public Boolean isOwnStrikeThrough()
- Specified by:
isOwnStrikeThrough
in interfaceJRFont
-
setStrikeThrough
public void setStrikeThrough(Boolean isStrikeThrough)
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
public Float getOwnFontSize()
- Specified by:
getOwnFontSize
in interfaceJRFont
-
setFontSize
public void setFontSize(Float fontSize)
Method which allows also to reset the "own" size property.- Specified by:
setFontSize
in interfaceJRFont
-
getPdfFontName
public String getPdfFontName()
- Specified by:
getPdfFontName
in interfaceJRFont
-
getOwnPdfFontName
public String getOwnPdfFontName()
- Specified by:
getOwnPdfFontName
in interfaceJRFont
-
setPdfFontName
public void setPdfFontName(String pdfFontName)
- Specified by:
setPdfFontName
in interfaceJRFont
-
getPdfEncoding
public String getPdfEncoding()
- Specified by:
getPdfEncoding
in interfaceJRFont
-
getOwnPdfEncoding
public String getOwnPdfEncoding()
- Specified by:
getOwnPdfEncoding
in interfaceJRFont
-
setPdfEncoding
public void setPdfEncoding(String pdfEncoding)
- Specified by:
setPdfEncoding
in interfaceJRFont
-
isPdfEmbedded
public boolean isPdfEmbedded()
- Specified by:
isPdfEmbedded
in interfaceJRFont
-
isOwnPdfEmbedded
public Boolean isOwnPdfEmbedded()
- Specified by:
isOwnPdfEmbedded
in interfaceJRFont
-
setPdfEmbedded
public void setPdfEmbedded(Boolean isPdfEmbedded)
Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.- Specified by:
setPdfEmbedded
in interfaceJRFont
-
getDefaultLineColor
public Color getDefaultLineColor()
- Specified by:
getDefaultLineColor
in interfaceJRBoxContainer
-
clone
public Object clone()
- Specified by:
clone
in interfaceJRCloneable
- Overrides:
clone
in classJRDesignElement
-
-