public class Style extends ElementPropertyContainer<Style>
AbstractElement
. The properties set via Style have a lower priority than directly set properties. For example, if the same property is set directly and added via Style, then, no matter in which order they are set, the one set directly will be chosen.
properties
Modifier and Type | Method and Description |
---|---|
UnitValue |
getHeight()
Gets the height property of the 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 the element.
|
Boolean |
isKeepTogether()
Returns whether the BlockElement should be kept together as much as possible.
|
Style |
setHeight(float height)
Sets the height property the element as a point-value.
|
Style |
setHeight(UnitValue height)
Sets the height property of the element with a UnitValue .
|
Style |
setKeepTogether(boolean keepTogether)
Sets whether the BlockElement should be kept together as much as possible.
|
Style |
setMargin(float commonMargin)
Sets all margins around the element to the same width.
|
Style |
setMarginBottom(float value)
Sets the bottom margin width of the element.
|
Style |
setMarginLeft(float value)
Sets the left margin width of the element.
|
Style |
setMarginRight(float value)
Sets the right margin width of the element.
|
Style |
setMargins(float marginTop, float marginRight, float marginBottom, float marginLeft)
Sets the margins around the element to a series of new widths.
|
Style |
setMarginTop(float value)
Sets the top margin width of the element.
|
Style |
setMaxHeight(float maxHeight)
Sets the max-height of the element as point-unit value.
|
Style |
setMaxHeight(UnitValue maxHeight)
Sets the max-height property of the element with a UnitValue .
|
Style |
setMaxWidth(float maxWidth)
Sets the max-width of the element as point-unit value.
|
Style |
setMaxWidth(UnitValue maxWidth)
Sets the max-width property of the element with a UnitValue .
|
Style |
setMinHeight(float minHeight)
Sets the min-height of the element as point-unit value.
|
Style |
setMinHeight(UnitValue minHeight)
Sets the min-height property of the element with a UnitValue .
|
Style |
setMinWidth(float minWidth)
Sets the min-width of the element as point-unit value.
|
Style |
setMinWidth(UnitValue minWidth)
Sets the min-width property of the element with a UnitValue .
|
Style |
setPadding(float commonPadding)
Sets all paddings around the element to the same width.
|
Style |
setPaddingBottom(float value)
Sets the bottom padding width of the element.
|
Style |
setPaddingLeft(float value)
Sets the left padding width of the element.
|
Style |
setPaddingRight(float value)
Sets the right padding width of the element.
|
Style |
setPaddings(float paddingTop, float paddingRight, float paddingBottom, float paddingLeft)
Sets the paddings around the element to a series of new widths.
|
Style |
setPaddingTop(float value)
Sets the top padding width of the element.
|
Style |
setRotationAngle(double angle)
Sets the rotation angle.
|
Style |
setRotationAngle(float radAngle)
Sets the rotation radAngle.
|
Style |
setSpacingRatio(float ratio)
Sets a ratio which determines in which proportion will word spacing and character spacing be applied when horizontal alignment is justified.
|
Style |
setVerticalAlignment(VerticalAlignment verticalAlignment)
Sets the vertical alignment of the element.
|
Style |
setWidth(float width)
Sets the width property of the element, measured in points.
|
Style |
setWidth(UnitValue width)
Sets the width property of the element with a UnitValue .
|
deleteOwnProperty, getDefaultProperty, getOwnProperty, getProperty, getSplitCharacters, getStrokeColor, getStrokeWidth, getTextRenderingMode, hasOwnProperty, hasProperty, 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, setFontColor, setFontColor, setFontFamily, setFontFamily, setFontKerning, setFontScript, setFontSize, setHorizontalAlignment, setHyphenation, setItalic, setLineThrough, setOpacity, setProperty, setRelativePosition, setSplitCharacters, setStrokeColor, setStrokeWidth, setTextAlignment, setTextRenderingMode, setUnderline, setUnderline, setUnderline, setUnderline, setWordSpacing
public Style()
public Style(Style style)
public UnitValue getMarginLeft()
UnitValue
object
public Style setMarginLeft(float value)
value
- the new left margin width
public UnitValue getMarginRight()
UnitValue
object
public Style setMarginRight(float value)
value
- the new right margin width
public UnitValue getMarginTop()
UnitValue
object
public Style setMarginTop(float value)
value
- the new top margin width
public UnitValue getMarginBottom()
UnitValue
object
public Style setMarginBottom(float value)
value
- the new bottom margin width
public Style setMargin(float commonMargin)
commonMargin
- the new margin width
public Style 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 UnitValue getPaddingLeft()
UnitValue
object
public Style setPaddingLeft(float value)
value
- the new left padding width
public UnitValue getPaddingRight()
UnitValue
object
public Style setPaddingRight(float value)
value
- the new right padding width
public UnitValue getPaddingTop()
UnitValue
object
public Style setPaddingTop(float value)
value
- the new top padding width
public UnitValue getPaddingBottom()
UnitValue
object
public Style setPaddingBottom(float value)
value
- the new bottom padding width
public Style setPadding(float commonPadding)
commonPadding
- the new padding width
public Style 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 Style setVerticalAlignment(VerticalAlignment verticalAlignment)
verticalAlignment
- the vertical alignment setting
public Style 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 Style setKeepTogether(boolean keepTogether)
BlockElement
should be kept together as much as possible.
keepTogether
- the new value of the Property.KEEP_TOGETHER
property
public Style setRotationAngle(float radAngle)
radAngle
- the new rotation radAngle, as a float
public Style setRotationAngle(double angle)
angle
- the new rotation angle, as a double
public Style setWidth(float width)
width
- a value measured in points.
public Style setWidth(UnitValue width)
UnitValue
.
width
- a UnitValue
object
public UnitValue getWidth()
UnitValue
public Style setHeight(UnitValue height)
UnitValue
.
height
- a UnitValue
object
public Style setHeight(float height)
height
- a floating point value for the new height
public UnitValue getHeight()
public Style setMaxHeight(float maxHeight)
maxHeight
- a floating point value for the new max-height
public Style setMaxHeight(UnitValue maxHeight)
UnitValue
.
maxHeight
- a UnitValue
object
public Style setMinHeight(UnitValue minHeight)
UnitValue
.
minHeight
- a UnitValue
object
public Style setMinHeight(float minHeight)
minHeight
- a floating point value for the new min-height
public Style setMaxWidth(UnitValue maxWidth)
UnitValue
.
maxWidth
- a UnitValue
object
public Style setMaxWidth(float maxWidth)
maxWidth
- a floating point value for the new max-width
public Style setMinWidth(UnitValue minWidth)
UnitValue
.
minWidth
- a UnitValue
object
public Style setMinWidth(float minWidth)
minWidth
- a floating point value for the new min-width
Copyright © 1998–2022 iText Group NV. All rights reserved.