net.sf.jasperreports.engine.design
Class JRDesignTextElement

java.lang.Object
  extended by net.sf.jasperreports.engine.base.JRBaseElement
      extended by net.sf.jasperreports.engine.design.JRDesignElement
          extended by net.sf.jasperreports.engine.design.JRDesignTextElement
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, JRChangeEventsSupport, JRAlignment, JRBoxContainer, JRChild, JRCloneable, JRCommonElement, JRCommonText, JRElement, JRFont, JRIdentifiable, JRParagraphContainer, JRPropertiesHolder, JRStyleContainer, 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.

Version:
$Id: JRDesignTextElement.java 5180 2012-03-29 13:23:12Z teodord $
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
protected  java.lang.String fontName
           
protected  java.lang.Integer fontSize
           
protected  HorizontalAlignEnum horizontalAlignmentValue
           
protected  java.lang.Boolean isBold
           
protected  java.lang.Boolean isItalic
           
protected  java.lang.Boolean isPdfEmbedded
           
protected  java.lang.Boolean isStrikeThrough
           
protected  java.lang.Boolean isUnderline
           
protected  JRLineBox lineBox
           
protected  java.lang.String markup
           
protected  JRParagraph paragraph
           
protected  java.lang.String pdfEncoding
           
protected  java.lang.String pdfFontName
           
protected  RotationEnum rotationValue
           
protected  VerticalAlignEnum verticalAlignmentValue
           
 
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_Y
 
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, uuid, width, x, y
 
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
 
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.JRCommonText
MARKUP_HTML, MARKUP_NONE, MARKUP_RTF, MARKUP_STYLED_TEXT
 
Constructor Summary
protected JRDesignTextElement(JRDefaultStyleProvider defaultStyleProvider)
          Creates a new text element.
 
Method Summary
 java.lang.Object clone()
           
 java.awt.Color getDefaultLineColor()
           
 JRFont getFont()
          Deprecated.  
 java.lang.String getFontName()
           
 int getFontSize()
           
 HorizontalAlignEnum getHorizontalAlignmentValue()
          Gets the text horizontal alignment.
 JRLineBox getLineBox()
           
 LineSpacingEnum getLineSpacingValue()
          Deprecated. Replaced by JRParagraph.getLineSpacing().
 java.lang.String getMarkup()
          Returns the text markup.
 ModeEnum getModeValue()
          Returns the element transparency mode.
 java.lang.String getOwnFontName()
           
 java.lang.Integer getOwnFontSize()
           
 HorizontalAlignEnum getOwnHorizontalAlignmentValue()
           
 LineSpacingEnum getOwnLineSpacingValue()
          Deprecated. Replaced by JRParagraph.getOwnLineSpacing().
 java.lang.String getOwnMarkup()
           
 java.lang.String getOwnPdfEncoding()
           
 java.lang.String getOwnPdfFontName()
           
 RotationEnum getOwnRotationValue()
          Gets the text own rotation.
 VerticalAlignEnum getOwnVerticalAlignmentValue()
           
 JRParagraph getParagraph()
           
 java.lang.String getPdfEncoding()
           
 java.lang.String getPdfFontName()
           
 RotationEnum getRotationValue()
          Gets the text rotation.
 VerticalAlignEnum getVerticalAlignmentValue()
          Gets the text vertical alignment.
 boolean isBold()
           
 boolean isItalic()
           
 java.lang.Boolean isOwnBold()
           
 java.lang.Boolean isOwnItalic()
           
 java.lang.Boolean isOwnPdfEmbedded()
           
 java.lang.Boolean isOwnStrikeThrough()
           
 java.lang.Boolean isOwnUnderline()
           
 boolean isPdfEmbedded()
           
 boolean isStrikeThrough()
           
 boolean isUnderline()
           
 void setBold(boolean isBold)
           
 void setBold(java.lang.Boolean isBold)
          Alternative setBold method which allows also to reset the "own" isBold property.
 void setFont(JRFont font)
          Deprecated.  
 void setFontName(java.lang.String fontName)
           
 void setFontSize(int fontSize)
           
 void setFontSize(java.lang.Integer fontSize)
          Alternative setFontSize method which allows also to reset the "own" size property.
 void setHorizontalAlignment(HorizontalAlignEnum horizontalAlignmentValue)
          Sets the text horizontal alignment.
 void setItalic(boolean isItalic)
           
 void setItalic(java.lang.Boolean isItalic)
          Alternative setItalic method which allows also to reset the "own" isItalic property.
 void setLineSpacing(LineSpacingEnum lineSpacing)
          Deprecated. Replaced by JRParagraph.setLineSpacing(LineSpacingEnum).
 void setMarkup(java.lang.String markup)
           
 void setPdfEmbedded(boolean isPdfEmbedded)
           
 void setPdfEmbedded(java.lang.Boolean isPdfEmbedded)
          Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.
 void setPdfEncoding(java.lang.String pdfEncoding)
           
 void setPdfFontName(java.lang.String pdfFontName)
           
 void setRotation(RotationEnum rotationValue)
          Sets the text rotation.
 void setStrikeThrough(boolean isStrikeThrough)
           
 void setStrikeThrough(java.lang.Boolean isStrikeThrough)
          Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.
 void setUnderline(boolean isUnderline)
           
 void setUnderline(java.lang.Boolean isUnderline)
          Alternative setUnderline method which allows also to reset the "own" isUnderline property.
 void setVerticalAlignment(VerticalAlignEnum verticalAlignmentValue)
          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, setStyleNameReference, setUUID, setY
 
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseElement
clone, getBackcolor, getBaseStyle, getDefaultStyleProvider, getElementGroup, getEventSupport, getForecolor, getHeight, getKey, getOwnBackcolor, getOwnForecolor, getOwnModeValue, getParentProperties, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertiesMap, getStretchTypeValue, getStyle, getStyleNameReference, getUUID, getWidth, getX, getY, hasProperties, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, 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.JRElement
collectExpressions, getElementGroup, getKey, getPositionTypeValue, getPrintWhenExpression, getPrintWhenGroupChanges, getPropertyExpressions, getStretchTypeValue, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
 
