i-net Clear Reports

com.inet.report
Class TextPart

java.lang.Object
  extended by com.inet.report.ReportComponent
      extended by com.inet.report.Element
          extended by com.inet.report.AbstractFontElement
              extended by com.inet.report.TextPart
All Implemented Interfaces:
FontProperties, GeneralProperties, NodeParser, com.inet.report.ReferenceHolder, java.io.Serializable, java.lang.Cloneable

public class TextPart
extends AbstractFontElement

The text objects in a report are separated into parts of text, where each part has its own format, i.e. color & size. This elements are called text parts and are represented by this class. Note that it is not possible to instantiate this class directly. Please use the Paragraph.addTextPart(String) method from class Paragraph instead.
example: adding the line "hello World" into a text

 TextPart tPartHello = paragraph.addTextPart("hello ");
 TextPart tPartWorld = paragraph.addTextPart("World");
 tPartWorld.setFontBold(true);

paragraph is a reference to a line of a text you want to insert. The method addTextPart creates a new instance of TextPart, initialises it with the given String and formats it with default. The method saves one reference to the new TextPart into paragraph and returns one. In the example it happens twice times, because the two parts get different format. If the whole String should use the same format add only one TextPart with both words.

This class is part of the RDC.

See Also:
Text, Paragraph, FieldPart, Serialized Form

Field Summary
 
Fields inherited from class com.inet.report.Element
BOX, CHART, CROSSTAB, CROSSTABCELL, CROSSTABCOLUMN, CROSSTABROW, CROSSTABSECTION, DATABASE_PICTURE, FIELD, FIELDPART, FORMFIELD, INTERACTIVE_SORTING, JAVABEAN, LINE, PARAGRAPH, PICTURE, SIGNATURE, SUBREPORT, TEXT, TEXTPART
 
Fields inherited from interface com.inet.report.FontProperties
FONT_DIALOG, FONT_MONOSPACED, FONT_SANS_SERIF, FONT_SERIF, FONT_STYLE_BOLD, FONT_STYLE_ITALIC, FONT_STYLE_STRIKETHROUGH, FONT_STYLE_UNDERLINE
 
Fields inherited from interface com.inet.report.GeneralProperties
ALIGN_HORIZONTAL_CENTER, ALIGN_HORIZONTAL_DEFAULT, ALIGN_HORIZONTAL_JUSTIFIED, ALIGN_HORIZONTAL_LEFT, ALIGN_HORIZONTAL_RIGHT
 
Method Summary
 int getHorAlign()
          Use the value of the parent paragraph.
 FormulaField getHorAlignFormula()
          Use the value of the parent paragraph.
 Paragraph getParentParagraph()
          Returns this field part's parent's paragraph.
 java.lang.String getText()
          Gets the value of the property 'text'.
 int indexOf()
          Returns The current index of this text part in its paragraph.
 java.lang.String paramString()
          Creates and return a String representation for debugging.
 void setHorAlign(int value)
          Use the value of the parent paragraph.
 void setHorAlignFormula(FormulaField newFormula)
          Use the value of the parent paragraph.
 void setText(java.lang.String newValue)
          Sets the value of the property 'text'.
 
Methods inherited from class com.inet.report.AbstractFontElement
getFontColor, getFontColorFormula, getFontName, getFontNameFormula, getFontSize, getFontSizeFormula, getFontSizeTwips, getFontStyle, getFontStyleFormula, getPropertyFormulas, getStrikeoutFormula, getUnderlineFormula, isBold, isItalic, isStrikeout, isUnderline, setBold, setFontColor, setFontColorFormula, setFontName, setFontNameFormula, setFontSize, setFontSizeFormula, setFontSizeTwips, setFontStyle, setFontStyleFormula, setItalic, setStrikeout, setStrikeoutFormula, setUnderline, setUnderlineFormula
 
Methods inherited from class com.inet.report.Element
addListener, copy, getBottomLineStyle, getBottomLineStyleFormula, getCanGrowCount, getCanGrowFormula, getCloseBorderOnPageBreakFormula, getDropShadowFormula, getEngine, getField, getForeColor, getForeColorFormula, getHyperlinkUrl, getHyperlinkUrlFormula, getLeftLineStyle, getLeftLineStyleFormula, getParent, getRightLineStyle, getRightLineStyleFormula, getSuppressIfDuplicatedFormula, getTightHorizontalFormula, getToolTipsText, getToolTipsTextFormula, getTopLineStyle, getTopLineStyleFormula, isCanGrow, isCloseBorderOnPageBreak, isDropShadow, isSuppressIfDuplicated, isTightHorizontal, removeListener, setBottomLineStyle, setBottomLineStyleFormula, setCanGrow, setCanGrowCount, setCanGrowFormula, setCloseBorderOnPageBreak, setCloseBorderOnPageBreakFormula, setDropShadow, setDropShadowFormula, setField, setForeColor, setForeColorFormula, setHyperlinkUrl, setHyperlinkUrlFormula, setIndex, setLeftLineStyle, setLeftLineStyleFormula, setRightLineStyle, setRightLineStyleFormula, setSuppressIfDuplicated, setSuppressIfDuplicatedFormula, setTightHorizontal, setTightHorizontalFormula, setToolTipsText, setToolTipsTextFormula, setTopLineStyle, setTopLineStyleFormula
 
