T - the type of the implementationpublic abstract class BlockElement<T extends IElement> extends AbstractElement<T> implements IAccessibleElement, IBlockElement
BlockElement will try to take up as much horizontal space as
available to it on the canvas or page. The concept is comparable to the block
element in HTML. Also like in HTML, the visual representation of the object
can be delimited by padding, a border, and/or a margin.childElements, nextRenderer, stylesproperties| Modifier | Constructor and Description |
|---|---|
protected |
BlockElement()
Creates a BlockElement.
|
| Modifier and Type | Method and Description |
|---|---|
<T1> T1 |
getDefaultProperty(int property)
Gets the default property from this entity.
|
UnitValue |
getHeight()
Gets the height property of a block element.
|
UnitValue |
getMarginBottom()
Gets the current bottom margin width of the element.
|
UnitValue |
getMarginLeft()
Gets the current left margin width of the element.
|
UnitValue |
getMarginRight()
Gets the current right margin width of the element.
|
UnitValue |
getMarginTop()
Gets the current top margin width of the element.
|
UnitValue |
getPaddingBottom()
Gets the current bottom padding width of the element.
|
UnitValue |
getPaddingLeft()
Gets the current left padding width of the element.
|
UnitValue |
getPaddingRight()
Gets the current right padding width of the element.
|
UnitValue |
getPaddingTop()
Gets the current top padding width of the element.
|
UnitValue |
getWidth()
Gets the width property of a block element.
|
Boolean |
isKeepTogether()
Returns whether the
BlockElement should be kept together as much
as possible. |
Boolean |
isKeepWithNext()
Returns whether the end of this
BlockElement and the start of the next sibling of this element
should be placed in the same area. |
T |
setHeight(float height)
Sets the height property a block element as a point-value.
|
T |
setHeight(UnitValue height)
Sets the height property of a block element with a
UnitValue. |
T |
setKeepTogether(boolean keepTogether)
Sets whether the
BlockElement should be kept together as much
as possible. |
T |
setKeepWithNext(boolean keepWithNext)
Sets whether the end of this
BlockElement and the start of the next sibling of this element
should be placed in the same area. |
T |
setMargin(float commonMargin)
Sets all margins around the element to the same width.
|
T |
setMarginBottom(float value)
Sets the bottom margin width of the element.
|
T |
setMarginLeft(float value)
Sets the left margin width of the element.
|
T |
setMarginRight(float value)
Sets the right margin width of the element.
|
T |
setMargins(float marginTop,
float marginRight,
float marginBottom,
float marginLeft)
Sets the margins around the element to a series of new widths.
|
T |
setMarginTop(float value)
Sets the top margin width of the element.
|
T |
setMaxHeight(float maxHeight)
Sets the max-height of a block element as point-unit value.
|
T |
setMaxHeight(UnitValue maxHeight)
Sets the max-height property of a block element with a
UnitValue. |
T |
setMaxWidth(float maxWidth)
Sets the max-width of a block element as point-unit value.
|
T |
setMaxWidth(UnitValue maxWidth)
Sets the max-width property of a block element with a
UnitValue. |
T |
setMinHeight(float minHeight)
Sets the min-height of a block element as point-unit value.
|
T |
setMinHeight(UnitValue minHeight)
Sets the min-height property of a block element with a
UnitValue. |
T |
setMinWidth(float minWidth)
Sets the min-width of a block element as point-unit value.
|
T |
setMinWidth(UnitValue minWidth)
Sets the min-width property of a block element with a
UnitValue. |
T |
setPadding(float commonPadding)
Sets all paddings around the element to the same width.
|
T |
setPaddingBottom(float value)
Sets the bottom padding width of the element.
|
T |
setPaddingLeft(float value)
Sets the left padding width of the element.
|
T |
setPaddingRight(float value)
Sets the right padding width of the element.
|
T |
setPaddings(float paddingTop,
float paddingRight,
float paddingBottom,
float paddingLeft)
Sets the paddings around the element to a series of new widths.
|
T |
setPaddingTop(float value)
Sets the top padding width of the element.
|
T |
setRotationAngle(double angleInRadians)
Sets the rotation angle.
|
T |
setRotationAngle(float angleInRadians)
Sets the rotation radAngle.
|
T |
setSpacingRatio(float ratio)
Sets a ratio which determines in which proportion will word spacing and character spacing
be applied when horizontal alignment is justified.
|
T |
setVerticalAlignment(VerticalAlignment verticalAlignment)
Sets the vertical alignment of the element.
|
T |
setWidth(float width)
Sets the width property of a block element, measured in points.
|
T |
setWidth(UnitValue width)
Sets the width property of a block element with a
UnitValue. |
addStyle, createRendererSubTree, getChildren, getProperty, getRenderer, hasProperty, isEmpty, makeNewRenderer, setAction, setNextRenderer, setPageNumberdeleteOwnProperty, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundImage, setBackgroundImage, 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, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAccessibilityPropertiescreateRendererSubTree, getRenderer, setNextRendererdeleteOwnProperty, getOwnProperty, getProperty, hasOwnProperty, hasProperty, setPropertypublic <T1> T1 getDefaultProperty(int property)
IPropertyContainergetDefaultProperty in interface IPropertyContainergetDefaultProperty in class ElementPropertyContainer<T extends IElement>T1 - the return type associated with the propertyproperty - the property to be retrievednull will be returnedpublic UnitValue getMarginLeft()
UnitValue objectpublic T setMarginLeft(float value)
value - the new left margin widthpublic UnitValue getMarginRight()
UnitValue objectpublic T setMarginRight(float value)
value - the new right margin widthpublic UnitValue getMarginTop()
UnitValue objectpublic T setMarginTop(float value)
value - the new top margin widthpublic UnitValue getMarginBottom()
UnitValue objectpublic T setMarginBottom(float value)
value - the new bottom margin widthpublic T setMargin(float commonMargin)
commonMargin - the new margin widthpublic T setMargins(float marginTop, float marginRight, float marginBottom, float marginLeft)
marginTop - the new margin top widthmarginRight - the new margin right widthmarginBottom - the new margin bottom widthmarginLeft - the new margin left widthpublic UnitValue getPaddingLeft()
UnitValue objectpublic T setPaddingLeft(float value)
value - the new left padding widthpublic UnitValue getPaddingRight()
UnitValue objectpublic T setPaddingRight(float value)
value - the new right padding widthpublic UnitValue getPaddingTop()
UnitValue objectpublic T setPaddingTop(float value)
value - the new top padding widthpublic UnitValue getPaddingBottom()
UnitValue objectpublic T setPaddingBottom(float value)
value - the new bottom padding widthpublic T setPadding(float commonPadding)
commonPadding - the new padding widthpublic T setPaddings(float paddingTop, float paddingRight, float paddingBottom, float paddingLeft)
paddingTop - the new padding top widthpaddingRight - the new padding right widthpaddingBottom - the new padding bottom widthpaddingLeft - the new padding left widthpublic T setVerticalAlignment(VerticalAlignment verticalAlignment)
verticalAlignment - the vertical alignment settingpublic T setSpacingRatio(float ratio)
ratio - the ratio coefficient. It must be between 0 and 1, inclusive.
It means that ratio part of the free space will
be compensated by word spacing, and 1-ratio part of the free space will
be compensated by character spacing.
If ratio is 1, additional character spacing will not be applied.
If ratio is 0, additional word spacing will not be applied.public Boolean isKeepTogether()
BlockElement should be kept together as much
as possible.Property.KEEP_TOGETHER propertypublic T setKeepTogether(boolean keepTogether)
BlockElement should be kept together as much
as possible.keepTogether - the new value of the Property.KEEP_TOGETHER propertypublic Boolean isKeepWithNext()
BlockElement and the start of the next sibling of this element
should be placed in the same area.Property.KEEP_WITH_NEXT propertypublic T setKeepWithNext(boolean keepWithNext)
BlockElement and the start of the next sibling of this element
should be placed in the same area.
Note that this will only work for high-level elements, i.e. elements added to the RootElement.keepWithNext - the new value of the Property.KEEP_WITH_NEXT propertypublic T setRotationAngle(float angleInRadians)
angleInRadians - the new rotation radAngle, as a float, in radianspublic T setRotationAngle(double angleInRadians)
angleInRadians - the new rotation angle, as a double, in radianspublic T setWidth(float width)
width - a value measured in points.public T setWidth(UnitValue width)
UnitValue.width - a UnitValue objectpublic UnitValue getWidth()
UnitValuepublic T setHeight(UnitValue height)
UnitValue.height - a UnitValue objectpublic T setHeight(float height)
height - a floating point value for the new heightpublic UnitValue getHeight()
public T setMaxHeight(float maxHeight)
maxHeight - a floating point value for the new max-heightpublic T setMaxHeight(UnitValue maxHeight)
UnitValue.maxHeight - a UnitValue objectpublic T setMinHeight(UnitValue minHeight)
UnitValue.minHeight - a UnitValue objectpublic T setMinHeight(float minHeight)
minHeight - a floating point value for the new min-heightpublic T setMaxWidth(UnitValue maxWidth)
UnitValue.maxWidth - a UnitValue objectpublic T setMaxWidth(float maxWidth)
maxWidth - a floating point value for the new max-widthpublic T setMinWidth(UnitValue minWidth)
UnitValue.minWidth - a UnitValue objectpublic T setMinWidth(float minWidth)
minWidth - a floating point value for the new min-widthCopyright © 1998–2020 iText Group NV. All rights reserved.