Methods inherited from interface net.sf.jasperreports.engine.JRChild
clone
 
Methods inherited from interface net.sf.jasperreports.engine.JRVisitable
visit
 
Methods inherited from interface net.sf.jasperreports.engine.JRPropertiesHolder
getParentProperties, getPropertiesMap, hasProperties
 
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.JRIdentifiable
getUUID
 
Methods inherited from interface net.sf.jasperreports.engine.JRStyleContainer
getDefaultStyleProvider, getStyle, getStyleNameReference
 

Field Detail

horizontalAlignmentValue

protected HorizontalAlignEnum horizontalAlignmentValue

verticalAlignmentValue

protected VerticalAlignEnum verticalAlignmentValue

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.Integer fontSize

pdfFontName

protected java.lang.String pdfFontName

pdfEncoding

protected java.lang.String pdfEncoding

isPdfEmbedded

protected java.lang.Boolean isPdfEmbedded
Constructor Detail

JRDesignTextElement

protected JRDesignTextElement(JRDefaultStyleProvider defaultStyleProvider)
Creates a new text element.

Method Detail

getModeValue

public ModeEnum getModeValue()
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:
getModeValue in interface JRCommonElement
Overrides:
getModeValue in class JRBaseElement

getHorizontalAlignmentValue

public HorizontalAlignEnum getHorizontalAlignmentValue()
Description copied from interface: JRAlignment
Gets the text horizontal alignment.

Specified by:
getHorizontalAlignmentValue in interface JRAlignment
Returns:
a value representing one of the horizontal alignment constants in HorizontalAlignEnum

getOwnHorizontalAlignmentValue

public HorizontalAlignEnum getOwnHorizontalAlignmentValue()
Specified by:
getOwnHorizontalAlignmentValue in interface JRAlignment

setHorizontalAlignment

