T - this type
public abstract class ElementPropertyContainerIPropertyContainer> 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.
|
|
getDefaultProperty(int property)
Gets the default property from this entity.
|
Float |
getHeight()
Gets the height property of the Element.
|
|
getOwnProperty(int property)
Gets own property from this entity.
|
|
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.
|
UnitValue |
getWidth()
Gets the width property of the Element.
|
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 |
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 |
setBorderLeft(Border border)
Sets a border for the left limit of this Element with customizable color, width, pattern type.
|
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 |
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 x, float y, float width)
Sets values for a absolute repositioning of the Element.
|
T |
setFixedPosition(float x, float y, UnitValue width)
Sets values for a absolute repositioning of the Element.
|
T |
setFixedPosition(int pageNumber, float x, float y, float width)
Sets values for a absolute repositioning of the Element.
|
T |
setFixedPosition(int pageNumber, float x, float y, 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)
Sets the font of this Element.
|
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 |
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.
|
T |
setHeight(float height)
Sets the height property of the Element.
|
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 |
setWidth(float width)
Sets the width property of the Element, measured in points.
|
T |
setWidth(UnitValue width)
Sets the width property of the Element with a UnitValue.
|
T |
setWidthPercent(float widthPercent)
Sets the width property of the Element, measured in percentage.
|
T |
setWordSpacing(float wordSpacing)
Defines a custom spacing distance between words of a textual element.
|
public void setProperty(int property,
Object value)
IPropertyContainer
setProperty in interface IPropertyContainer
property - the property to be set
value - the value of the property
public boolean hasProperty(int property)
IPropertyContainer
IPropertyContainer.hasOwnProperty(int), this method can check parent's properties, styles, etc, depending on the origin of the instance
hasProperty in interface IPropertyContainer
property - the property to be checked
true if this instance has given property, false otherwise
public boolean hasOwnProperty(int property)
IPropertyContainer
hasOwnProperty in interface IPropertyContainer
property - the property to be checked
true if this instance has given own property, false otherwise
public void deleteOwnProperty(int property)
IPropertyContainer
deleteOwnProperty in interface IPropertyContainer
property - the property to be deleted
publicT1 getProperty(int property)
IPropertyContainer
IPropertyContainer.getOwnProperty(int), this method can check parent's properties, styles, etc, depending on the origin of the instance
getProperty in interface IPropertyContainer
T1 - the return type associated with the property
property - the property to be retrieved
null will be returned if the property value was not found
publicT1 getOwnProperty(int property)
IPropertyContainer
null will be returned.
getOwnProperty in interface IPropertyContainer
T1 - the return type associated with the property
property - the property to be retrieved
null will be returned if the property value was not found
publicT1 getDefaultProperty(int property)
IPropertyContainer
getDefaultProperty in interface IPropertyContainer
T1 - the return type associated with the property
property - the property to be retrieved
null will be returned
public UnitValue getWidth()
UnitValue
public T setWidth(float width)
width - a value measured in points.
public T setWidthPercent(float widthPercent)
widthPercent - a value measured in percentage.
public T setWidth(UnitValue width)
UnitValue.
width - a UnitValue object
public Float getHeight()
public T setHeight(float height)
height - a floating point value for the new height
public 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 left
top - movement upwards on the page
right - movement to the right
bottom - movement downwards on the page
LayoutPosition.RELATIVE
public T setFixedPosition(float x, float y, float width)
Property.POSITION is changed to fixed.
x - horizontal position of the bottom-left corner on the page
y - vertical position of the bottom-left corner on the page
width - a floating point value measured in points.
public T setFixedPosition(float x, float y, UnitValue width)
Property.POSITION is changed to fixed.
x - horizontal position of the bottom-left corner on the page
y - vertical position of the bottom-left corner on the page
width - a UnitValue
public T setFixedPosition(int pageNumber, float x, float y, float width)
Property.POSITION is changed to fixed.
pageNumber - the page where the element must be positioned
x - horizontal position of the bottom-left corner on the page
y - vertical position of the bottom-left corner on the page
width - a floating point value measured in points.
public T setFixedPosition(int pageNumber, float x, float y, UnitValue width)
Property.POSITION is changed to fixed.
pageNumber - the page where the element must be positioned
x - horizontal position of the bottom-left corner on the page
y - vertical position of the bottom-left corner on the page
width - a floating point value measured in points.
public T setHorizontalAlignment(HorizontalAlignment horizontalAlignment)
horizontalAlignment - an enum value of type HorizontalAlignment
public T setFont(PdfFont font)
font - a font
public T setFont(String font)
FontProvider shall be set as well. See RootElement.setFontProvider(FontProvider)
font - a font name to fetch from FontProvider
public 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 value
public T setTextAlignment(TextAlignment alignment)
alignment - an enum value of type TextAlignment
public T setCharacterSpacing(float charSpacing)
charSpacing - a floating point value
public T setWordSpacing(float wordSpacing)
wordSpacing - a floating point value
public T setFontKerning(FontKerning fontKerning)
fontKerning - an enum value as a boolean wrapper specifying whether or not to apply kerning
public T setBackgroundColor(Color backgroundColor)
backgroundColor - the background color
public T setBackgroundColor(Color backgroundColor, float opacity)
backgroundColor - the background color
opacity - 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 color
extraLeft - extra coloring to the left side
extraTop - extra coloring at the top
extraRight - extra coloring to the right side
extraBottom - extra coloring at the bottom
public T setBackgroundColor(Color backgroundColor, float opacity, float extraLeft, float extraTop, float extraRight, float extraBottom)
backgroundColor - the background color
opacity - the background color opacity; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
extraLeft - extra coloring to the left side
extraTop - extra coloring at the top
extraRight - extra coloring to the right side
extraBottom - extra coloring at the bottom
public T setBorder(Border border)
border - a customized Border
public T setBorderTop(Border border)
border - a customized Border
public T setBorderRight(Border border)
border - a customized Border
public T setBorderBottom(Border border)
border - a customized Border
public T setBorderLeft(Border border)
border - a customized Border
public T setSplitCharacters(ISplitCharacters splitCharacters)
DefaultSplitCharacters
splitCharacters - an implementation of ISplitCharacters
public ISplitCharacters getSplitCharacters()
ISplitCharacters
public Integer getTextRenderingMode()
PdfCanvasConstants.TextRenderingMode
public T setTextRenderingMode(int textRenderingMode)
textRenderingMode - an int value
PdfCanvasConstants.TextRenderingMode
public Color getStrokeColor()
public T setStrokeColor(Color strokeColor)
strokeColor - a new stroke color
public Float getStrokeWidth()
public T setStrokeWidth(float strokeWidth)
strokeWidth - a new stroke width
public 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 line
yPosition - the absolute y position relative to the baseline
public 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 color
thickness - the absolute thickness of the line
thicknessMul - the thickness multiplication factor with the font size
yPosition - the absolute y position relative to the baseline
yPositionMul - the position multiplication factor with the font size
lineCapStyle - the end line cap style. Allowed values are enumerated in PdfCanvasConstants.LineCapStyle
public 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 color
opacity - the opacity of the line; a float between 0 and 1, where 1 stands for fully opaque color and 0 - for fully transparent
thickness - the absolute thickness of the line
thicknessMul - the thickness multiplication factor with the font size
yPosition - the absolute y position relative to the baseline
yPositionMul - the position multiplication factor with the font size
lineCapStyle - the end line cap style. Allowed values are enumerated in PdfCanvasConstants.LineCapStyle
public T setBaseDirection(BaseDirection baseDirection)
baseDirection - base direction
public T setHyphenation(HyphenationConfig hyphenationConfig)
hyphenationConfig -
public T setFontScript(Character.UnicodeScript script)
script - a new script type
public T setDestination(String destination)
destination - the destination name to be created
public T setOpacity(Float opacity)
opacity - a float between 0 and 1, where 1 stands for fully opaque element and 0 - for fully transparent
Copyright © 1998–2017 iText Group NV. All rights reserved.