public class Paragraph extends Element implements ParagraphProperties
Paragraph
class represents a line in a Text
and is a set of TextPart
elements and FieldPart
elements.
I.e. a Paragraph
that consists of a text formatted with blue
color, a field, a text formatted with red color and a text formatted with
blue color, has to be split into four parts; three TextPart
elements and one FieldPart
element.
The last part of a Paragraph
is terminated with a newline.
After a FieldPart
element, a TextPart
element
that contains a newline is required. Text
,
TextPart
,
FieldPart
,
Serialized FormBOX, CHART, CROSSTAB, CROSSTABSECTION, DATABASE_PICTURE, FIELD, FIELDPART, FORMFIELD, INTERACTIVE_SORTING, JAVABEAN, LINE, PARAGRAPH, PICTURE, SIGNATURE, SUBREPORT, TEXT, TEXTPART
INDENT_DEFAULT, LINE_SPACING_ABSOLUTE, LINE_SPACING_RELATIVE
ALIGN_HORIZONTAL_CENTER, ALIGN_HORIZONTAL_DEFAULT, ALIGN_HORIZONTAL_JUSTIFIED, ALIGN_HORIZONTAL_LEFT, ALIGN_HORIZONTAL_RIGHT
Modifier and Type | Method and Description |
---|---|
FieldPart |
addFieldPart(Field newField)
Creates a new field part element and adds it into this paragraph.
|
TextPart |
addTextPart(java.lang.String newText)
Creates a new text part element and adds it into this paragraph.
|
int |
getFirstLineIndent()
Returns the value of the property 'first line indent'.
|
FormulaField |
getFirstLineIndentFormula()
Returns the formula whose return value determines the property 'first line indent'.
|
int |
getLeftIndent()
Returns the value of the property 'left indent'.
|
FormulaField |
getLeftIndentFormula()
Returns the formula whose return value determines the property 'left indent'.
|
int |
getLineSpacingAbsolute()
Returns the absolute distance between baselines of the lines in this paragraph, measured in
twips.
|
FormulaField |
getLineSpacingAbsoluteFormula()
Returns the formula whose return value determines the absolute distance between baselines of the lines in this paragraph, measured in
twips.
|
double |
getLineSpacingRelative()
Returns the factor by which the default line spacing is to be multiplied for this paragraph.
|
FormulaField |
getLineSpacingRelativeFormula()
Returns the formula whose return value determines the factor by which the default line spacing is to be multiplied for this paragraph.
|
Element |
getPart(int idx)
Returns the TextPart or the FieldPart at the specified index.
|
int |
getPartCount()
Returns the number of TextParts and FieldParts of this paragraph.
|
int |
getRightIndent()
Returns the value of the property 'rightIndent'.
|
FormulaField |
getRightIndentFormula()
Returns the formula whose return value determines the property 'right indent'.
|
java.util.List<? extends ReportComponent> |
getSubComponents()
Returns all
ReportComponent s that are descendants of this one. |
Text |
getText()
Returns the parent
Text element. |
int |
indexOf()
Returns the index of this Paragraph inside the parent Text element.
|
FieldPart |
insertFieldPart(int pos,
Field newfield)
Inserts a FieldPart element into this Paragraph.
|
TextPart |
insertTextPart(int pos,
java.lang.String newtext)
Inserts a text element into this Paragraph.
|
void |
moveParts(int srcPos,
Paragraph dest,
int destPos,
int length)
Move FieldParts and TextParts from this Paragraph, beginning at the specified position, to the specified position
of the destination Paragraph.
|
void |
normalize(boolean replacePrompts)
Normalizes this paragraph.
|
java.lang.String |
paramString()
Creates and return a String representation for debugging.
|
void |
removePart(int idx)
Removes the TextPart or the FieldPart at the specified index.
|
void |
setFirstLineIndent(int newValue)
Sets the value of the property 'first line indent'.
|
void |
setFirstLineIndentFormula(FormulaField formula)
Sets the formula whose return value determines the property 'first line indent'.
|
void |
setLeftIndent(int newLeftIndent)
Sets the value of the property 'left indent'.
|
void |
setLeftIndentFormula(FormulaField formula)
Sets the formula whose return value determines the property 'left indent'.
|
void |
setLineSpacingAbsolute(int lineSpacingAbsolute)
Sets the absolute distance between baselines of the lines in this paragraph, measured in
twips.
|
void |
setLineSpacingAbsoluteFormula(FormulaField formula)
Sets the formula whose return value determines the absolute distance between baselines of the lines in this paragraph, measured in
twips.
|
void |
setLineSpacingRelative(double lineSpacingRelative)
Sets the factor by which the default line spacing is to be multiplied for this paragraph.
|
void |
setLineSpacingRelativeFormula(FormulaField formula)
Sets the formula whose return value determines the factor by which the default line spacing is to be multiplied for this paragraph.
|
void |
setRightIndent(int newRightIndent)
Sets the value of the property 'rightIndent'.
|
void |
setRightIndentFormula(FormulaField formula)
Sets the formula whose return value determines the property 'right indent'.
|
addListener, copy, getBottomLineStyle, getBottomLineStyleFormula, getCanGrowCount, getCanGrowFormula, getCloseBorderOnPageBreakFormula, getDropShadowFormula, getEngine, getField, getForeColor, getForeColorFormula, getHorAlign, getHorAlignFormula, getHyperlinkUrl, getHyperlinkUrlFormula, getLeftLineStyle, getLeftLineStyleFormula, getParent, getPropertyFormulas, 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, setHorAlign, setHorAlignFormula, setHyperlinkUrl, setHyperlinkUrlFormula, setIndex, setLeftLineStyle, setLeftLineStyleFormula, setRightLineStyle, setRightLineStyleFormula, setSuppressIfDuplicated, setSuppressIfDuplicatedFormula, setTightHorizontal, setTightHorizontalFormula, setToolTipsText, setToolTipsTextFormula, setTopLineStyle, setTopLineStyleFormula
getBackColor, getBackColorFormula, getHeight, getKeepTogetherFormula, getSuppressFormula, getType, getWidth, getX, getY, isKeepTogether, isSuppress, setBackColor, setBackColorFormula, setHeight, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula, setWidth, setX, setY
getKeepTogetherFormula, getSuppressFormula, isKeepTogether, isSuppress, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
public Text getText()
Text
element.public TextPart addTextPart(java.lang.String newText)
text
is null
, it will be replaced by
an empty String.newText
- the text of the text part as Stringpublic TextPart insertTextPart(int pos, java.lang.String newtext)
pos
- The position where the text element shall be stored.newtext
- The new text element that shall be stored.public FieldPart addFieldPart(Field newField)
newField
- The field which should be added into the paragraph.DatabaseField
,
FormulaField
,
PromptField
,
GroupField
,
SummaryField
,
SQLField
public FieldPart insertFieldPart(int pos, Field newfield)
pos
- The position where the element shall be stored.newfield
- The new field that shall be stored.public Element getPart(int idx)
idx
- The index of the FieldPart or of the TextPart that should returned.TextPart
,
FieldPart
,
addFieldPart(Field)
,
addTextPart(String)
,
getPartCount()
,
removePart(int)
public int getPartCount()
TextPart
,
FieldPart
,
addFieldPart(Field)
,
addTextPart(String)
,
getPart(int)
,
removePart(int)
public void removePart(int idx)
idx
- The index of the FieldPart or of the TextPart that should removed.java.lang.IndexOutOfBoundsException
- if idx
is out of bounds.TextPart
,
FieldPart
,
addFieldPart(Field)
,
addTextPart(String)
,
getPart(int)
,
getPartCount()
public void moveParts(int srcPos, Paragraph dest, int destPos, int length) throws java.lang.IndexOutOfBoundsException, java.lang.IllegalArgumentException
srcPos
- starting position in this Paragraph. This is the index of FieldPart and TextPart starting with 0.dest
- the destination ParagraphdestPos
- starting position in the destination Paragraph. This is the index of FieldPart and TextPart starting
with 0.length
- count of parts that should be moved.java.lang.IndexOutOfBoundsException
- if srcPos, destPost or length is out of bounds.java.lang.IllegalArgumentException
- If the Paragraph come from different Enginespublic java.lang.String paramString()
paramString
in class Element
public int indexOf()
indexOf
in class Element
Element.setIndex(int)
public int getFirstLineIndent()
getFirstLineIndent
in interface ParagraphProperties
public void setFirstLineIndent(int newValue)
setFirstLineIndent
in interface ParagraphProperties
newValue
- The new value of the property 'first line indent'. May be negative (which would cause the first line to be left
of the left margin).public int getLeftIndent()
getLeftIndent
in interface ParagraphProperties
public void setLeftIndent(int newLeftIndent)
setLeftIndent
in interface ParagraphProperties
newLeftIndent
- The new value of the property 'left indent'.public int getRightIndent()
getRightIndent
in interface ParagraphProperties
public void setRightIndent(int newRightIndent)
setRightIndent
in interface ParagraphProperties
newRightIndent
- The new value of the property 'rightIndent'.public void setLineSpacingAbsolute(int lineSpacingAbsolute)
setLineSpacingAbsolute
in interface ParagraphProperties
lineSpacingAbsolute
- Absolute distance between baselines in this paragraph, measured in twips, or
LINE_SPACING_RELATIVE in order to restore the default setting.ParagraphProperties.getLineSpacingAbsolute()
,
ParagraphProperties.LINE_SPACING_RELATIVE
public int getLineSpacingAbsolute()
getLineSpacingAbsolute
in interface ParagraphProperties
ParagraphProperties.setLineSpacingAbsolute(int)
,
ParagraphProperties.LINE_SPACING_RELATIVE
public void setLineSpacingRelative(double lineSpacingRelative)
setLineSpacingRelative
in interface ParagraphProperties
lineSpacingRelative
- Factor by which the default line spacing is to be multiplied for this paragraph,
or LINE_SPACING_ABSOLUTE if the default value is to be set (equivalent to "1")ParagraphProperties.LINE_SPACING_ABSOLUTE
,
ParagraphProperties.getLineSpacingRelative()
public double getLineSpacingRelative()
getLineSpacingRelative
in interface ParagraphProperties
ParagraphProperties.LINE_SPACING_ABSOLUTE
,
ParagraphProperties.getLineSpacingRelative()
public void normalize(boolean replacePrompts)
replacePrompts
- replace prompt fields with it current valuepublic FormulaField getFirstLineIndentFormula()
getFirstLineIndentFormula
in interface ParagraphProperties
public FormulaField getLeftIndentFormula()
getLeftIndentFormula
in interface ParagraphProperties
public FormulaField getLineSpacingAbsoluteFormula()
getLineSpacingAbsoluteFormula
in interface ParagraphProperties
ParagraphProperties.setLineSpacingAbsolute(int)
public FormulaField getLineSpacingRelativeFormula()
getLineSpacingRelativeFormula
in interface ParagraphProperties
ParagraphProperties.getLineSpacingRelative()
public FormulaField getRightIndentFormula()
getRightIndentFormula
in interface ParagraphProperties
public void setFirstLineIndentFormula(FormulaField formula)
setFirstLineIndentFormula
in interface ParagraphProperties
formula
- The formula whose return value determines the property 'first line indent'.public void setLeftIndentFormula(FormulaField formula)
setLeftIndentFormula
in interface ParagraphProperties
formula
- The formula whose return value determines the property 'left indent'.public void setLineSpacingAbsoluteFormula(FormulaField formula)
setLineSpacingAbsoluteFormula
in interface ParagraphProperties
formula
- formula whose return value determines the absolute distance between baselines in this paragraph, measured in twipsParagraphProperties.setLineSpacingAbsolute(int)
public void setLineSpacingRelativeFormula(FormulaField formula)
setLineSpacingRelativeFormula
in interface ParagraphProperties
formula
- formula whose return value determines the factor by which the default line spacing is to be multiplied for this paragraphParagraphProperties.setLineSpacingRelative(double)
public void setRightIndentFormula(FormulaField formula)
setRightIndentFormula
in interface ParagraphProperties
formula
- The formula whose return value determines the property 'right indent'.public java.util.List<? extends ReportComponent> getSubComponents()
ReportComponent
s that are descendants of this one. E.G. this will return all Element
of a Section
. But it's as well useful for CrossTab
s or Text
elements which have
additional elements.getSubComponents
in class ReportComponent
null
if the component has no descendantsCopyright © 1999-2020 by i-net software GmbH