Class StyleAttributeMap
java.lang.Object
jfx.incubator.scene.control.richtext.model.StyleAttributeMap
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
StyleAttributeMap are immutable, so a Builder is required to create a new instance -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StyleAttribute
<Color> Paragraph background color attribute.static final StyleAttribute
<Boolean> Bold typeface text attribute.static final StyleAttribute
<String> Bullet point paragraph attribute.static final StyleAttributeMap
Empty attribute set.static final StyleAttribute
<Double> First line indent paragraph attribute, in pixels.static final StyleAttribute
<String> Font family text attribute.static final StyleAttribute
<Double> Font size text attribute, in pixels.static final StyleAttribute
<Boolean> Italic type face text attribute.static final StyleAttribute
<Double> Line spacing paragraph attribute.static final StyleAttribute
<ParagraphDirection> Paragraph direction attribute.static final StyleAttribute
<Double> Space above (top padding) paragraph attribute.static final StyleAttribute
<Double> Space below (bottom padding) paragraph attribute.static final StyleAttribute
<Double> Space to the left (left padding) paragraph attribute.static final StyleAttribute
<Double> Space to the right (right padding) paragraph attribute.static final StyleAttribute
<Boolean> Strike-through text attribute.static final StyleAttribute
<TextAlignment> Text alignment paragraph attribute.static final StyleAttribute
<Color> Text color attribute.static final StyleAttribute
<Boolean> Underline text attribute. -
Method Summary
Modifier and TypeMethodDescriptionstatic StyleAttributeMap.Builder
builder()
Creates a new Builder instance.combine
(StyleAttributeMap attrs) Creates a new StyleAttributeMap instance by first copying attributes from this instance, then adding (and/or overwriting) the attributes from the specified instance.boolean
contains
(StyleAttribute<?> a) Returns true if the attribute is present; false otherwise.<V> V
get
(StyleAttribute<V> a) Returns the attribute value, or null if no such attribute is present.Set
<Map.Entry<StyleAttribute<?>, Object>> Returns an immutableSet
view of the mappings contained in this map.Set
<StyleAttribute<?>> Returns the set ofStyleAttribute
s.This convenience method returns the value ofBACKGROUND
attribute, or null.boolean
Returns true if the specified attribute containsBoolean.TRUE
, false in any other case.This convenience method returns the value ofBULLET
attribute, or null.double
getDouble
(StyleAttribute<? extends Number> a, double defaultValue) Returns the value of the specified attribute, or defaultValue if the specified attribute is not present or is not aNumber
.This convenience method returns the value of theFIRST_LINE_INDENT
attribute.This convenience method returns true if the value of theFONT_FAMILY
attribute isBoolean.TRUE
, false otherwise.final Double
This convenience method returns the value of theFONT_SIZE
attribute.This convenience method returns the value of theLINE_SPACING
attribute, or null.This convenience method returns the value ofPARAGRAPH_DIRECTION
paragraph attribute, or null if the value is not set.This convenience method returns the value of theSPACE_ABOVE
attribute, or null.This convenience method returns the value of theSPACE_BELOW
attribute, or null.This convenience method returns the value of theSPACE_LEFT
attribute, or null.This convenience method returns the value of theSPACE_RIGHT
attribute, or null.This convenience method returns the value ofTEXT_ALIGNMENT
attribute, or null.This convenience method returns the value ofTEXT_COLOR
attribute, or null.boolean
isBold()
This convenience method returns true if the value ofBOLD
attribute isBoolean.TRUE
, false otherwise.boolean
isEmpty()
Returnstrue
if this instance contains no attributes.boolean
isItalic()
This convenience method returns true if the value ofITALIC
attribute isBoolean.TRUE
, false otherwise.boolean
This convenience method returns true if the value ofSTRIKE_THROUGH
attribute isBoolean.TRUE
, false otherwise.boolean
This convenience method returns true if the value ofUNDERLINE
attribute isBoolean.TRUE
, false otherwise.static <V> StyleAttributeMap
of
(StyleAttribute<V> attribute, V value) Convenience method creates the instance with a single attribute.
-
Field Details
-
BACKGROUND
Paragraph background color attribute. -
BULLET
Bullet point paragraph attribute. -
BOLD
Bold typeface text attribute. -
FIRST_LINE_INDENT
First line indent paragraph attribute, in pixels. -
FONT_FAMILY
Font family text attribute. -
FONT_SIZE
Font size text attribute, in pixels. -
ITALIC
Italic type face text attribute. -
LINE_SPACING
Line spacing paragraph attribute. -
PARAGRAPH_DIRECTION
Paragraph direction attribute. This attribute is considered only when text wrapping is enabled. -
SPACE_ABOVE
Space above (top padding) paragraph attribute. -
SPACE_BELOW
Space below (bottom padding) paragraph attribute. -
SPACE_LEFT
Space to the left (left padding) paragraph attribute. -
SPACE_RIGHT
Space to the right (right padding) paragraph attribute. -
STRIKE_THROUGH
Strike-through text attribute. -
TEXT_ALIGNMENT
Text alignment paragraph attribute. -
TEXT_COLOR
Text color attribute. -
UNDERLINE
Underline text attribute. -
EMPTY
Empty attribute set.
-
-
Method Details
-
of
Convenience method creates the instance with a single attribute.- Type Parameters:
V
- the attribute value type- Parameters:
attribute
- the attributevalue
- the attribute value- Returns:
- the new instance
-
isEmpty
public boolean isEmpty()Returnstrue
if this instance contains no attributes.- Returns:
- true is no attributes are present
-
get
Returns the attribute value, or null if no such attribute is present.- Type Parameters:
V
- the attribute value type- Parameters:
a
- attribute- Returns:
- attribute value or null
-
getAttributes
Returns the set ofStyleAttribute
s.- Returns:
- attribute set
-
getAttributeEntrySet
Returns an immutableSet
view of the mappings contained in this map.- Returns:
- a set view of the mappings contained in this attribute map
-
contains
Returns true if the attribute is present; false otherwise.- Parameters:
a
- the attribute- Returns:
- true if the attribute is present
-
combine
Creates a new StyleAttributeMap instance by first copying attributes from this instance, then adding (and/or overwriting) the attributes from the specified instance.- Parameters:
attrs
- the attributes to combine- Returns:
- the new instance combining the attributes
-
getBoolean
Returns true if the specified attribute containsBoolean.TRUE
, false in any other case.- Parameters:
a
- the attribute- Returns:
- true if the attribute value is
Boolean.TRUE
-
getDouble
Returns the value of the specified attribute, or defaultValue if the specified attribute is not present or is not aNumber
.- Parameters:
a
- the attributedefaultValue
- the default value- Returns:
- the attribute value
-
getBackground
This convenience method returns the value ofBACKGROUND
attribute, or null.- Returns:
- the background color attribute value
-
getBullet
-
getFirstLineIndent
This convenience method returns the value of theFIRST_LINE_INDENT
attribute.- Returns:
- the first line indent value in points
-
getFontSize
-
getFontFamily
This convenience method returns true if the value of theFONT_FAMILY
attribute isBoolean.TRUE
, false otherwise.- Returns:
- the font family name
-
getLineSpacing
This convenience method returns the value of theLINE_SPACING
attribute, or null.- Returns:
- the line spacing value
-
getSpaceAbove
This convenience method returns the value of theSPACE_ABOVE
attribute, or null.- Returns:
- the space above paragraph attribute value
-
getSpaceBelow
This convenience method returns the value of theSPACE_BELOW
attribute, or null.- Returns:
- the space below paragraph attribute value
-
getSpaceLeft
This convenience method returns the value of theSPACE_LEFT
attribute, or null.- Returns:
- the space left paragraph attribute value
-
getSpaceRight
This convenience method returns the value of theSPACE_RIGHT
attribute, or null.- Returns:
- the space right paragraph attribute value
-
getTextAlignment
This convenience method returns the value ofTEXT_ALIGNMENT
attribute, or null.- Returns:
- the paragraph alignment attribute value
-
getTextColor
This convenience method returns the value ofTEXT_COLOR
attribute, or null.- Returns:
- the text color attribute value
-
isBold
public boolean isBold()This convenience method returns true if the value ofBOLD
attribute isBoolean.TRUE
, false otherwise.- Returns:
- the bold attribute value
-
isItalic
public boolean isItalic()This convenience method returns true if the value ofITALIC
attribute isBoolean.TRUE
, false otherwise.- Returns:
- the italic attribute value
-
getParagraphDirection
This convenience method returns the value ofPARAGRAPH_DIRECTION
paragraph attribute, or null if the value is not set.- Returns:
- the paragraph direction attribute value, or null
-
isStrikeThrough
public boolean isStrikeThrough()This convenience method returns true if the value ofSTRIKE_THROUGH
attribute isBoolean.TRUE
, false otherwise.- Returns:
- the strike through attribute value
-
isUnderline
public boolean isUnderline()This convenience method returns true if the value ofUNDERLINE
attribute isBoolean.TRUE
, false otherwise.- Returns:
- the underline attribute value
-
builder
Creates a new Builder instance.- Returns:
- the new Builder instance
-