Methods inherited from class com.inet.report.ReportComponent
getBackColor, getBackColorFormula, getHeight, getKeepTogetherFormula, getSuppressFormula, getType, getWidth, getX, getY, isKeepTogether, isSuppress, setBackColor, setBackColorFormula, setHeight, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula, setWidth, setX, setY
 
Methods inherited from interface com.inet.report.GeneralProperties
getKeepTogetherFormula, getSuppressFormula, isKeepTogether, isSuppress, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula
 
Methods inherited from interface com.inet.report.parser.NodeParser
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
 

Method Detail

getParentParagraph

public Paragraph getParentParagraph()
Returns this field part's parent's paragraph.

Returns:
This field part's parent's paragraph.
See Also:
Paragraph

getText

public java.lang.String getText()
Gets the value of the property 'text'. The property text contains the string, that is shown by the label, that TextPart belongs to.

Returns:
The value of the property 'text'.

setText

public void setText(java.lang.String newValue)
Sets the value of the property 'text'. The property text contains the string, that is shown by the label, that TextPart belongs to.

Parameters:
newValue - The new value of the property 'text'.

paramString

public java.lang.String paramString()
Creates and return a String representation for debugging.

Overrides:
paramString in class Element
Returns:
String representation of this Element for debugging purposes

indexOf

public int indexOf()
Returns The current index of this text part in its paragraph.

Overrides:
indexOf in class Element
Returns:
The current index of this text in its paragraph.
See Also:
Element.setIndex(int)

getHorAlign

public int getHorAlign()
Use the value of the parent paragraph. Returns the value of the property 'horizontal alignment'.
Possible alignments are default, left, center, right or justified.

Specified by:
getHorAlign in interface GeneralProperties
Overrides:
getHorAlign in class Element
Returns:
Possible return values are default, left, center, right or justified.
See Also:
GeneralProperties.ALIGN_HORIZONTAL_DEFAULT, GeneralProperties.ALIGN_HORIZONTAL_LEFT, GeneralProperties.ALIGN_HORIZONTAL_CENTER, GeneralProperties.ALIGN_HORIZONTAL_RIGHT, GeneralProperties.ALIGN_HORIZONTAL_JUSTIFIED

getHorAlignFormula

public FormulaField getHorAlignFormula()
Use the value of the parent paragraph. Returns the formula for the property 'horizontal alignment'.
Possible alignments are default, left, center, right or justified.

Specified by:
getHorAlignFormula in interface GeneralProperties
Overrides:
getHorAlignFormula in class Element
Returns:
FormulaField The formula for the property 'horizontal alignment'.

setHorAlign

public void setHorAlign(int value)
Use the value of the parent paragraph. Sets the value of the property 'horizontal alignment'.
Possible alignments are default, left, center, right or justified.

Specified by:
setHorAlign in interface GeneralProperties
Overrides:
setHorAlign in class Element
Parameters:
value - The new value of the property 'horizontal alignment'.
See Also:
GeneralProperties.ALIGN_HORIZONTAL_DEFAULT, GeneralProperties.ALIGN_HORIZONTAL_LEFT, GeneralProperties.ALIGN_HORIZONTAL_CENTER, GeneralProperties.ALIGN_HORIZONTAL_RIGHT, GeneralProperties.ALIGN_HORIZONTAL_JUSTIFIED

setHorAlignFormula

public void setHorAlignFormula(FormulaField newFormula)
Use the value of the parent paragraph. Sets the formula for the property 'horizontal alignment'.
Possible alignments are default, left, center, right or justified.

Specified by:
setHorAlignFormula in interface GeneralProperties
Overrides:
setHorAlignFormula in class Element
Parameters:
newFormula - The new formula for the property 'horizontal alignment'. The result of the formula should be in range from 0 to 4.
See Also:
GeneralProperties.ALIGN_HORIZONTAL_DEFAULT, GeneralProperties.ALIGN_HORIZONTAL_LEFT, GeneralProperties.ALIGN_HORIZONTAL_CENTER, GeneralProperties.ALIGN_HORIZONTAL_RIGHT, GeneralProperties.ALIGN_HORIZONTAL_JUSTIFIED

i-net Clear Reports

Copyright © 1999-2013 by i-net software GmbH