APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jfx.incubator.scene.control.richtext.model

public final Class StyleAttributeMap

extends Object
Class Inheritance
Imports
java.util.Collections, .HashMap, .Map, .Set, javafx.scene.paint.Color, javafx.scene.text.TextAlignment, com.sun.jfx.incubator.scene.control.richtext.CssStyles, .StyleAttributeMapHelper

This immutable object contains a map of StyleAttributes.
Since
24

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
StyleAttributeMap.Builder

StyleAttributeMap are immutable, so a Builder is required to create a new instance

Field Summary

Modifier and TypeField and Description
private final Map<StyleAttribute<?>, Object>
public static final StyleAttribute<Color>
BACKGROUND

Paragraph background color attribute.

public static final StyleAttribute<Boolean>
BOLD

Bold typeface text attribute.

public static final StyleAttribute<String>
BULLET

Bullet point paragraph attribute.

public static final StyleAttribute<EmbeddedImage>
EMBEDDED_IMAGE

Embedded image attribute.

public static final StyleAttributeMap
EMPTY

Empty attribute set.

private static final String[]
public static final StyleAttribute<Double>
FIRST_LINE_INDENT

First line indent paragraph attribute, in pixels.

public static final StyleAttribute<String>
FONT_FAMILY

Font family text attribute.

public static final StyleAttribute<Double>
FONT_SIZE

Font size text attribute, in pixels.

public static final StyleAttribute<Boolean>
ITALIC

Italic type face text attribute.

public static final StyleAttribute<Double>
LINE_SPACING

Line spacing paragraph attribute.

public static final StyleAttribute<ParagraphDirection>
PARAGRAPH_DIRECTION

Paragraph direction attribute.

public static final StyleAttribute<Double>
SPACE_ABOVE

Space above (top padding) paragraph attribute.

public static final StyleAttribute<Double>
SPACE_BELOW

Space below (bottom padding) paragraph attribute.

public static final StyleAttribute<Double>
SPACE_LEFT

Space to the left (left padding) paragraph attribute.

public static final StyleAttribute<Double>
SPACE_RIGHT

Space to the right (right padding) paragraph attribute.

public static final StyleAttribute<Boolean>
STRIKE_THROUGH

Strike-through text attribute.

public static final StyleAttribute<TabStops>
TAB_STOPS

Tab stops paragraph attribute.

public static final StyleAttribute<TextAlignment>
TEXT_ALIGNMENT

Text alignment paragraph attribute.

public static final StyleAttribute<Color>
TEXT_COLOR

Text color attribute.

public static final StyleAttribute<Boolean>
TEXT_HIGHLIGHT_1

Text highlight character attribute for the background color specified by the text-highlight-1 CSS style.

public static final StyleAttribute<Boolean>
TEXT_HIGHLIGHT_2

Text highlight character attribute for the background color specified by the text-highlight-2 CSS style.

public static final StyleAttribute<Boolean>
TEXT_HIGHLIGHT_3

Text highlight character attribute for the background color specified by the text-highlight-3 CSS style.

public static final StyleAttribute<Boolean>
TEXT_HIGHLIGHT_4

Text highlight character attribute for the background color specified by the text-highlight-4 CSS style.

public static final StyleAttribute<Boolean>
TEXT_HIGHLIGHT_5

Text highlight character attribute for the background color specified by the text-highlight-5 CSS style.

public static final StyleAttribute<Boolean>
UNDERLINE

Underline text attribute.

public static final StyleAttribute<Boolean>
WAVY_UNDERLINE_1

Wavy underline character attribute using the color specified by the wavy-underline-1 CSS style.

public static final StyleAttribute<Boolean>
WAVY_UNDERLINE_2

Wavy underline character attribute using the color specified by the wavy-underline-2 CSS style.

public static final StyleAttribute<Boolean>
WAVY_UNDERLINE_3

Wavy underline character attribute using the color specified by the wavy-underline-3 CSS style.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static StyleAttributeMap.Builder

Returns:

the new Builder instance
builder
()

Creates a new Builder instance.

public StyleAttributeMap

Returns:

the new instance combining the attributes
combine
(StyleAttributeMap
the attributes to combine
attrs
)

Creates a new StyleAttributeMap instance by first copying attributes from this instance, then adding (and/or overwriting) the attributes from the specified instance.

public boolean

Returns:

true if the attribute is present
contains
(StyleAttribute<?>
the attribute
a
)

Returns true if the attribute is present; false otherwise.

public boolean
equals(Object x)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

