Package org.xhtmlrenderer.css.style
Class CalculatedStyle
java.lang.Object
org.xhtmlrenderer.css.style.CalculatedStyle
- Direct Known Subclasses:
EmptyStyle
A set of properties that apply to a single Element, derived from all matched
properties following the rules for CSS cascade, inheritance, importance,
specificity and sequence. A derived style is just like a style but
(presumably) has additional information that allows relative properties to be
assigned values, e.g. font attributes. Property values are fully resolved
when this style is created. A property retrieved by name should always have
only one value in this class (e.g. one-one map). Any methods to retrieve
property values from an instance of this class require a valid
org.xhtmlrenderer.layout.Context
be given to it, for some cases of property
resolution. Generally, a programmer will not use this class directly, but
will retrieve properties using a StyleReference
implementation.- Author:
- Torbj�rn Gannholm, Patrick Wright
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfloat
asLength
(CssContext c, CSSName cssName) String[]
asStringArray
(CSSName cssName) int
createAnonymousStyle
(IdentValue display) deriveStyle
(CascadedStyle matched) derives a child style from this style.boolean
Convenience property accessor; returns a Color initialized with the background color value; Uses the actual value (computed actual value) for this element.getBorder
(CssContext ctx) int
int
getColor()
Convenience property accessor; returns a Color initialized with the foreground color Uses the actual value (computed actual value) for this element.int
float
getFloatPropertyProportionalHeight
(CSSName cssName, float parentHeight, CssContext ctx) float
getFloatPropertyProportionalTo
(CSSName cssName, float baseValue, CssContext ctx) float
getFloatPropertyProportionalWidth
(CSSName cssName, float parentWidth, CssContext ctx) getFont
(CssContext ctx) getFSFont
(CssContext cssContext) Gets the ident attribute of the CalculatedStyle objectfloat
getLineHeight
(CssContext ctx) int
getMarginBorderPadding
(CssContext cssCtx, int cbWidth, int which) getMarginRect
(float cbWidth, CssContext ctx) Convenience property accessor; returns a Border initialized with the four-sided margin width.getMarginRect
(float cbWidth, CssContext ctx, boolean useCache) int
getMaxHeight
(CssContext c, int cbHeight) int
getMaxWidth
(CssContext c, int cbWidth) int
getMinHeight
(CssContext c, int cbHeight) int
getMinWidth
(CssContext c, int cbWidth) getPaddingRect
(float cbWidth, CssContext ctx) getPaddingRect
(float cbWidth, CssContext ctx, boolean useCache) Convenience property accessor; returns a Border initialized with the four-sided padding width.Returns the parent style.int
getStringProperty
(CSSName cssName) boolean
hasAbsoluteUnit
(CSSName cssName) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isFixed()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isIdent
(CSSName cssName, IdentValue val) Gets the ident attribute of the CalculatedStyle objectboolean
isInline()
boolean
boolean
boolean
boolean
boolean
TODO: docboolean
isLengthOrNumber
(CSSName cssName) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
isTable()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
toString()
Converts to a String representation of the object.valueByName
(CSSName cssName) Returns aFSDerivedValue
by name.
-
Field Details
-
LEFT
public static final int LEFT- See Also:
-
RIGHT
public static final int RIGHT- See Also:
-
TOP
public static final int TOP- See Also:
-
BOTTOM
public static final int BOTTOM- See Also:
-
-
Method Details
-
deriveStyle
derives a child style from this style. depends on the ability to return the identical CascadedStyle each time a child style is needed- Parameters:
matched
- the CascadedStyle to apply- Returns:
- The derived child style
-
countAssigned
public int countAssigned() -
getParent
Returns the parent style.- Returns:
- Returns the parent style
-
toString
Converts to a String representation of the object. -
asColor
-
asFloat
-
asString
-
asStringArray
-
hasAbsoluteUnit
-
isIdent
Gets the ident attribute of the CalculatedStyle object- Parameters:
cssName
- PARAMval
- PARAM- Returns:
- The ident value
-
getIdent
Gets the ident attribute of the CalculatedStyle object- Parameters:
cssName
- PARAM- Returns:
- The ident value
-
getColor
Convenience property accessor; returns a Color initialized with the foreground color Uses the actual value (computed actual value) for this element.- Returns:
- The color value
-
getBackgroundColor
Convenience property accessor; returns a Color initialized with the background color value; Uses the actual value (computed actual value) for this element.- Returns:
- The backgroundColor value
-
getBackgroundPosition
-
getCounterReset
-
getCounterIncrement
-
getBorder
-
getFont
-
getFloatPropertyProportionalTo
-
getFloatPropertyProportionalWidth
- Parameters:
cssName
-parentWidth
-ctx
-- Returns:
- TODO
-
getFloatPropertyProportionalHeight
public float getFloatPropertyProportionalHeight(CSSName cssName, float parentHeight, CssContext ctx) - Parameters:
cssName
-parentHeight
-ctx
-- Returns:
- TODO
-
getLineHeight
-
getMarginRect
Convenience property accessor; returns a Border initialized with the four-sided margin width. Uses the actual value (computed actual value) for this element.- Parameters:
cbWidth
-ctx
-- Returns:
- The marginWidth value
-
getMarginRect
-
getPaddingRect
Convenience property accessor; returns a Border initialized with the four-sided padding width. Uses the actual value (computed actual value) for this element.- Parameters:
cbWidth
-ctx
-- Returns:
- The paddingWidth value
-
getPaddingRect
-
getStringProperty
- Parameters:
cssName
-- Returns:
- TODO
-
isLength
TODO: doc -
isLengthOrNumber
-
valueByName
Returns aFSDerivedValue
by name. Because we are a derived style, the property will already be resolved at this point.- Parameters:
cssName
- The CSS property name, e.g. "font-family"- Returns:
- See desc.
-
getCachedPadding
-
getCachedMargin
-
getMarginBorderPadding
-
getWhitespace
-
getFSFont
-
getFSFontMetrics
-
isClearLeft
public boolean isClearLeft() -
isClearRight
public boolean isClearRight() -
isCleared
public boolean isCleared() -
getBackgroundRepeat
-
getBackgroundAttachment
-
isFixedBackground
public boolean isFixedBackground() -
isInline
public boolean isInline() -
isInlineBlock
public boolean isInlineBlock() -
isTable
public boolean isTable() -
isInlineTable
public boolean isInlineTable() -
isTableCell
public boolean isTableCell() -
isTableSection
public boolean isTableSection() -
isTableCaption
public boolean isTableCaption() -
isTableHeader
public boolean isTableHeader() -
isTableRow
public boolean isTableRow() -
isDisplayNone
public boolean isDisplayNone() -
isSpecifiedAsBlock
public boolean isSpecifiedAsBlock() -
isBlockEquivalent
public boolean isBlockEquivalent() -
isLayedOutInInlineContext
public boolean isLayedOutInInlineContext() -
isNeedAutoMarginResolution
public boolean isNeedAutoMarginResolution() -
isAbsolute
public boolean isAbsolute() -
isFixed
public boolean isFixed() -
isFloated
public boolean isFloated() -
isFloatedLeft
public boolean isFloatedLeft() -
isFloatedRight
public boolean isFloatedRight() -
isRelative
public boolean isRelative() -
isPostionedOrFloated
public boolean isPostionedOrFloated() -
isPositioned
public boolean isPositioned() -
isAutoWidth
public boolean isAutoWidth() -
isAutoHeight
public boolean isAutoHeight() -
isAutoZIndex
public boolean isAutoZIndex() -
establishesBFC
public boolean establishesBFC() -
requiresLayer
public boolean requiresLayer() -
isRunning
public boolean isRunning() -
getRunningName
-
isOverflowApplies
public boolean isOverflowApplies() -
isHorizontalBackgroundRepeat
public boolean isHorizontalBackgroundRepeat() -
isVerticalBackgroundRepeat
public boolean isVerticalBackgroundRepeat() -
isTopAuto
public boolean isTopAuto() -
isBottomAuto
public boolean isBottomAuto() -
isListItem
public boolean isListItem() -
isVisible
public boolean isVisible() -
isForcePageBreakBefore
public boolean isForcePageBreakBefore() -
isForcePageBreakAfter
public boolean isForcePageBreakAfter() -
isAvoidPageBreakInside
public boolean isAvoidPageBreakInside() -
createAnonymousStyle
-
mayHaveFirstLine
public boolean mayHaveFirstLine() -
mayHaveFirstLetter
public boolean mayHaveFirstLetter() -
isNonFlowContent
public boolean isNonFlowContent() -
isMayCollapseMarginsWithChildren
public boolean isMayCollapseMarginsWithChildren() -
isAbsFixedOrInlineBlockEquiv
public boolean isAbsFixedOrInlineBlockEquiv() -
isMaxWidthNone
public boolean isMaxWidthNone() -
isMaxHeightNone
public boolean isMaxHeightNone() -
getMinWidth
-
getMaxWidth
-
getMinHeight
-
getMaxHeight
-
isCollapseBorders
public boolean isCollapseBorders() -
getBorderHSpacing
-
getBorderVSpacing
-
getRowSpan
public int getRowSpan() -
getColSpan
public int getColSpan() -
asLength
-
isShowEmptyCells
public boolean isShowEmptyCells() -
isHasBackground
public boolean isHasBackground() -
getTextDecorations
-
getCursor
-
isPaginateTable
public boolean isPaginateTable() -
isTextJustify
public boolean isTextJustify() -
isListMarkerInside
public boolean isListMarkerInside() -
isKeepWithInline
public boolean isKeepWithInline()
-