public void setHorizontalAlignment(HorizontalAlignEnum horizontalAlignmentValue)
Description copied from interface: JRAlignment
Sets the text horizontal alignment.

Specified by:
setHorizontalAlignment in interface JRAlignment
Parameters:
horizontalAlignmentValue - a value representing one of the horizontal alignment constants in HorizontalAlignEnum

getVerticalAlignmentValue

public VerticalAlignEnum getVerticalAlignmentValue()
Description copied from interface: JRAlignment
Gets the text vertical alignment.

Specified by:
getVerticalAlignmentValue in interface JRAlignment
Returns:
a value representing one of the vertical alignment constants in VerticalAlignEnum

getOwnVerticalAlignmentValue

public VerticalAlignEnum getOwnVerticalAlignmentValue()
Specified by:
getOwnVerticalAlignmentValue in interface JRAlignment

setVerticalAlignment

public void setVerticalAlignment(VerticalAlignEnum verticalAlignmentValue)
Description copied from interface: JRAlignment
Gets the text vertical alignment.

Specified by:
setVerticalAlignment in interface JRAlignment
Parameters:
verticalAlignmentValue - a value representing one of the vertical alignment constants in VerticalAlignEnum

getRotationValue

public RotationEnum getRotationValue()
Description copied from interface: JRCommonText
Gets the text rotation.

Specified by:
getRotationValue in interface JRCommonText
Returns:
a value representing one of the text rotation constants in RotationEnum

getOwnRotationValue

public RotationEnum getOwnRotationValue()
Description copied from interface: JRCommonText
Gets the text own rotation.

Specified by:
getOwnRotationValue in interface JRCommonText
Returns:
a value representing one of the text rotation constants in RotationEnum

setRotation

public void setRotation(RotationEnum rotationValue)
Description copied from interface: JRCommonText
Sets the text rotation.

Specified by:
setRotation in interface JRCommonText
Parameters:
rotationValue - a value representing one of the text rotation constants in RotationEnum

getLineSpacingValue

public LineSpacingEnum getLineSpacingValue()
Deprecated. Replaced by JRParagraph.getLineSpacing().

Specified by:
getLineSpacingValue in interface JRCommonText

getOwnLineSpacingValue

public LineSpacingEnum getOwnLineSpacingValue()
Deprecated. Replaced by JRParagraph.getOwnLineSpacing().

Specified by:
getOwnLineSpacingValue in interface JRCommonText

setLineSpacing

public void setLineSpacing(LineSpacingEnum lineSpacing)
Deprecated. Replaced by JRParagraph.setLineSpacing(LineSpacingEnum).

Specified by:
setLineSpacing in interface JRCommonText

getMarkup

public java.lang.String getMarkup()
Description copied from interface: JRCommonText
Returns the text markup.

Specified by:
getMarkup in interface JRCommonText

getOwnMarkup

public java.lang.String getOwnMarkup()
Specified by:
getOwnMarkup in interface JRCommonText

setMarkup

public void setMarkup(java.lang.String markup)
Specified by:
setMarkup in interface JRCommonText

getLineBox

public JRLineBox getLineBox()
Specified by:
getLineBox in interface JRBoxContainer

getParagraph

public JRParagraph getParagraph()
Specified by:
getParagraph in interface JRParagraphContainer

getFont

public JRFont getFont()
Deprecated. 


setFont

public void setFont(JRFont font)
Deprecated. 

Sets a JRFont object containing all font properties for this text element


getFontName

public java.lang.String getFontName()
Specified by:
getFontName in interface JRFont

getOwnFontName

public java.lang.String getOwnFontName()
Specified by:
getOwnFontName in interface JRFont

setFontName

public void setFontName(java.lang.String fontName)
Specified by:
setFontName in interface JRFont

isBold

public boolean isBold()
Specified by:
isBold in interface JRFont

isOwnBold

public java.lang.Boolean isOwnBold()
Specified by:
isOwnBold in interface JRFont

setBold

public void setBold(boolean isBold)
Specified by:
setBold in interface JRFont

setBold

public void setBold(java.lang.Boolean isBold)
Alternative setBold method which allows also to reset the "own" isBold property.

