@API(type=NOT_EXTENDABLE,
src=PRIVATE)
public class Styles
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
counter
Constants counter
|
static float |
EX_FACTOR
This is the factor: ex-height / em-height
The ex unit is defined by the font's x-height.
|
static int |
FONT_WEIGHT_BOLD
Value for the "bold" in the font-weight propery.
|
static int |
FONT_WEIGHT_NORMAL
Value for the "normal" in the font-weight propery.
|
static int |
KEY_BACKGROUND_COLOR
Background color.
|
static int |
KEY_BACKGROUND_IMAGE
Key used to store the property 'background-image' value.
|
static int |
KEY_BACKGROUND_POSITION
Key used to store the property 'background-position' value.
|
static int |
KEY_BACKGROUND_REPEAT
Key used to store the property 'background-repeat' value.
|
static int |
KEY_BORDER_BOTTOM_COLOR
Border bottom color
|
static int |
KEY_BORDER_BOTTOM_STYLE
Border bottom style
|
static int |
KEY_BORDER_BOTTOM_WIDTH
Border bottom width
|
static int |
KEY_BORDER_LEFT_COLOR
Border left color
|
static int |
KEY_BORDER_LEFT_STYLE
Border right style
|
static int |
KEY_BORDER_LEFT_WIDTH
Border left width
|
static int |
KEY_BORDER_RIGHT_COLOR
Border right color
|
static int |
KEY_BORDER_RIGHT_STYLE
Border right style
|
static int |
KEY_BORDER_RIGHT_WIDTH
Border right width
|
static int |
KEY_BORDER_SPACING
Key for the border spacing array
|
static int |
KEY_BORDER_TOP_COLOR
Border top color
|
static int |
KEY_BORDER_TOP_STYLE
Border top style
|
static int |
KEY_BORDER_TOP_WIDTH
Border top width
|
static int |
KEY_BOTTOM
The 'bottom' property.
|
static int |
KEY_COUNTER_INCREMENT
The key for counter-increment .
|
static int |
KEY_COUNTER_RESET
The key for counter-reset .
|
static int |
KEY_DIRECT_WHITESPACE
Whitespace specified directly on the node
|
static int |
KEY_DIRECTION
Key used to store the property 'direction' value.
|
static int |
KEY_DISPLAY
Display type
|
static int |
KEY_DISPLAY_TAGS
Key used to hide sentinel markers.
|
static int |
KEY_EDITABLE
True if this view is editable
|
static int |
KEY_EMPTY_CELLS
Key used to store the property 'empty-cells' value.
|
static int |
KEY_FILTERED_OUT
Key set for filtered out nodes.
|
static int |
KEY_FOLDABLE
Key used to store the property 'foldable' value.
|
static int |
KEY_FOLDED
Key used to store the property 'folded' value.
|
static int |
KEY_FONT
Used font
|
static int |
KEY_FONT_WEIGHT
Font weight
|
static int |
KEY_FOREGROUND_COLOR
Foreground
|
static int |
KEY_HEIGHT
Height.
|
static int |
KEY_IMPOSED_DISPLAY
Key used to override the display property defined in the css.
|
static int |
KEY_LEFT
The 'left' property.
|
static int |
KEY_LINE_HEIGHT
If it is a float, it means a line height multiplier, which is relative to the
current font, and was specified as a number without metric or a percent.
|
static int |
KEY_LINK
Key used to store the URL for link elements.
|
static int |
KEY_LINK_URL
Deprecated.
since 17
|
static int |
KEY_LIST_STYLE_TYPE
List style type
|
static int |
KEY_MARGIN_BOTTOM
Margin dimensions
|
static int |
KEY_MARGIN_LEFT
Margin left
|
static int |
KEY_MARGIN_RIGHT
Margin right
|
static int |
KEY_MARGIN_TOP
Margin top
|
static int |
KEY_MAX_WIDTH
Maximum width.
|
static int |
KEY_MIN_HEIGHT
Minimum height.
|
static int |
KEY_MIN_WIDTH
Minimum width.
|
static int |
KEY_MIXED_CONTENT
Generated mixed Content property key.
|
static int |
KEY_NON_FOLDABLE_CHILD_NAME
Key used to store the property 'non foldable child name' value.
|
static int |
KEY_OUTLINE_COLOR
Outline color
|
static int |
KEY_OUTLINE_STYLE
Outline style
|
static int |
KEY_OUTLINE_WIDTH
Outline width
|
static int |
KEY_PADDING_BOTTOM
Padding dimensions
|
static int |
KEY_PADDING_LEFT
Pad left
|
static int |
KEY_PADDING_RIGHT
Pad right
|
static int |
KEY_PADDING_TOP
Pad top
|
static int |
KEY_PLACEHOLDER_CONTENT
Key used to store the property 'placeholder-content' value.
|
static int |
KEY_POSITION
The 'position' property.
|
static int |
KEY_RIGHT
The 'right' property.
|
static int |
KEY_SHOW_PLACEHOLDER
Key used to store the property 'show-placeholder' value.
|
static int |
KEY_TAGS_BACKGROUND_COLOR
Key used to store the property '-oxy-tags-background-color' value.
|
static int |
KEY_TAGS_COLOR
Key used to store the property '-oxy-tags-color' value.
|
static int |
KEY_TEXT_ALIGN
Text align
|
static int |
KEY_TEXT_DECORATION
Deprecated.
It is a shorthand now, use
KEY_TEXT_DECORATION_LINE ,
KEY_TEXT_DECORATION_COLOR , KEY_TEXT_DECORATION_STYLE instead. |
static int |
KEY_TEXT_DECORATION_COLOR
Key used to store color for text decoration.
|
static int |
KEY_TEXT_DECORATION_LINE
Key used to store 'text-decoration-line' property.
|
static int |
KEY_TEXT_DECORATION_STYLE
Key used to store 'text-decoration' property.
|
static int |
KEY_TEXT_INDENT
Text indent
|
static int |
KEY_TEXT_TRANSFORM
Text transform
|
static int |
KEY_TOP
The 'top' property.
|
static int |
KEY_UNICODE_BIDI
Key used to store the property 'unicode-bidi' value.
|
static int |
KEY_VERTICAL_ALIGN
Key for vertical align.
|
static int |
KEY_VISIBITY
Key for the 'visibility' property.
|
static int |
KEY_WHITESPACE
Whitespace
|
static int |
KEY_WIDTH
Width.
|
Constructor and Description |
---|
Styles()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBeCached()
Verify if styles can be cached.
|
java.lang.Object |
clone()
Shallow clone.
|
boolean |
equals(java.lang.Object obj) |
Color |
getBackgroundColor() |
ro.sync.ecss.css.URIContent |
getBackgroundImage()
This property sets the background image of an element.
|
ro.sync.ecss.css.BackgroundPosition |
getBackgroundPosition()
If a background position is specified, this property indicates the position of the background image
relative to its box.
|
java.lang.String |
getBackgroundRepeat()
If a background image is specified, this property specifies whether the image is repeated (tiled),
and how.
|
Color |
getBorderBottomColor() |
java.lang.String |
getBorderBottomStyle() |
int |
getBorderBottomWidth() |
Color |
getBorderLeftColor() |
java.lang.String |
getBorderLeftStyle() |
int |
getBorderLeftWidth() |
Color |
getBorderRightColor() |
java.lang.String |
getBorderRightStyle() |
int |
getBorderRightWidth() |
Color |
getBorderTopColor() |
java.lang.String |
getBorderTopStyle() |
int |
getBorderTopWidth() |
RelativeLength |
getBottom() |
Color |
getColor() |
CSSCounter[] |
getCounters() |
CSSCounterIncrement[] |
getCountersIncrement() |
java.lang.String |
getDirection()
The direction CSS property should be set to match the direction of the text:
rtl for Hebrew
or Arabic text and ltr for other scripts. |
java.lang.String |
getDirectWhitespace() |
java.lang.String |
getDisplay()
First it looks at the KEY_IMPOSED_DISPLAY property.
|
java.lang.String |
getDisplayTags() |
Font |
getFont() |
int |
getFontWeight() |
RelativeLength |
getHeight() |
int |
getHorizontalBorderSpacing() |
RelativeLength |
getLeft() |
int |
getLineHeight(FontMetrics fm)
Sets the distance between lines: normal number length %
|
java.lang.String |
getLinkURL() |
java.lang.String |
getListStyleType() |
RelativeLength |
getMarginBottom() |
RelativeLength |
getMarginLeft() |
RelativeLength |
getMarginRight() |
RelativeLength |
getMarginTop() |
RelativeLength |
getMaxWidth() |
RelativeLength |
getMinHeight()
Gets the value associated with the min-height property
|
RelativeLength |
getMinWidth() |
StaticContent[] |
getMixedContent() |
java.lang.String[] |
getNonFoldableChildName() |
Color |
getOutlineColor() |
java.lang.String |
getOutlineStyle() |
int |
getOutlineWidth() |
RelativeLength |
getPaddingBottom() |
RelativeLength |
getPaddingLeft() |
RelativeLength |
getPaddingRight() |
RelativeLength |
getPaddingTop() |
java.lang.String |
getPlaceholderContent() |
java.lang.String |
getPosition()
Checks the 'position' property.
|
java.lang.Object |
getProperty(int property) |
java.lang.Object |
getPropertyByName(java.lang.String name)
Retrieve the property by its name.
|
static java.lang.String |
getPropertyName(int index) |
int |
getPseudoLevel()
If this is the style for a pseudo element, get its level.
|
RelativeLength |
getRight() |
boolean |
getShowEmptyCells() |
java.lang.String |
getShowPlaceholders() |
Color |
getTagsBackgroundColor()
Obtain the color for full-tags background.
|
Color |
getTagsColor()
Obtain the color for full-tags background.
|
java.lang.String |
getTextAlign()
Aligns the text in an element: left right center justify.
|
java.lang.String[] |
getTextDecoration()
Deprecated.
This was used to return only the text-decoration-line part from the text-decoration shorthand,
as defined here https://drafts.csswg.org/css-text-decor-3/#text-decoration-property.
|
Color |
getTextDecorationColor() |
java.lang.String[] |
getTextDecorationLine() |
java.lang.String |
getTextDecorationStyle() |
RelativeLength |
getTextIndent()
Gets the horizontal space that should be left before the
beginning of the first line of the text content of an element.
|
java.lang.String |
getTextTransform() |
RelativeLength |
getTop() |
java.lang.String |
getUnicodeBIDI()
The unicode-bidi CSS property together with the direction property relates to the handling
of bidirectional text in a document.
|
java.lang.String |
getVerticalAlign() |
int |
getVerticalBorderSpacing() |
java.lang.String |
getVisibility() |
java.lang.String |
getWhitespace() |
RelativeLength |
getWidth() |
boolean |
hasBorder() |
int |
hashCode() |
boolean |
isEditable() |
boolean |
isFilteredOut() |
boolean |
isFoldable() |
boolean |
isFolded() |
static boolean |
isInheritable(java.lang.String property)
Check if the given property can be inherited from parent to child.
|
boolean |
isInline() |
boolean |
isInlineInCSS() |
boolean |
isInTable()
Check if is a style from a table but not a cell.
|
boolean |
isInvisible() |
boolean |
isListItem() |
boolean |
isMorphDisplay()
Check if the display has 'morph' or '-oxy-morph' value.
|
boolean |
isSpecifiedTextAlign()
Checks if the text-align property from the current element styles
has a value specified by the CSS.
|
boolean |
isTable()
Checks if the display mode indicated to be a table.
|
boolean |
isTableCaption()
Checks if the display mode indicated to be a table caption.
|
boolean |
isTableCell()
Checks if the display mode indicated to be a table cell.
|
boolean |
isTableColumn()
Checks if the display mode indicated to be a table column.
|
boolean |
isTableColumnGroup()
Checks if the display mode indicated to be a table group of columns.
|
boolean |
isTableFooterGroup()
Checks if the display mode indicated to be a table group footer.
|
boolean |
isTableHeaderGroup()
Checks if the display mode indicated to be a table group header.
|
boolean |
isTableRow() |
boolean |
isTableRowGroup() |
void |
setCanBeCached(boolean canBeCached)
Sets if those styles can be shared between two or more nodes.
|
void |
setProperty(int property,
java.lang.Object value)
Set a property to the map.
|
void |
setPseudoLevel(int pseudoLevel)
If this is the style for a pseudo element, keep here its level.
|
java.lang.String |
toString() |
public static final float EX_FACTOR
public static final int FONT_WEIGHT_NORMAL
public static final int FONT_WEIGHT_BOLD
public static int counter
public static final int KEY_BACKGROUND_COLOR
public static final int KEY_BORDER_BOTTOM_COLOR
public static final int KEY_BORDER_BOTTOM_STYLE
public static final int KEY_BORDER_BOTTOM_WIDTH
public static final int KEY_BORDER_LEFT_COLOR
public static final int KEY_BORDER_LEFT_STYLE
public static final int KEY_BORDER_LEFT_WIDTH
public static final int KEY_BORDER_RIGHT_COLOR
public static final int KEY_BORDER_RIGHT_STYLE
public static final int KEY_BORDER_RIGHT_WIDTH
public static final int KEY_BORDER_TOP_COLOR
public static final int KEY_BORDER_TOP_STYLE
public static final int KEY_BORDER_TOP_WIDTH
public static final int KEY_FOREGROUND_COLOR
public static final int KEY_MIXED_CONTENT
StaticContent
interface.
new StaticContent
[] { new StringContent
("Text value for the KEY_MIXED_CONTENT property") }
public static final int KEY_DISPLAY
public static final int KEY_FONT
public static final int KEY_FONT_WEIGHT
public static final int KEY_LINE_HEIGHT
public static final int KEY_LIST_STYLE_TYPE
public static final int KEY_MARGIN_BOTTOM
public static final int KEY_MARGIN_LEFT
public static final int KEY_MARGIN_RIGHT
public static final int KEY_MARGIN_TOP
public static final int KEY_PADDING_BOTTOM
public static final int KEY_PADDING_LEFT
public static final int KEY_PADDING_RIGHT
public static final int KEY_PADDING_TOP
public static final int KEY_WIDTH
public static final int KEY_HEIGHT
public static final int KEY_MIN_WIDTH
public static final int KEY_MAX_WIDTH
public static final int KEY_TEXT_ALIGN
public static final int KEY_TEXT_INDENT
public static final int KEY_WHITESPACE
public static final int KEY_EDITABLE
public static final int KEY_BORDER_SPACING
public static final int KEY_VISIBITY
public static final int KEY_EMPTY_CELLS
public static final int KEY_FOLDABLE
public static final int KEY_NON_FOLDABLE_CHILD_NAME
public static final int KEY_VERTICAL_ALIGN
public static final int KEY_COUNTER_RESET
public static final int KEY_COUNTER_INCREMENT
public static final int KEY_IMPOSED_DISPLAY
public static final int KEY_TEXT_DECORATION_LINE
@Deprecated public static final int KEY_TEXT_DECORATION
KEY_TEXT_DECORATION_LINE
,
KEY_TEXT_DECORATION_COLOR
, KEY_TEXT_DECORATION_STYLE
instead.KEY_TEXT_DECORATION_LINE
.
Starting from CSS level 3, the 'text-decoration' property is a shorthand,
mapped to 'text-decoration-line', 'text-decoration-style' and
'text-decoration-color'.public static final int KEY_TEXT_DECORATION_COLOR
public static final int KEY_LINK
@Deprecated public static final int KEY_LINK_URL
public static final int KEY_DISPLAY_TAGS
public static final int KEY_DIRECT_WHITESPACE
public static final int KEY_FILTERED_OUT
public static final int KEY_TEXT_TRANSFORM
public static final int KEY_SHOW_PLACEHOLDER
public static final int KEY_PLACEHOLDER_CONTENT
public static final int KEY_FOLDED
public static final int KEY_TAGS_BACKGROUND_COLOR
public static final int KEY_TAGS_COLOR
public static final int KEY_BACKGROUND_IMAGE
public static final int KEY_BACKGROUND_REPEAT
public static final int KEY_BACKGROUND_POSITION
public static final int KEY_DIRECTION
public static final int KEY_UNICODE_BIDI
public static final int KEY_TEXT_DECORATION_STYLE
public static final int KEY_MIN_HEIGHT
public static final int KEY_POSITION
public static final int KEY_TOP
public static final int KEY_BOTTOM
public static final int KEY_LEFT
public static final int KEY_RIGHT
public static final int KEY_OUTLINE_COLOR
public static final int KEY_OUTLINE_STYLE
public static final int KEY_OUTLINE_WIDTH
public static java.lang.String getPropertyName(int index)
index
- The index of the property.public java.lang.Object getPropertyByName(java.lang.String name)
name
- The property name.public Color getBackgroundColor()
background-color
property.
Returns null
if the background color is transparent.public ro.sync.ecss.css.URIContent getBackgroundImage()
background-image
property.
Returns null
if the background image is not defined.public java.lang.String getBackgroundRepeat()
public ro.sync.ecss.css.BackgroundPosition getBackgroundPosition()
null
.public Color getTagsBackgroundColor()
-oxy-tags-background-color
property.
Returns null
if no background color was defined in css.public Color getTagsColor()
-oxy-tags-background-color
property.
Returns null
if no background color was defined in css.public boolean hasBorder()
true
if the styles define a visible border.public Color getBorderBottomColor()
borderBottomColor
property.public java.lang.String getBorderBottomStyle()
borderBottomStyle
property.public Color getBorderLeftColor()
borderLeftColor
property.public java.lang.String getBorderLeftStyle()
borderLeftStyle
property.public Color getBorderRightColor()
borderRightColor
property.public java.lang.String getBorderRightStyle()
borderRightStyle
property.public Color getBorderTopColor()
borderTopColor
property.public java.lang.String getBorderTopStyle()
borderTopStyle
property.public Color getOutlineColor()
outline-color
property. If is not set
returns thepublic java.lang.String getOutlineStyle()
outline-style
property.public int getOutlineWidth()
outline-width
property.public Color getColor()
color
property.public StaticContent[] getMixedContent()
List
of ContentPart
objects
representing the content
property.public java.lang.String getDisplay()
display
property or CSS.INLINE if nothing is
specified.public java.lang.String getPosition()
CSSValues.STATIC
, CSSValues.RELATIVE
, CSSValues.FIXED
or CSSValues.ABSOLUTE
.public boolean isMorphDisplay()
true
for morph display.public boolean isInvisible()
true
if the associated element is invisible.public boolean isListItem()
true
if the associated element is a list item.public Font getFont()
font
property. Never null.public int getFontWeight()
fontWeight
property.public int getLineHeight(FontMetrics fm)
fm
- Font metrics for this style's fontlineHeight
property.public java.lang.String getListStyleType()
listStyleType
property.public java.lang.String getTextAlign()
textAlign
property.public boolean isSpecifiedTextAlign()
public RelativeLength getTextIndent()
text-indent
property, or null if none.public boolean isInline()
public boolean isTableRowGroup()
public boolean isTableRow()
public int getBorderBottomWidth()
public int getBorderLeftWidth()
public int getBorderRightWidth()
public int getBorderTopWidth()
public RelativeLength getMarginBottom()
public RelativeLength getMarginLeft()
public RelativeLength getMarginRight()
public RelativeLength getMarginTop()
public RelativeLength getPaddingBottom()
public java.lang.String getDirection()
rtl
for Hebrew
or Arabic text and ltr
for other scripts. The property sets the base text direction of block-level elements and the direction of embeddings created by the unicode-bidi property. It also sets the default alignment of text and block-level elements and the direction that cells flow within a table row. Unlike the dir attribute in HTML, the direction property is not inherited from table columns into table cells, since CSS inheritance follows the document tree, and table cells are inside of the rows but not inside of the columns.
This is inheritable.
The initial value is CSSValues.LTR
.
CSSValues.LTR
or CSSValues.RTL
.public java.lang.String getUnicodeBIDI()
This is not inheritable.
The initial value is CSSValues.NORMAL
.
CSSValues.EMBED
, CSSValues.BIDI_OVERRIDE
or CSSValues.NORMAL
.public RelativeLength getPaddingLeft()
public RelativeLength getPaddingRight()
public RelativeLength getPaddingTop()
public boolean isTable()
public boolean isTableCell()
public java.lang.String getWhitespace()
public java.lang.String getDirectWhitespace()
public boolean isTableHeaderGroup()
public boolean isTableFooterGroup()
public boolean isTableColumn()
public boolean isTableColumnGroup()
public RelativeLength getWidth()
public RelativeLength getHeight()
public RelativeLength getMinWidth()
public RelativeLength getMaxWidth()
public boolean isEditable()
public int getHorizontalBorderSpacing()
public int getVerticalBorderSpacing()
public void setProperty(int property, java.lang.Object value)
property
- The key of the property to be set. It can be one of the keys defined in
this class.value
- The value of the property.
Accepted values depend on the property and can have as type String
,
Color
, RelativeLength
, CSSCounter
or CSSCounterIncrement
.
The actual values are the Java representations of the ones accepted in the CSS specification.
Read more about the CSS support in the Developer Guide.public java.lang.Object getProperty(int property)
property
- The property name.public static boolean isInheritable(java.lang.String property)
true
for "border" or "border-right"
(is a shorthand, does not know about it), but false
for "border-right-color".property
- The name of the CSS property. Must not be a shorthand!true
if the given property is inherited.public java.lang.String getVisibility()
public java.lang.String getShowPlaceholders()
public java.lang.String getPlaceholderContent()
public boolean getShowEmptyCells()
public boolean isFoldable()
public boolean isFolded()
true
if this element is foldedpublic java.lang.String[] getNonFoldableChildName()
public boolean isTableCaption()
public boolean isInlineInCSS()
true
if element is specified as INLINE in CSS source.public java.lang.String getVerticalAlign()
@Deprecated public java.lang.String[] getTextDecoration()
public java.lang.String[] getTextDecorationLine()
public java.lang.String getTextDecorationStyle()
public Color getTextDecorationColor()
public CSSCounter[] getCounters()
public CSSCounterIncrement[] getCountersIncrement()
public boolean isInTable()
true
if the current style is a one of
CSS.TABLE, CSS.INLINE_TABLE, CSS.TABLE_ROW, CSS.TABLE_ROW_GROUP,
CSS.TABLE_FOOTER_GROUP, CSS.TABLE_HEADER_GROUPpublic java.lang.String getLinkURL()
public java.lang.String getDisplayTags()
public java.lang.String getTextTransform()
public boolean isFilteredOut()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean canBeCached()
public void setCanBeCached(boolean canBeCached)
canBeCached
- True when be shared between two or more nodes.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public RelativeLength getMinHeight()
public RelativeLength getLeft()
null
.public RelativeLength getRight()
null
.public RelativeLength getTop()
null
.public RelativeLength getBottom()
null
.public void setPseudoLevel(int pseudoLevel)
pseudoLevel
- The level of the pseudo element, if the style is associated to one.public int getPseudoLevel()
© Copyright SyncRO Soft SRL 2002 - 2016. All rights reserved.