net.sf.jasperreports.engine.base
Class JRBaseTextElement

java.lang.Object
  extended bynet.sf.jasperreports.engine.base.JRBaseElement
      extended bynet.sf.jasperreports.engine.base.JRBaseTextElement
All Implemented Interfaces:
JRAlignment, JRChild, JRElement, JRTextElement, java.io.Serializable
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.

Version:
$Id: JRBaseTextElement.java,v 1.31 2005/09/07 13:58:25 teodord Exp $
Author:
Teodor Danciu (teodord@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
protected  JRBox box
           
protected  JRFont font
           
protected  byte horizontalAlignment
           
protected  boolean isStyledText
           
protected  byte lineSpacing
           
protected  byte rotation
           
protected  byte verticalAlignment
           
 
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseElement
backcolor, elementGroup, forecolor, height, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, key, mode, positionType, printWhenExpression, printWhenGroupChanges, stretchType, width, x, y
 
Fields inherited from interface net.sf.jasperreports.engine.JRTextElement
LINE_SPACING_1_1_2, LINE_SPACING_DOUBLE, LINE_SPACING_SINGLE, ROTATION_LEFT, ROTATION_NONE, ROTATION_RIGHT, TEXT_ALIGN_CENTER, TEXT_ALIGN_JUSTIFIED, TEXT_ALIGN_LEFT, TEXT_ALIGN_RIGHT
 
Fields inherited from interface net.sf.jasperreports.engine.JRElement
MODE_OPAQUE, MODE_TRANSPARENT, POSITION_TYPE_FIX_RELATIVE_TO_BOTTOM, POSITION_TYPE_FIX_RELATIVE_TO_TOP, POSITION_TYPE_FLOAT, STRETCH_TYPE_NO_STRETCH, STRETCH_TYPE_RELATIVE_TO_BAND_HEIGHT, STRETCH_TYPE_RELATIVE_TO_TALLEST_OBJECT
 
Fields inherited from interface net.sf.jasperreports.engine.JRAlignment
HORIZONTAL_ALIGN_CENTER, HORIZONTAL_ALIGN_JUSTIFIED, HORIZONTAL_ALIGN_LEFT, HORIZONTAL_ALIGN_RIGHT, VERTICAL_ALIGN_BOTTOM, VERTICAL_ALIGN_JUSTIFIED, VERTICAL_ALIGN_MIDDLE, VERTICAL_ALIGN_TOP
 
Constructor Summary
protected JRBaseTextElement()
          Constructs an empty text element.
protected JRBaseTextElement(JRTextElement textElement, JRBaseObjectFactory factory)
          Initializes properties that are specific to text elements.
 
Method Summary
 JRBox getBox()
          Returns an object containing all border and padding properties for this text element
 JRFont getFont()
          Returns an object containing all font properties for this text element
 byte getHorizontalAlignment()
          Gets the text horizontal alignment.
 byte getLineSpacing()
          Gets the line spacing.
 byte getRotation()
          Gets the text rotation.
 byte getTextAlignment()
          Gets the text horizontal alignment.
 byte getVerticalAlignment()
          Gets the text vertical alignment.
 boolean isStyledText()
          Returns true if the text can contain style tags.
 void setHorizontalAlignment(byte horizontalAlignment)
          Sets the text horizontal alignment.
 void setLineSpacing(byte lineSpacing)
          Sets the line spacing.
 void setRotation(byte rotation)
          Sets the text rotation.
 void setStyledText(boolean isStyledText)
          Specifies whether the text can contain style tags.
 void setTextAlignment(byte horizontalAlignment)
          Sets the text horizontal alignment.
 void setVerticalAlignment(byte verticalAlignment)
          Gets the text vertical alignment.
 
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseElement
getBackcolor, getElementGroup, getForecolor, getHeight, getKey, getMode, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getStretchType, getWidth, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
 
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.JRElement
collectExpressions, getBackcolor, getElementGroup, getForecolor, getHeight, getKey, getMode, getPositionType, getPrintWhenExpression, getPrintWhenGroupChanges, getStretchType, getWidth, getX, getY, isPrintInFirstWholeBand, isPrintRepeatedValues, isPrintWhenDetailOverflows, isRemoveLineWhenBlank, setBackcolor, setForecolor, setMode, setPositionType, setPrintInFirstWholeBand, setPrintRepeatedValues, setPrintWhenDetailOverflows, setRemoveLineWhenBlank, setStretchType, setWidth, setX
 
Methods inherited from interface net.sf.jasperreports.engine.JRChild
getCopy, writeXml
 

Field Detail

horizontalAlignment

protected byte horizontalAlignment

verticalAlignment

protected byte verticalAlignment

rotation

protected byte rotation

lineSpacing

protected byte lineSpacing

isStyledText

protected boolean isStyledText

box

protected JRBox box

font

protected JRFont font
Constructor Detail

JRBaseTextElement

protected JRBaseTextElement()
Constructs an empty text element. By default a text element is transparent.


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 a JRDesignTextElement that must be transformed into an JRBaseTextElement at compile time.
factory - a factory used in the compile process
Method Detail

getTextAlignment

public byte getTextAlignment()
Deprecated. Replaced by getHorizontalAlignment().

Description copied from interface: JRTextElement
Gets the text horizontal alignment.

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

setTextAlignment

public void setTextAlignment(byte horizontalAlignment)
Deprecated. Replaced by setHorizontalAlignment(byte).

Description copied from interface: JRTextElement
Sets the text horizontal alignment.

Specified by:
setTextAlignment in interface JRTextElement
Parameters:
horizontalAlignment - a value representing one of the horizontal alignment constants in JRAlignment

getHorizontalAlignment

public byte getHorizontalAlignment()
Description copied from interface: JRAlignment
Gets the text horizontal alignment.

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

setHorizontalAlignment

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

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

getVerticalAlignment

public byte getVerticalAlignment()
Description copied from interface: JRAlignment
Gets the text vertical alignment.

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

setVerticalAlignment

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

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

getRotation

public byte getRotation()
Description copied from interface: JRTextElement
Gets the text rotation.

Specified by:
getRotation in interface JRTextElement
Returns:
a value representing one of the rotation constants in this class

setRotation

public void setRotation(byte rotation)
Description copied from interface: JRTextElement
Sets the text rotation.

Specified by:
setRotation in interface JRTextElement
Parameters:
rotation - a value representing one of the rotation constants in this class

getLineSpacing

public byte getLineSpacing()
Description copied from interface: JRTextElement
Gets the line spacing.

Specified by:
getLineSpacing in interface JRTextElement
Returns:
a value representing one of the line spacing constants in this class

setLineSpacing

public void setLineSpacing(byte lineSpacing)
Description copied from interface: JRTextElement
Sets the line spacing.

Specified by:
setLineSpacing in interface JRTextElement
Parameters:
lineSpacing - a value representing one of the line spacing constants in this class

isStyledText

public boolean isStyledText()
Description copied from interface: JRTextElement
Returns true if the text can contain style tags.

Specified by:
isStyledText in interface JRTextElement

setStyledText

public void setStyledText(boolean isStyledText)
Description copied from interface: JRTextElement
Specifies whether the text can contain style tags.

Specified by:
setStyledText in interface JRTextElement

getBox

public JRBox getBox()
Description copied from interface: JRTextElement
Returns an object containing all border and padding properties for this text element

Specified by:
getBox in interface JRTextElement

getFont

public JRFont getFont()
Description copied from interface: JRTextElement
Returns an object containing all font properties for this text element

Specified by:
getFont in interface JRTextElement


© 2001-2005 JasperSoft Corporation www.jaspersoft.com