T
- this typepublic abstract class RootElement<T extends IPropertyContainer> extends ElementPropertyContainer<T> implements Closeable
Modifier and Type | Field and Description |
---|---|
protected List<IElement> |
childElements |
protected PdfFont |
defaultFont |
protected FontProvider |
defaultFontProvider |
protected ISplitCharacters |
defaultSplitCharacters |
protected boolean |
immediateFlush |
protected PdfDocument |
pdfDocument |
protected RootRenderer |
rootRenderer |
properties
Constructor and Description |
---|
RootElement() |
Modifier and Type | Method and Description |
---|---|
T |
add(IBlockElement element)
Adds an element to the root.
|
T |
add(Image image)
Adds an image to the root.
|
protected void |
createAndAddRendererSubTree(IElement element) |
void |
deleteOwnProperty(int property)
Deletes the own property of this entity.
|
protected abstract RootRenderer |
ensureRootRendererNotNull() |
<T1> T1 |
getDefaultProperty(int property)
Gets the default property from this entity.
|
FontProvider |
getFontProvider()
Gets
FontProvider if presents. |
<T1> T1 |
getOwnProperty(int property)
Gets own property from this entity.
|
<T1> T1 |
getProperty(int property)
Gets the property from this entity.
|
RootRenderer |
getRenderer()
|
boolean |
hasOwnProperty(int property)
Checks if this entity has the specified property, i.e.
|
boolean |
hasProperty(int property)
Checks if this entity has the specified property.
|
void |
setFontProvider(FontProvider fontProvider)
Sets
FontProvider . |
void |
setProperty(int property,
Object value)
Sets a property for this entity.
|
T |
showTextAligned(Paragraph p,
float x,
float y,
int pageNumber,
TextAlignment textAlign,
VerticalAlignment vertAlign,
float radAngle)
Convenience method to write a text aligned about the specified point
|
T |
showTextAligned(Paragraph p,
float x,
float y,
TextAlignment textAlign)
Convenience method to write a text aligned about the specified point
|
T |
showTextAligned(Paragraph p,
float x,
float y,
TextAlignment textAlign,
VerticalAlignment vertAlign)
Convenience method to write a text aligned about the specified point
|
T |
showTextAligned(String text,
float x,
float y,
TextAlignment textAlign)
Convenience method to write a text aligned about the specified point
|
T |
showTextAligned(String text,
float x,
float y,
TextAlignment textAlign,
float angle)
Convenience method to write a text aligned about the specified point
|
T |
showTextAligned(String text,
float x,
float y,
TextAlignment textAlign,
VerticalAlignment vertAlign,
float angle)
Convenience method to write a text aligned about the specified point
|
T |
showTextAlignedKerned(String text,
float x,
float y,
TextAlignment textAlign,
VerticalAlignment vertAlign,
float radAngle)
Convenience method to write a kerned text aligned about the specified point
|
getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBorderTopLeftRadius, setBorderTopRightRadius, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFont, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setOpacity, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing
protected boolean immediateFlush
protected PdfDocument pdfDocument
protected PdfFont defaultFont
protected FontProvider defaultFontProvider
protected ISplitCharacters defaultSplitCharacters
protected RootRenderer rootRenderer
public T add(IBlockElement element)
element
- an element with spacial margins, tabbing, and alignmentBlockElement
public T add(Image image)
image
- a graphical image elementImage
public FontProvider getFontProvider()
FontProvider
if presents.FontProvider
if exists, otherwise null.public void setFontProvider(FontProvider fontProvider)
FontProvider
.
Note, font provider is inherited property.fontProvider
- instance of FontProvider
.public boolean hasProperty(int property)
IPropertyContainer
IPropertyContainer.hasOwnProperty(int)
,
this method can check parent's properties, styles, etc, depending on the origin of the instancehasProperty
in interface IPropertyContainer
hasProperty
in class ElementPropertyContainer<T extends IPropertyContainer>
property
- the property to be checkedtrue
if this instance has given property, false
otherwisepublic boolean hasOwnProperty(int property)
IPropertyContainer
hasOwnProperty
in interface IPropertyContainer
hasOwnProperty
in class ElementPropertyContainer<T extends IPropertyContainer>
property
- the property to be checkedtrue
if this instance has given own property, false
otherwisepublic <T1> T1 getProperty(int property)
IPropertyContainer
IPropertyContainer.getOwnProperty(int)
,
this method can check parent's properties, styles, etc, depending on the origin of the instancegetProperty
in interface IPropertyContainer
getProperty
in class ElementPropertyContainer<T extends IPropertyContainer>
T1
- the return type associated with the propertyproperty
- the property to be retrievednull
will be returned if the property value was not foundpublic <T1> T1 getOwnProperty(int property)
IPropertyContainer
null
will be returned.getOwnProperty
in interface IPropertyContainer
getOwnProperty
in class ElementPropertyContainer<T extends IPropertyContainer>
T1
- the return type associated with the propertyproperty
- the property to be retrievednull
will be returned if the property value was not foundpublic <T1> T1 getDefaultProperty(int property)
IPropertyContainer
getDefaultProperty
in interface IPropertyContainer
getDefaultProperty
in class ElementPropertyContainer<T extends IPropertyContainer>
T1
- the return type associated with the propertyproperty
- the property to be retrievednull
will be returnedpublic void deleteOwnProperty(int property)
IPropertyContainer
deleteOwnProperty
in interface IPropertyContainer
deleteOwnProperty
in class ElementPropertyContainer<T extends IPropertyContainer>
property
- the property to be deletedpublic void setProperty(int property, Object value)
IPropertyContainer
setProperty
in interface IPropertyContainer
setProperty
in class ElementPropertyContainer<T extends IPropertyContainer>
property
- the property to be setvalue
- the value of the propertypublic RootRenderer getRenderer()
IRenderer
that
acts as the root object that other renderers
descend
from.RootRenderer
attributepublic T showTextAligned(String text, float x, float y, TextAlignment textAlign)
text
- text to be placed to the pagex
- the point about which the text will be aligned and rotatedy
- the point about which the text will be aligned and rotatedtextAlign
- horizontal alignment about the specified pointpublic T showTextAligned(String text, float x, float y, TextAlignment textAlign, float angle)
text
- text to be placed to the pagex
- the point about which the text will be aligned and rotatedy
- the point about which the text will be aligned and rotatedtextAlign
- horizontal alignment about the specified pointangle
- the angle of rotation applied to the text, in radianspublic T showTextAligned(String text, float x, float y, TextAlignment textAlign, VerticalAlignment vertAlign, float angle)
text
- text to be placed to the pagex
- the point about which the text will be aligned and rotatedy
- the point about which the text will be aligned and rotatedtextAlign
- horizontal alignment about the specified pointvertAlign
- vertical alignment about the specified pointangle
- the angle of rotation applied to the text, in radianspublic T showTextAlignedKerned(String text, float x, float y, TextAlignment textAlign, VerticalAlignment vertAlign, float radAngle)
text
- text to be placed to the pagex
- the point about which the text will be aligned and rotatedy
- the point about which the text will be aligned and rotatedtextAlign
- horizontal alignment about the specified pointvertAlign
- vertical alignment about the specified pointradAngle
- the angle of rotation applied to the text, in radianspublic T showTextAligned(Paragraph p, float x, float y, TextAlignment textAlign)
p
- paragraph of text to be placed to the page. By default it has no leading and is written in single line.
Set width to write multiline text.x
- the point about which the text will be aligned and rotatedy
- the point about which the text will be aligned and rotatedtextAlign
- horizontal alignment about the specified pointpublic T showTextAligned(Paragraph p, float x, float y, TextAlignment textAlign, VerticalAlignment vertAlign)
p
- paragraph of text to be placed to the page. By default it has no leading and is written in single line.
Set width to write multiline text.x
- the point about which the text will be aligned and rotatedy
- the point about which the text will be aligned and rotatedtextAlign
- horizontal alignment about the specified pointvertAlign
- vertical alignment about the specified pointpublic T showTextAligned(Paragraph p, float x, float y, int pageNumber, TextAlignment textAlign, VerticalAlignment vertAlign, float radAngle)
p
- paragraph of text to be placed to the page. By default it has no leading and is written in single line.
Set width to write multiline text.x
- the point about which the text will be aligned and rotatedy
- the point about which the text will be aligned and rotatedpageNumber
- the page number to write the texttextAlign
- horizontal alignment about the specified pointvertAlign
- vertical alignment about the specified pointradAngle
- the angle of rotation applied to the text, in radiansprotected abstract RootRenderer ensureRootRendererNotNull()
protected void createAndAddRendererSubTree(IElement element)
Copyright © 1998–2019 iText Group NV. All rights reserved.