Specified by:
setBold in interface JRFont

isItalic

public boolean isItalic()
Specified by:
isItalic in interface JRFont

isOwnItalic

public java.lang.Boolean isOwnItalic()
Specified by:
isOwnItalic in interface JRFont

setItalic

public void setItalic(boolean isItalic)
Specified by:
setItalic in interface JRFont

setItalic

public void setItalic(java.lang.Boolean isItalic)
Alternative setItalic method which allows also to reset the "own" isItalic property.

Specified by:
setItalic in interface JRFont

isUnderline

public boolean isUnderline()
Specified by:
isUnderline in interface JRFont

isOwnUnderline

public java.lang.Boolean isOwnUnderline()
Specified by:
isOwnUnderline in interface JRFont

setUnderline

public void setUnderline(boolean isUnderline)
Specified by:
setUnderline in interface JRFont

setUnderline

public void setUnderline(java.lang.Boolean isUnderline)
Alternative setUnderline method which allows also to reset the "own" isUnderline property.

Specified by:
setUnderline in interface JRFont

isStrikeThrough

public boolean isStrikeThrough()
Specified by:
isStrikeThrough in interface JRFont

isOwnStrikeThrough

public java.lang.Boolean isOwnStrikeThrough()
Specified by:
isOwnStrikeThrough in interface JRFont

setStrikeThrough

public void setStrikeThrough(boolean isStrikeThrough)
Specified by:
setStrikeThrough in interface JRFont

setStrikeThrough

public void setStrikeThrough(java.lang.Boolean isStrikeThrough)
Alternative setStrikeThrough method which allows also to reset the "own" isStrikeThrough property.

Specified by:
setStrikeThrough in interface JRFont

getFontSize

public int getFontSize()
Specified by:
getFontSize in interface JRCommonText
Specified by:
getFontSize in interface JRFont

getOwnFontSize

public java.lang.Integer getOwnFontSize()
Specified by:
getOwnFontSize in interface JRFont

setFontSize

public void setFontSize(int fontSize)
Specified by:
setFontSize in interface JRFont

setFontSize

public void setFontSize(java.lang.Integer fontSize)
Alternative setFontSize method which allows also to reset the "own" size property.

Specified by:
setFontSize in interface JRFont

getPdfFontName

public java.lang.String getPdfFontName()
Specified by:
getPdfFontName in interface JRFont

getOwnPdfFontName

public java.lang.String getOwnPdfFontName()
Specified by:
getOwnPdfFontName in interface JRFont

setPdfFontName

public void setPdfFontName(java.lang.String pdfFontName)
Specified by:
setPdfFontName in interface JRFont

getPdfEncoding

public java.lang.String getPdfEncoding()
Specified by:
getPdfEncoding in interface JRFont

getOwnPdfEncoding

public java.lang.String getOwnPdfEncoding()
Specified by:
getOwnPdfEncoding in interface JRFont

setPdfEncoding

public void setPdfEncoding(java.lang.String pdfEncoding)
Specified by:
setPdfEncoding in interface JRFont

isPdfEmbedded

public boolean isPdfEmbedded()
Specified by:
isPdfEmbedded in interface JRFont

isOwnPdfEmbedded

public java.lang.Boolean isOwnPdfEmbedded()
Specified by:
isOwnPdfEmbedded in interface JRFont

setPdfEmbedded

public void setPdfEmbedded(boolean isPdfEmbedded)
Specified by:
setPdfEmbedded in interface JRFont

setPdfEmbedded

public void setPdfEmbedded(java.lang.Boolean isPdfEmbedded)
Alternative setPdfEmbedded method which allows also to reset the "own" isPdfEmbedded property.

Specified by:
setPdfEmbedded in interface JRFont

getDefaultLineColor

public java.awt.Color getDefaultLineColor()
Specified by:
getDefaultLineColor in interface JRBoxContainer

clone

public java.lang.Object clone()
Specified by:
clone in interface JRCloneable
Overrides:
clone in class JRBaseElement


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com