Class StyleAttributeMap
java.lang.Object
jfx.incubator.scene.control.richtext.model.StyleAttributeMap
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStyleAttributeMap 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 StyleAttributeMapEmpty 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.Builderbuilder()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.booleancontains(StyleAttribute<?> a) Returns true if the attribute is present; false otherwise.<V> Vget(StyleAttribute<V> a) Returns the attribute value, or null if no such attribute is present.Set<Map.Entry<StyleAttribute<?>, Object>> Returns an immutableSetview of the mappings contained in this map.Set<StyleAttribute<?>> Returns the set ofStyleAttributes.This convenience method returns the value ofBACKGROUNDattribute, or null.booleanReturns true if the specified attribute containsBoolean.TRUE, false in any other case.This convenience method returns the value ofBULLETattribute, or null.doublegetDouble(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_INDENTattribute.This convenience method returns true if the value of theFONT_FAMILYattribute isBoolean.TRUE, false otherwise.final DoubleThis convenience method returns the value of theFONT_SIZEattribute.This convenience method returns the value of theLINE_SPACINGattribute, or null.This convenience method returns the value ofPARAGRAPH_DIRECTIONparagraph attribute, or null if the value is not set.This convenience method returns the value of theSPACE_ABOVEattribute, or null.This convenience method returns the value of theSPACE_BELOWattribute, or null.This convenience method returns the value of theSPACE_LEFTattribute, or null.This convenience method returns the value of theSPACE_RIGHTattribute, or null.This convenience method returns the value ofTEXT_ALIGNMENTattribute, or null.This convenience method returns the value ofTEXT_COLORattribute, or null.booleanisBold()This convenience method returns true if the value ofBOLDattribute isBoolean.TRUE, false otherwise.booleanisEmpty()Returnstrueif this instance contains no attributes.booleanisItalic()This convenience method returns true if the value ofITALICattribute isBoolean.TRUE, false otherwise.booleanThis convenience method returns true if the value ofSTRIKE_THROUGHattribute isBoolean.TRUE, false otherwise.booleanThis convenience method returns true if the value ofUNDERLINEattribute isBoolean.TRUE, false otherwise.static <V> StyleAttributeMapof(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()Returnstrueif 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 ofStyleAttributes.- Returns:
- attribute set
-
getAttributeEntrySet
Returns an immutableSetview 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 ofBACKGROUNDattribute, or null.- Returns:
- the background color attribute value
-
getBullet
-
getFirstLineIndent
This convenience method returns the value of theFIRST_LINE_INDENTattribute.- Returns:
- the first line indent value in points
-
getFontSize
-
getFontFamily
This convenience method returns true if the value of theFONT_FAMILYattribute isBoolean.TRUE, false otherwise.- Returns:
- the font family name
-
getLineSpacing
This convenience method returns the value of theLINE_SPACINGattribute, or null.- Returns:
- the line spacing value
-
getSpaceAbove
This convenience method returns the value of theSPACE_ABOVEattribute, or null.- Returns:
- the space above paragraph attribute value
-
getSpaceBelow
This convenience method returns the value of theSPACE_BELOWattribute, or null.- Returns:
- the space below paragraph attribute value
-
getSpaceLeft
This convenience method returns the value of theSPACE_LEFTattribute, or null.- Returns:
- the space left paragraph attribute value
-
getSpaceRight
This convenience method returns the value of theSPACE_RIGHTattribute, or null.- Returns:
- the space right paragraph attribute value
-
getTextAlignment
This convenience method returns the value ofTEXT_ALIGNMENTattribute, or null.- Returns:
- the paragraph alignment attribute value
-
getTextColor
This convenience method returns the value ofTEXT_COLORattribute, or null.- Returns:
- the text color attribute value
-
isBold
public boolean isBold()This convenience method returns true if the value ofBOLDattribute isBoolean.TRUE, false otherwise.- Returns:
- the bold attribute value
-
isItalic
public boolean isItalic()This convenience method returns true if the value ofITALICattribute isBoolean.TRUE, false otherwise.- Returns:
- the italic attribute value
-
getParagraphDirection
This convenience method returns the value ofPARAGRAPH_DIRECTIONparagraph 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_THROUGHattribute isBoolean.TRUE, false otherwise.- Returns:
- the strike through attribute value
-
isUnderline
public boolean isUnderline()This convenience method returns true if the value ofUNDERLINEattribute isBoolean.TRUE, false otherwise.- Returns:
- the underline attribute value
-
builder
Creates a new Builder instance.- Returns:
- the new Builder instance
-