private StyleAttributeMap
filterAttributes(boolean isParagraph)

pack-priv static StyleAttributeMap

Returns:

the new instance
fromInlineStyle
(String
the inline style, can be null
style
)

This convenience method creates an instance from an inline style.

pack-priv static StyleAttributeMap

Returns:

the new instance
fromStyles
(String
the inline style, will not be applied when null
style
,
String...
style names
names
)

This convenience method creates an instance from an inline style and a number of CSS style names.

public <
the attribute value type
V
>
V

Returns:

attribute value or null
get
(StyleAttribute<V>
attribute
a
)

Returns the attribute value, or null if no such attribute is present.

public Set<Map.Entry<StyleAttribute<?>, Object>>

Returns:

a set view of the mappings contained in this attribute map
getAttributeEntrySet
()

Returns an immutable Set view of the mappings contained in this map.

public Set<StyleAttribute<?>>

Returns:

attribute set
getAttributes
()

Returns the set of StyleAttributes.

public Color

Returns:

the background color attribute value
getBackground
()

This convenience method returns the value of BACKGROUND attribute, or null.

public boolean

Returns:

true if the attribute value is Boolean.TRUE
getBoolean
(StyleAttribute<Boolean>
the attribute
a
)

Returns true if the specified attribute contains Boolean.TRUE, false in any other case.

public String

Returns:

the bullet paragraph attribute value
getBullet
()

This convenience method returns the value of BULLET attribute, or null.

public double

Returns:

the attribute value
getDouble
(StyleAttribute<? extends Number>
the attribute
a
,
double
the default value
defaultValue
)

Returns the value of the specified attribute, or defaultValue if the specified attribute is not present or is not a Number.

public Double

Returns:

the first line indent value in points
getFirstLineIndent
()

This convenience method returns the value of the FIRST_LINE_INDENT attribute.

public String

Returns:

the font family name
getFontFamily
()

This convenience method returns true if the value of the FONT_FAMILY attribute is Boolean.TRUE, false otherwise.

public final Double

Returns:

the font size
getFontSize
()

This convenience method returns the value of the FONT_SIZE attribute.

public Double

Returns:

the line spacing value
getLineSpacing
()

This convenience method returns the value of the LINE_SPACING attribute, or null.

public ParagraphDirection

Returns:

the paragraph direction attribute value, or null
getParagraphDirection
()

This convenience method returns the value of PARAGRAPH_DIRECTION paragraph attribute, or null if the value is not set.

public Double

Returns:

the space above paragraph attribute value
getSpaceAbove
()

This convenience method returns the value of the SPACE_ABOVE attribute, or null.

public Double

Returns:

the space below paragraph attribute value
getSpaceBelow
()

This convenience method returns the value of the SPACE_BELOW attribute, or null.

public Double

Returns:

the space left paragraph attribute value
getSpaceLeft
()

This convenience method returns the value of the SPACE_LEFT attribute, or null.

public Double

Returns:

the space right paragraph attribute value
getSpaceRight
()

This convenience method returns the value of the SPACE_RIGHT attribute, or null.

public TabStops

Returns:

the tab stops attribute value
getTabStops
()

This convenience method returns the value of TAB_STOPS attribute, or null.

public TextAlignment

Returns:

the paragraph alignment attribute value
getTextAlignment
()

This convenience method returns the value of TEXT_ALIGNMENT attribute, or null.

public Color

Returns:

the text color attribute value
getTextColor
()

This convenience method returns the value of TEXT_COLOR attribute, or null.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

private static void
public boolean

Returns:

the bold attribute value
isBold
()

This convenience method returns true if the value of BOLD attribute is Boolean.TRUE, false otherwise.

public boolean

Returns:

true is no attributes are present
isEmpty
()

Returns true if this instance contains no attributes.

public boolean

Returns:

the italic attribute value
isItalic
()

This convenience method returns true if the value of ITALIC attribute is Boolean.TRUE, false otherwise.

public boolean

Returns:

the strike through attribute value
isStrikeThrough
()

This convenience method returns true if the value of STRIKE_THROUGH attribute is Boolean.TRUE, false otherwise.

public boolean

Returns:

the underline attribute value
isUnderline
()

This convenience method returns true if the value of UNDERLINE attribute is Boolean.TRUE, false otherwise.

public static <
the attribute value type
V
>
StyleAttributeMap

Returns:

the new instance
of
(StyleAttribute<V>
the attribute
attribute
,
V
the attribute value
value
)

Convenience method creates the instance with a single attribute.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait