public class CalculatedStyle
extends java.lang.Object
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.Modifier and Type | Field and Description |
---|---|
static int |
BOTTOM |
static int |
LEFT |
static int |
RIGHT |
static int |
TOP |
Modifier and Type | Method and Description |
---|---|
FSColor |
asColor(CSSName cssName) |
float |
asFloat(CSSName cssName) |
Length |
asLength(CssContext c,
CSSName cssName) |
java.lang.String |
asString(CSSName cssName) |
java.lang.String[] |
asStringArray(CSSName cssName) |
int |
countAssigned() |
CalculatedStyle |
createAnonymousStyle(IdentValue display) |
CalculatedStyle |
deriveStyle(CascadedStyle matched)
derives a child style from this style.
|
boolean |
establishesBFC() |
IdentValue |
getBackgroundAttachment() |
FSColor |
getBackgroundColor()
Convenience property accessor; returns a Color initialized with the
background color value; Uses the actual value (computed actual value) for
this element.
|
BackgroundPosition |
getBackgroundPosition() |
IdentValue |
getBackgroundRepeat() |
BorderPropertySet |
getBorder(CssContext ctx) |
int |
getBorderHSpacing(CssContext c) |
int |
getBorderVSpacing(CssContext c) |
RectPropertySet |
getCachedMargin() |
RectPropertySet |
getCachedPadding() |
FSColor |
getColor()
Convenience property accessor; returns a Color initialized with the
foreground color Uses the actual value (computed actual value) for this
element.
|
int |
getColSpan() |
java.util.List |
getCounterIncrement() |
java.util.List |
getCounterReset() |
java.awt.Cursor |
getCursor() |
float |
getFloatPropertyProportionalHeight(CSSName cssName,
float parentHeight,
CssContext ctx) |
float |
getFloatPropertyProportionalTo(CSSName cssName,
float baseValue,
CssContext ctx) |
float |
getFloatPropertyProportionalWidth(CSSName cssName,
float parentWidth,
CssContext ctx) |
FontSpecification |
getFont(CssContext ctx) |
FSFont |
getFSFont(CssContext cssContext) |
FSFontMetrics |
getFSFontMetrics(CssContext c) |
IdentValue |
getIdent(CSSName cssName)
Gets the ident attribute of the CalculatedStyle object
|
float |
getLineHeight(CssContext ctx) |
int |
getMarginBorderPadding(CssContext cssCtx,
int cbWidth,
int which) |
RectPropertySet |
getMarginRect(float cbWidth,
CssContext ctx)
Convenience property accessor; returns a Border initialized with the
four-sided margin width.
|
RectPropertySet |
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) |
RectPropertySet |
getPaddingRect(float cbWidth,
CssContext ctx) |
RectPropertySet |
getPaddingRect(float cbWidth,
CssContext ctx,
boolean useCache)
Convenience property accessor; returns a Border initialized with the
four-sided padding width.
|
CalculatedStyle |
getParent()
Returns the parent style.
|
int |
getRowSpan() |
java.lang.String |
getRunningName() |
java.lang.String |
getStringProperty(CSSName cssName) |
java.util.List |
getTextDecorations() |
IdentValue |
getWhitespace() |
boolean |
hasAbsoluteUnit(CSSName cssName) |
boolean |
isAbsFixedOrInlineBlockEquiv() |
boolean |
isAbsolute() |
boolean |
isAutoHeight() |
boolean |
isAutoWidth() |
boolean |
isAutoZIndex() |
boolean |
isAvoidPageBreakInside() |
boolean |
isBlockEquivalent() |
boolean |
isBottomAuto() |
boolean |
isCleared() |
boolean |
isClearLeft() |
boolean |
isClearRight() |
boolean |
isCollapseBorders() |
boolean |
isDisplayNone() |
boolean |
isFixed() |
boolean |
isFixedBackground() |
boolean |
isFloated() |
boolean |
isFloatedLeft() |
boolean |
isFloatedRight() |
boolean |
isForcePageBreakAfter() |
boolean |
isForcePageBreakBefore() |
boolean |
isHasBackground() |
boolean |
isHorizontalBackgroundRepeat() |
boolean |
isIdent(CSSName cssName,
IdentValue val)
Gets the ident attribute of the CalculatedStyle object
|
boolean |
isInline() |
boolean |
isInlineBlock() |
boolean |
isInlineTable() |
boolean |
isKeepWithInline() |
boolean |
isLayedOutInInlineContext() |
boolean |
isLength(CSSName cssName)
TODO: doc
|
boolean |
isLengthOrNumber(CSSName cssName) |
boolean |
isListItem() |
boolean |
isListMarkerInside() |
boolean |
isMaxHeightNone() |
boolean |
isMaxWidthNone() |
boolean |
isMayCollapseMarginsWithChildren() |
boolean |
isNeedAutoMarginResolution() |
boolean |
isNonFlowContent() |
boolean |
isOverflowApplies() |
boolean |
isPaginateTable() |
boolean |
isPositioned() |
boolean |
isPostionedOrFloated() |
boolean |
isRelative() |
boolean |
isRunning() |
boolean |
isShowEmptyCells() |
boolean |
isSpecifiedAsBlock() |
boolean |
isTable() |
boolean |
isTableCaption() |
boolean |
isTableCell() |
boolean |
isTableFooter() |
boolean |
isTableHeader() |
boolean |
isTableRow() |
boolean |
isTableSection() |
boolean |
isTextJustify() |
boolean |
isTopAuto() |
boolean |
isVerticalBackgroundRepeat() |
boolean |
isVisible() |
boolean |
mayHaveFirstLetter() |
boolean |
mayHaveFirstLine() |
boolean |
requiresLayer() |
java.lang.String |
toString()
Converts to a String representation of the object.
|
FSDerivedValue |
valueByName(CSSName cssName)
Returns a
FSDerivedValue by name. |
public static final int LEFT
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
public CalculatedStyle deriveStyle(CascadedStyle matched)
matched
- the CascadedStyle to applypublic int countAssigned()
public CalculatedStyle getParent()
public java.lang.String toString()
toString
in class java.lang.Object
public float asFloat(CSSName cssName)
public java.lang.String asString(CSSName cssName)
public java.lang.String[] asStringArray(CSSName cssName)
public boolean hasAbsoluteUnit(CSSName cssName)
public boolean isIdent(CSSName cssName, IdentValue val)
cssName
- PARAMval
- PARAMpublic IdentValue getIdent(CSSName cssName)
cssName
- PARAMpublic FSColor getColor()
public FSColor getBackgroundColor()
public BackgroundPosition getBackgroundPosition()
public java.util.List getCounterReset()
public java.util.List getCounterIncrement()
public BorderPropertySet getBorder(CssContext ctx)
public FontSpecification getFont(CssContext ctx)
public float getFloatPropertyProportionalTo(CSSName cssName, float baseValue, CssContext ctx)
public float getFloatPropertyProportionalWidth(CSSName cssName, float parentWidth, CssContext ctx)
cssName
- parentWidth
- ctx
- public float getFloatPropertyProportionalHeight(CSSName cssName, float parentHeight, CssContext ctx)
cssName
- parentHeight
- ctx
- public float getLineHeight(CssContext ctx)
public RectPropertySet getMarginRect(float cbWidth, CssContext ctx)
cbWidth
- ctx
- public RectPropertySet getMarginRect(float cbWidth, CssContext ctx, boolean useCache)
public RectPropertySet getPaddingRect(float cbWidth, CssContext ctx, boolean useCache)
cbWidth
- ctx
- public RectPropertySet getPaddingRect(float cbWidth, CssContext ctx)
public java.lang.String getStringProperty(CSSName cssName)
cssName
- public boolean isLength(CSSName cssName)
public boolean isLengthOrNumber(CSSName cssName)
public FSDerivedValue valueByName(CSSName cssName)
FSDerivedValue
by name. Because we are a derived
style, the property will already be resolved at this point.cssName
- The CSS property name, e.g. "font-family"public RectPropertySet getCachedPadding()
public RectPropertySet getCachedMargin()
public int getMarginBorderPadding(CssContext cssCtx, int cbWidth, int which)
public IdentValue getWhitespace()
public FSFont getFSFont(CssContext cssContext)
public FSFontMetrics getFSFontMetrics(CssContext c)
public boolean isClearLeft()
public boolean isClearRight()
public boolean isCleared()
public IdentValue getBackgroundRepeat()
public IdentValue getBackgroundAttachment()
public boolean isFixedBackground()
public boolean isInline()
public boolean isInlineBlock()
public boolean isTable()
public boolean isInlineTable()
public boolean isTableCell()
public boolean isTableSection()
public boolean isTableCaption()
public boolean isTableHeader()
public boolean isTableFooter()
public boolean isTableRow()
public boolean isDisplayNone()
public boolean isSpecifiedAsBlock()
public boolean isBlockEquivalent()
public boolean isLayedOutInInlineContext()
public boolean isNeedAutoMarginResolution()
public boolean isAbsolute()
public boolean isFixed()
public boolean isFloated()
public boolean isFloatedLeft()
public boolean isFloatedRight()
public boolean isRelative()
public boolean isPostionedOrFloated()
public boolean isPositioned()
public boolean isAutoWidth()
public boolean isAutoHeight()
public boolean isAutoZIndex()
public boolean establishesBFC()
public boolean requiresLayer()
public boolean isRunning()
public java.lang.String getRunningName()
public boolean isOverflowApplies()
public boolean isHorizontalBackgroundRepeat()
public boolean isVerticalBackgroundRepeat()
public boolean isTopAuto()
public boolean isBottomAuto()
public boolean isListItem()
public boolean isVisible()
public boolean isForcePageBreakBefore()
public boolean isForcePageBreakAfter()
public boolean isAvoidPageBreakInside()
public CalculatedStyle createAnonymousStyle(IdentValue display)
public boolean mayHaveFirstLine()
public boolean mayHaveFirstLetter()
public boolean isNonFlowContent()
public boolean isMayCollapseMarginsWithChildren()
public boolean isAbsFixedOrInlineBlockEquiv()
public boolean isMaxWidthNone()
public boolean isMaxHeightNone()
public int getMinWidth(CssContext c, int cbWidth)
public int getMaxWidth(CssContext c, int cbWidth)
public int getMinHeight(CssContext c, int cbHeight)
public int getMaxHeight(CssContext c, int cbHeight)
public boolean isCollapseBorders()
public int getBorderHSpacing(CssContext c)
public int getBorderVSpacing(CssContext c)
public int getRowSpan()
public int getColSpan()
public Length asLength(CssContext c, CSSName cssName)
public boolean isShowEmptyCells()
public boolean isHasBackground()
public java.util.List getTextDecorations()
public java.awt.Cursor getCursor()
public boolean isPaginateTable()
public boolean isTextJustify()
public boolean isListMarkerInside()
public boolean isKeepWithInline()