T - this typepublic abstract class ElementPropertyContainer<T extends IPropertyContainer> extends Object implements IPropertyContainer
layout object implementations.| Modifier and Type | Field and Description |
|---|---|
protected Map<Integer,Object> |
properties |
| Constructor and Description |
|---|
ElementPropertyContainer() |
| Modifier and Type | Method and Description |
|---|---|
void |
deleteOwnProperty(int property)
Deletes the own property of this entity.
|
<T1> T1 |
getDefaultProperty(int property)
Gets the default property from this entity.
|
<T1> T1 |
getOwnProperty(int property)
Gets own property from this entity.
|
<T1> T1 |
getProperty(int property)
Gets the property from this entity.
|
ISplitCharacters |
getSplitCharacters()
Gets a rule for splitting strings when they don't fit into one line.
|
Color |
getStrokeColor()
Gets the stroke color for the current element.
|
Float |
getStrokeWidth()
Gets the stroke width for the current element.
|
Integer |
getTextRenderingMode()
Gets the text rendering mode, a variable that determines whether showing
text causes glyph outlines to be stroked, filled, used as a clipping
boundary, or some combination of the three.
|
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.
|
T |
setBackgroundColor(Color backgroundColor)
Specifies a background color for the Element.
|
T |
setBackgroundColor(Color backgroundColor,
float opacity)
Specifies a background color for the Element.
|
T |
setBackgroundColor(Color backgroundColor,
float extraLeft,
float extraTop,
float extraRight,
float extraBottom)
Specifies a background color for the Element, and extra space that
must be counted as part of the background and therefore colored.
|
T |
setBackgroundColor(Color backgroundColor,
float opacity,
float extraLeft,
float extraTop,
float extraRight,
float extraBottom)
Specifies a background color for the Element, and extra space that
must be counted as part of the background and therefore colored.
|
T |
setBackgroundImage(BackgroundImage image)
Specifies a background image for the Element.
|
T |
setBackgroundImage(List<BackgroundImage> imagesList)
Specifies a list of background images for the Element.
|
T |
setBaseDirection(BaseDirection baseDirection)
This attribute specifies the base direction of directionally neutral text
(i.e., text that doesn't have inherent directionality as defined in Unicode)
in an element's content and attribute values.
|
T |
setBold()
Switch on the simulation of bold style for a font.
|
T |
setBorder(Border border)
Sets a border for all four edges of this Element with customizable color, width, pattern type.
|
T |
setBorderBottom(Border border)
Sets a border for the bottom limit of this Element with customizable color, width, pattern type.
|
T |
setBorderBottomLeftRadius(BorderRadius borderRadius)
Sets a border radius for the bottom left corner of this Element.
|
T |
setBorderBottomRightRadius(BorderRadius borderRadius)
Sets a border radius for the bottom right corner of this Element.
|
T |
setBorderLeft(Border border)
Sets a border for the left limit of this Element with customizable color, width, pattern type.
|
T |
setBorderRadius(BorderRadius borderRadius)
Sets a border radius for all four edges of this Element.
|
T |
setBorderRight(Border border)
Sets a border for the right limit of this Element with customizable color, width, pattern type.
|
T |
setBorderTop(Border border)
Sets a border for the upper limit of this Element with customizable color, width, pattern type.
|
T |
setBorderTopLeftRadius(BorderRadius borderRadius)
Sets a border radius for the top left corner of this Element.
|
T |
setBorderTopRightRadius(BorderRadius borderRadius)
Sets a border radius for the top right corner of this Element.
|
T |
setCharacterSpacing(float charSpacing)
Defines a custom spacing distance between all characters of a textual element.
|
T |
setDestination(String destination)
Sets a destination name that will be created when this element is drawn to content.
|
T |
setFixedPosition(float left,
float bottom,
float width)
Sets values for a absolute repositioning of the Element.
|
T |
setFixedPosition(float left,
float bottom,
UnitValue width)
Sets values for a absolute repositioning of the Element.
|
T |
setFixedPosition(int pageNumber,
float left,
float bottom,
float width)
Sets values for a absolute repositioning of the Element.
|
T |
setFixedPosition(int pageNumber,
float left,
float bottom,
UnitValue width)
Sets values for a absolute repositioning of the Element.
|
T |
setFont(PdfFont font)
Sets the font of this Element.
|
T |
setFont(String font)
Deprecated.
This method will be removed in 7.2. Use
setFontFamily(String...) instead. |
T |
setFontColor(Color fontColor)
Sets the font color of this Element.
|
T |
setFontColor(Color fontColor,
float opacity)
Sets the font color of this Element and the opacity of the text.
|
T |
setFontFamily(List<String> fontFamilyNames)
Sets the preferable font families for this Element.
|
T |
setFontFamily(String... fontFamilyNames)
Sets the preferable font families for this Element.
|
T |
setFontKerning(FontKerning fontKerning)
Enable or disable kerning.
|
T |
setFontScript(Character.UnicodeScript script)
Sets the writing system for this text element.
|
T |
setFontSize(float fontSize)
Sets the font size of this Element, measured in points.
|
T |
setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
Sets the horizontal alignment of this Element.
|
T |
setHyphenation(HyphenationConfig hyphenationConfig)
Sets a custom hyphenation configuration which will hyphenate words automatically accordingly to the
language and country.
|
T |
setItalic()
Switch on the simulation of italic style for a font.
|
T |
setLineThrough()
Sets default line-through attributes for text.
|
T |
setOpacity(Float opacity)
Sets an opacity of the given element.
|
void |
setProperty(int property,
Object value)
Sets a property for this entity.
|
T |
setRelativePosition(float left,
float top,
float right,
float bottom)
Sets values for a relative repositioning of the Element.
|
T |
setSplitCharacters(ISplitCharacters splitCharacters)
Sets a rule for splitting strings when they don't fit into one line.
|
T |
setStrokeColor(Color strokeColor)
Sets the stroke color for the current element.
|
T |
setStrokeWidth(float strokeWidth)
Sets the stroke width for the current element.
|
T |
setTextAlignment(TextAlignment alignment)
Sets the text alignment of this Element.
|
T |
setTextRenderingMode(int textRenderingMode)
Sets the text rendering mode, a variable that determines whether showing
text causes glyph outlines to be stroked, filled, used as a clipping
boundary, or some combination of the three.
|
T |
setUnderline()
Sets default underline attributes for text.
|
T |
setUnderline(Color color,
float opacity,
float thickness,
float thicknessMul,
float yPosition,
float yPositionMul,
int lineCapStyle)
Sets an horizontal line that can be an underline or a strikethrough.
|
T |
setUnderline(Color color,
float thickness,
float thicknessMul,
float yPosition,
float yPositionMul,
int lineCapStyle)
Sets an horizontal line that can be an underline or a strikethrough.
|
T |
setUnderline(float thickness,
float yPosition)
Sets an horizontal line that can be an underline or a strikethrough.
|
T |
setWordSpacing(float wordSpacing)
Defines a custom spacing distance between words of a textual element.
|
public void setProperty(int property,
Object value)
IPropertyContainersetProperty in interface IPropertyContainerproperty - the property to be setvalue - the value of the propertypublic boolean hasProperty(int property)
IPropertyContainerIPropertyContainer.hasOwnProperty(int),
this method can check parent's properties, styles, etc, depending on the origin of the instancehasProperty in interface IPropertyContainerproperty - the property to be checkedtrue if this instance has given property, false otherwisepublic boolean hasOwnProperty(int property)
IPropertyContainerhasOwnProperty in interface IPropertyContainerproperty - the property to be checkedtrue if this instance has given own property, false otherwisepublic void deleteOwnProperty(int property)
IPropertyContainerdeleteOwnProperty in interface IPropertyContainerproperty - the property to be deletedpublic <T1> T1 getProperty(int property)
IPropertyContainerIPropertyContainer.getOwnProperty(int),
this method can check parent's properties, styles, etc, depending on the origin of the instancegetProperty in interface IPropertyContainerT1 - 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)
IPropertyContainernull will be returned.getOwnProperty in interface IPropertyContainerT1 - 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)
IPropertyContainergetDefaultProperty in interface IPropertyContainerT1 - the return type associated with the propertyproperty - the property to be retrievednull will be returnedpublic T setRelativePosition(float left, float top, float right, float bottom)
Property.POSITION is changed to
relative.
The default implementation in AbstractRenderer treats
left and top as the most important values. Only
if left == 0 will right be used for the
calculation; ditto for top vs. bottom.left - movement to the lefttop - movement upwards on the pageright - movement to the rightbottom - movement downwards on the pageLayoutPosition.RELATIVEpublic T setFixedPosition(float left, float bottom, float width)
Property.POSITION is changed to
fixed.left - horizontal position of the bottom-left corner on the pagebottom - vertical position of the bottom-left corner on the pagewidth - a floating point value measured in points.public T setFixedPosition(float left, float bottom, UnitValue width)
Property.POSITION is changed to
fixed.left - horizontal position of the bottom-left corner on the pagebottom - vertical position of the bottom-left corner on the pagewidth - a UnitValuepublic T setFixedPosition(int pageNumber, float left, float bottom, float width)
Property.POSITION is changed to
fixed.pageNumber - the page where the element must be positionedleft - horizontal position of the bottom-left corner on the pagebottom - vertical position of the bottom-left corner on the pagewidth - a floating point value measured in points.public T setFixedPosition(int pageNumber, float left, float bottom, UnitValue width)
Property.POSITION is changed to
fixed.pageNumber - the page where the element must be positionedleft - horizontal position of the bottom-left corner on the pagebottom - vertical position of the bottom-left corner on the pagewidth - a floating point value measured in points.public T setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
horizontalAlignment - an enum value of type HorizontalAlignmentpublic T setFont(PdfFont font)
This property overrides the value set by setFontFamily(java.lang.String...). Font is set either via exact PdfFont
instance or via font-family name that should correspond to the font in FontProvider, but not both.
font - a fontpublic T setFontFamily(String... fontFamilyNames)
FontProvider shall be set as well.
See RootElement.setFontProvider(FontProvider)
This property overrides the value set by setFont(PdfFont). Font is set either via exact PdfFont
instance or via font-family name that should correspond to the font in FontProvider, but not both.
All String that are passed as argument are directly handled as a collection of font family names,
without any pre-processing. Every font family name is treated as a preferable font-family to be used
inside the element. The fontFamilyNames argument is interpreted as as an ordered list,
where every next font-family should be used if font for the previous one was not found or doesn't contain required glyphs.
fontFamilyNames - defines an ordered list of preferable font families for this Element.StandardFontFamiliespublic T setFontFamily(List<String> fontFamilyNames)
FontProvider shall be set as well.
See RootElement.setFontProvider(FontProvider)
This property overrides the value set by setFont(PdfFont). Font is set either via exact PdfFont
instance or via font-family name that should correspond to the font in FontProvider, but not both.
All String that are passed as argument are directly handled as a collection of font family names,
without any pre-processing. Every font family name is treated as a preferable font-family to be used
inside the element. The fontFamilyNames argument is interpreted as as an ordered list,
where every next font-family should be used if font for the previous one was not found or doesn't contain required glyphs.
fontFamilyNames - defines an ordered list of preferable font families for this Element.StandardFontFamilies@Deprecated public T setFont(String font)
setFontFamily(String...) instead.FontProvider shall be set as well.
See RootElement.setFontProvider(FontProvider)font - a font name to fetch from FontProviderStandardFontFamiliespublic T setFontColor(Color fontColor)
fontColor - a Color for the text in this Element.public T setFontColor(Color fontColor, float opacity)
fontColor - a Color for the text in this Element.opacity - an opacity for the text in this Element; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent.public T setFontSize(float fontSize)
fontSize - a floating point valuepublic T setTextAlignment(TextAlignment alignment)
alignment - an enum value of type TextAlignmentpublic T setCharacterSpacing(float charSpacing)
charSpacing - a floating point valuepublic T setWordSpacing(float wordSpacing)
wordSpacing - a floating point valuepublic T setFontKerning(FontKerning fontKerning)
fontKerning - an enum value as a boolean wrapper specifying whether or not to apply kerningpublic T setBackgroundColor(Color backgroundColor)
backgroundColor - the background colorpublic T setBackgroundColor(Color backgroundColor, float opacity)
backgroundColor - the background coloropacity - the background color opacity; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent.public T setBackgroundColor(Color backgroundColor, float extraLeft, float extraTop, float extraRight, float extraBottom)
backgroundColor - the background colorextraLeft - extra coloring to the left sideextraTop - extra coloring at the topextraRight - extra coloring to the right sideextraBottom - extra coloring at the bottompublic T setBackgroundColor(Color backgroundColor, float opacity, float extraLeft, float extraTop, float extraRight, float extraBottom)
backgroundColor - the background coloropacity - the background color opacity; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparentextraLeft - extra coloring to the left sideextraTop - extra coloring at the topextraRight - extra coloring to the right sideextraBottom - extra coloring at the bottompublic T setBackgroundImage(BackgroundImage image)
image - BackgroundImagepublic T setBackgroundImage(List<BackgroundImage> imagesList)
imagesList - List of BackgroundImagepublic T setBorder(Border border)
border - a customized Borderpublic T setBorderTop(Border border)
border - a customized Borderpublic T setBorderRight(Border border)
border - a customized Borderpublic T setBorderBottom(Border border)
border - a customized Borderpublic T setBorderLeft(Border border)
border - a customized Borderpublic T setBorderRadius(BorderRadius borderRadius)
borderRadius - a customized BorderRadiuspublic T setBorderBottomLeftRadius(BorderRadius borderRadius)
borderRadius - a customized BorderRadiuspublic T setBorderBottomRightRadius(BorderRadius borderRadius)
borderRadius - a customized BorderRadiuspublic T setBorderTopLeftRadius(BorderRadius borderRadius)
borderRadius - a customized BorderRadiuspublic T setBorderTopRightRadius(BorderRadius borderRadius)
borderRadius - a customized BorderRadiuspublic T setSplitCharacters(ISplitCharacters splitCharacters)
DefaultSplitCharacterssplitCharacters - an implementation of ISplitCharacterspublic ISplitCharacters getSplitCharacters()
ISplitCharacterspublic Integer getTextRenderingMode()
PdfCanvasConstants.TextRenderingModepublic T setTextRenderingMode(int textRenderingMode)
textRenderingMode - an int valuePdfCanvasConstants.TextRenderingModepublic Color getStrokeColor()
public T setStrokeColor(Color strokeColor)
strokeColor - a new stroke colorpublic Float getStrokeWidth()
public T setStrokeWidth(float strokeWidth)
strokeWidth - a new stroke widthpublic T setBold()
public T setItalic()
public T setLineThrough()
setUnderline(Color, float, float, float, float, int) for more fine tuning.public T setUnderline()
public T setUnderline(float thickness, float yPosition)
thickness - the absolute thickness of the lineyPosition - the absolute y position relative to the baselinepublic T setUnderline(Color color, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
The thickness of the line will be thickness + thicknessMul * fontSize.
The position of the line will be baseLine + yPosition + yPositionMul * fontSize.
color - the color of the line or null to follow the
text colorthickness - the absolute thickness of the linethicknessMul - the thickness multiplication factor with the font sizeyPosition - the absolute y position relative to the baselineyPositionMul - the position multiplication factor with the font sizelineCapStyle - the end line cap style. Allowed values are enumerated in
PdfCanvasConstants.LineCapStylepublic T setUnderline(Color color, float opacity, float thickness, float thicknessMul, float yPosition, float yPositionMul, int lineCapStyle)
The thickness of the line will be thickness + thicknessMul * fontSize.
The position of the line will be baseLine + yPosition + yPositionMul * fontSize.
color - the color of the line or null to follow the
text coloropacity - the opacity of the line; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparentthickness - the absolute thickness of the linethicknessMul - the thickness multiplication factor with the font sizeyPosition - the absolute y position relative to the baselineyPositionMul - the position multiplication factor with the font sizelineCapStyle - the end line cap style. Allowed values are enumerated in
PdfCanvasConstants.LineCapStylepublic T setBaseDirection(BaseDirection baseDirection)
baseDirection - base directionpublic T setHyphenation(HyphenationConfig hyphenationConfig)
hyphenationConfig - The hyphenation configurationpublic T setFontScript(Character.UnicodeScript script)
script - a new script typepublic T setDestination(String destination)
destination - the destination name to be createdpublic T setOpacity(Float opacity)
opacity - a float between 0 and 1, where 1 stands for fully opaque element and 0 - for fully transparentCopyright © 1998–2020 iText Group NV. All rights reserved.