T
- the type of the implementation
public abstract class BlockElementIElement> extends AbstractElementimplements IAccessibleElement
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, styles
properties
Modifier | Constructor and Description |
---|---|
protected |
BlockElement()
Creates a BlockElement.
|
Modifier and Type | Method and Description |
---|---|
Float |
getMarginBottom()
Gets the current bottom margin width of the element.
|
Float |
getMarginLeft()
Gets the current left margin width of the element.
|
Float |
getMarginRight()
Gets the current right margin width of the element.
|
Float |
getMarginTop()
Gets the current top margin width of the element.
|
Float |
getPaddingBottom()
Gets the current bottom padding width of the element.
|
Float |
getPaddingLeft()
Gets the current left padding width of the element.
|
Float |
getPaddingRight()
Gets the current right padding width of the element.
|
Float |
getPaddingTop()
Gets the current top padding width of the 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 |
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 |
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.
|
addStyle, createRendererSubTree, getProperty, getRenderer, hasProperty, isEmpty, makeNewRenderer, propagateArtifactRoleToChildElements, setAction, setNextRenderer, setPageNumber
deleteOwnProperty, getDefaultProperty, getHeight, getOwnProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, getWidth, hasOwnProperty, setBackgroundColor, setBackgroundColor, setBaseDirection, setBold, setBorder, setBorderBottom, setBorderLeft, setBorderRight, setBorderTop, setCharacterSpacing, setDestination, setFixedPosition, setFixedPosition, setFixedPosition, setFixedPosition, setFont, setFontColor, setFontKerning, setFontScript, setFontSize, setHeight, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setWidth, setWidth, setWidthPercent, setWordSpacing
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAccessibilityProperties, getRole, setRole
deleteOwnProperty, getDefaultProperty, getOwnProperty, hasOwnProperty, setProperty
public Float getMarginLeft()
float
public T setMarginLeft(float value)
value
- the new left margin width
public Float getMarginRight()
float
public T setMarginRight(float value)
value
- the new right margin width
public Float getMarginTop()
float
public T setMarginTop(float value)
value
- the new top margin width
public Float getMarginBottom()
float
public T setMarginBottom(float value)
value
- the new bottom margin width
public T setMargin(float commonMargin)
commonMargin
- the new margin width
public T setMargins(float marginTop, float marginRight, float marginBottom, float marginLeft)
marginTop
- the new margin top width
marginRight
- the new margin right width
marginBottom
- the new margin bottom width
marginLeft
- the new margin left width
public Float getPaddingLeft()
float
public T setPaddingLeft(float value)
value
- the new left padding width
public Float getPaddingRight()
float
public T setPaddingRight(float value)
value
- the new right padding width
public Float getPaddingTop()
float
public T setPaddingTop(float value)
value
- the new top padding width
public Float getPaddingBottom()
float
public T setPaddingBottom(float value)
value
- the new bottom padding width
public T setPadding(float commonPadding)
commonPadding
- the new padding width
public T setPaddings(float paddingTop, float paddingRight, float paddingBottom, float paddingLeft)
paddingTop
- the new padding top width
paddingRight
- the new padding right width
paddingBottom
- the new padding bottom width
paddingLeft
- the new padding left width
public T setVerticalAlignment(VerticalAlignment verticalAlignment)
verticalAlignment
- the vertical alignment setting
public 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
property
public T setKeepTogether(boolean keepTogether)
BlockElement
should be kept together as much as possible.
keepTogether
- the new value of the Property.KEEP_TOGETHER
property
public Boolean isKeepWithNext()
BlockElement
and the start of the next sibling of this element should be placed in the same area.
Property.KEEP_WITH_NEXT
property
public 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
property
public T setRotationAngle(float angleInRadians)
angleInRadians
- the new rotation radAngle, as a float
, in radians
public T setRotationAngle(double angleInRadians)
angleInRadians
- the new rotation angle, as a double
, in radians
Copyright © 1998–2016 iText Group NV. All rights reserved.