StyleAttributes.
| Modifier and Type | Class and Description |
|---|---|
| public static class | StyleAttributeMap.
StyleAttributeMap are immutable, so a Builder is required to create a new instance |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| public static final StyleAttribute | BACKGROUND
Paragraph background color attribute. |
| public static final StyleAttribute | BOLD
Bold typeface text attribute. |
| public static final StyleAttribute | BULLET
Bullet point paragraph attribute. |
| public static final StyleAttributeMap | EMPTY
Empty attribute set. |
| private static final String[] | |
| public static final StyleAttribute | FIRST_LINE_INDENT
First line indent paragraph attribute, in pixels. |
| public static final StyleAttribute | FONT_FAMILY
Font family text attribute. |
| public static final StyleAttribute | FONT_SIZE
Font size text attribute, in pixels. |
| public static final StyleAttribute | ITALIC
Italic type face text attribute. |
| public static final StyleAttribute | LINE_SPACING
Line spacing paragraph attribute. |
| public static final StyleAttribute | PARAGRAPH_DIRECTION
Paragraph direction attribute. |
| public static final StyleAttribute | SPACE_ABOVE
Space above (top padding) paragraph attribute. |
| public static final StyleAttribute | SPACE_BELOW
Space below (bottom padding) paragraph attribute. |
| public static final StyleAttribute | SPACE_LEFT
Space to the left (left padding) paragraph attribute. |
| public static final StyleAttribute | SPACE_RIGHT
Space to the right (right padding) paragraph attribute. |
| public static final StyleAttribute | STRIKE_THROUGH
Strike-through text attribute. |
| public static final StyleAttribute | TEXT_ALIGNMENT
Text alignment paragraph attribute. |
| public static final StyleAttribute | TEXT_COLOR
Text color attribute. |
| public static final StyleAttribute | UNDERLINE
Underline text attribute. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static StyleAttributeMap. | |
| public StyleAttributeMap | Returns: the new instance combining the attributesthe 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 presentthe attribute a)Returns true if the attribute is present; false otherwise. |
| public boolean | equals(Object
the reference object with which to compare. x)Overrides java. Indicates whether some other object is "equal to" this one. |
| private StyleAttributeMap | |
| pack-priv static StyleAttributeMap | Returns: the new instancethe inline style, can be null style)This convenience method creates an instance from an inline style. |
| pack-priv static StyleAttributeMap | Returns: the new instancethe 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 nullattribute a)Returns the attribute value, or null if no such attribute is present. |
| public Set | Returns: a set view of the mappings contained in this attribute mapReturns an immutable |
| public Set | |
| public Color | Returns: the background color attribute valueThis convenience method returns the value of |
| public boolean | Returns: true if the attribute value isBoolean.TRUEthe attribute a)Returns true if the specified attribute contains |
| public String | |
| public double | Returns: the attribute valuethe 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 |
| public Double | Returns: the first line indent value in pointsThis convenience method returns the value of the |
| public String | Returns: the font family nameThis convenience method returns true if the value of the |
| public final Double | Returns: the font sizeThis convenience method returns the value of the |
| public Double | Returns: the line spacing valueThis convenience method returns the value of the |
| public ParagraphDirection | Returns: the paragraph direction attribute value, or nullThis convenience method returns the value of |
| public Double | Returns: the space above paragraph attribute valueThis convenience method returns the value of the |
| public Double | Returns: the space below paragraph attribute valueThis convenience method returns the value of the |
| public Double | Returns: the space left paragraph attribute valueThis convenience method returns the value of the |
| public Double | Returns: the space right paragraph attribute valueThis convenience method returns the value of the |
| public TextAlignment | Returns: the paragraph alignment attribute valueThis convenience method returns the value of |
| public Color | Returns: the text color attribute valueThis convenience method returns the value of |
| public int | |
| private static void | |
| public boolean | |
| public boolean | Returns: true is no attributes are presentReturns |
| public boolean | |
| public boolean | Returns: the strike through attribute valueThis convenience method returns true if the value of |
| public boolean | Returns: the underline attribute valueThis convenience method returns true if the value of |
| public static < the attribute value type V> StyleAttributeMap | Returns: the new instancethe attribute attribute, V the attribute value value)Convenience method creates the instance with a single attribute. |
| public String |
| attributes | back to summary |
|---|---|
| private final Map<StyleAttribute<?>, Object> attributes | |
| BACKGROUND | back to summary |
|---|---|
| public static final StyleAttribute<Color> BACKGROUND Paragraph background color attribute. | |
| BOLD | back to summary |
|---|---|
| public static final StyleAttribute<Boolean> BOLD Bold typeface text attribute. | |
| BULLET | back to summary |
|---|---|
| public static final StyleAttribute<String> BULLET Bullet point paragraph attribute. | |
| EMPTY | back to summary |
|---|---|
| public static final StyleAttributeMap EMPTY Empty attribute set. | |
| EMPTY_ARRAY | back to summary |
|---|---|
| private static final String[] EMPTY_ARRAY | |
| FIRST_LINE_INDENT | back to summary |
|---|---|
| public static final StyleAttribute<Double> FIRST_LINE_INDENT First line indent paragraph attribute, in pixels. | |
| FONT_FAMILY | back to summary |
|---|---|
| public static final StyleAttribute<String> FONT_FAMILY Font family text attribute. | |
| FONT_SIZE | back to summary |
|---|---|
| public static final StyleAttribute<Double> FONT_SIZE Font size text attribute, in pixels. | |
| ITALIC | back to summary |
|---|---|
| public static final StyleAttribute<Boolean> ITALIC Italic type face text attribute. | |
| LINE_SPACING | back to summary |
|---|---|
| public static final StyleAttribute<Double> LINE_SPACING Line spacing paragraph attribute. | |
| PARAGRAPH_DIRECTION | back to summary |
|---|---|
| public static final StyleAttribute<ParagraphDirection> PARAGRAPH_DIRECTION Paragraph direction attribute. This attribute is considered only when text wrapping is enabled. | |
| SPACE_ABOVE | back to summary |
|---|---|
| public static final StyleAttribute<Double> SPACE_ABOVE Space above (top padding) paragraph attribute. | |
| SPACE_BELOW | back to summary |
|---|---|
| public static final StyleAttribute<Double> SPACE_BELOW Space below (bottom padding) paragraph attribute. | |
| SPACE_LEFT | back to summary |
|---|---|
| public static final StyleAttribute<Double> SPACE_LEFT Space to the left (left padding) paragraph attribute. | |
| SPACE_RIGHT | back to summary |
|---|---|
| public static final StyleAttribute<Double> SPACE_RIGHT Space to the right (right padding) paragraph attribute. | |
| STRIKE_THROUGH | back to summary |
|---|---|
| public static final StyleAttribute<Boolean> STRIKE_THROUGH Strike-through text attribute. | |
| TEXT_ALIGNMENT | back to summary |
|---|---|
| public static final StyleAttribute<TextAlignment> TEXT_ALIGNMENT Text alignment paragraph attribute. | |
| TEXT_COLOR | back to summary |
|---|---|
| public static final StyleAttribute<Color> TEXT_COLOR Text color attribute. | |
| UNDERLINE | back to summary |
|---|---|
| public static final StyleAttribute<Boolean> UNDERLINE Underline text attribute. | |
| StyleAttributeMap | back to summary |
|---|---|
| private StyleAttributeMap(Map<StyleAttribute<?>, Object> a) | |
| builder | back to summary |
|---|---|
| public static StyleAttributeMap. Creates a new Builder instance.
| |
| combine | back to summary |
|---|---|
| public StyleAttributeMap 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.
| |
| contains | back to summary |
|---|---|
| public boolean contains(StyleAttribute<?> a) Returns true if the attribute is present; false otherwise.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object x) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| filterAttributes | back to summary |
|---|---|
| private StyleAttributeMap filterAttributes(boolean isParagraph) | |
| fromInlineStyle | back to summary |
|---|---|
| pack-priv static StyleAttributeMap fromInlineStyle(String style) This convenience method creates an instance from an inline style.
| |
| fromStyles | back to summary |
|---|---|
| pack-priv static StyleAttributeMap fromStyles(String style, String... names) This convenience method creates an instance from an inline style and a number of CSS style names.
| |
| get | back to summary |
|---|---|
| public <V> V get(StyleAttribute<V> a) Returns the attribute value, or null if no such attribute is present.
| |
| getAttributeEntrySet | back to summary |
|---|---|
| public Set Returns an immutable
| |
| getAttributes | back to summary |
|---|---|
| public Set Returns the set of
| |
| getBackground | back to summary |
|---|---|
| public Color getBackground() This convenience method returns the value of
| |
| getBoolean | back to summary |
|---|---|
| public boolean getBoolean(StyleAttribute<Boolean> a) Returns true if the specified attribute contains
| |
| getBullet | back to summary |
|---|---|
| public String getBullet() This convenience method returns the value of
| |
| getDouble | back to summary |
|---|---|
| public 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 a
| |
| getFirstLineIndent | back to summary |
|---|---|
| public Double getFirstLineIndent() This convenience method returns the value of the
| |
| getFontFamily | back to summary |
|---|---|
| public String getFontFamily() This convenience method returns true if the value of the
| |
| getFontSize | back to summary |
|---|---|
| public final Double getFontSize() This convenience method returns the value of the
| |
| getLineSpacing | back to summary |
|---|---|
| public Double getLineSpacing() This convenience method returns the value of the
| |
| getParagraphDirection | back to summary |
|---|---|
| public ParagraphDirection getParagraphDirection() This convenience method returns the value of
| |
| getSpaceAbove | back to summary |
|---|---|
| public Double getSpaceAbove() This convenience method returns the value of the
| |
| getSpaceBelow | back to summary |
|---|---|
| public Double getSpaceBelow() This convenience method returns the value of the
| |
| getSpaceLeft | back to summary |
|---|---|
| public Double getSpaceLeft() This convenience method returns the value of the
| |
| getSpaceRight | back to summary |
|---|---|
| public Double getSpaceRight() This convenience method returns the value of the
| |
| getTextAlignment | back to summary |
|---|---|
| public TextAlignment getTextAlignment() This convenience method returns the value of
| |
| getTextColor | back to summary |
|---|---|
| public Color getTextColor() This convenience method returns the value of
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| initAccessor | back to summary |
|---|---|
| private static void initAccessor() | |
| isBold | back to summary |
|---|---|
| public boolean isBold() This convenience method returns true if the value of
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns
| |
| isItalic | back to summary |
|---|---|
| public boolean isItalic() This convenience method returns true if the value of
| |
| isStrikeThrough | back to summary |
|---|---|
| public boolean isStrikeThrough() This convenience method returns true if the value of
| |
| isUnderline | back to summary |
|---|---|
| public boolean isUnderline() This convenience method returns true if the value of
| |
| of | back to summary |
|---|---|
| public static <V> StyleAttributeMap of(StyleAttribute<V> attribute, V value) Convenience method creates the instance with a single attribute.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| private final HashMap |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public StyleAttributeMap | Returns: the new instanceCreates an immutable instance of |
| public StyleAttributeMap. | Returns: this Builder instancethe attributes to merge, may be null attrs)Merges the specified attributes with the attributes in this instance. |
| public < the attribute value type V> StyleAttributeMap. | Returns: this Builder instancethe attribute a, V the attribute value value)Sets the value for the specified attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe color color)Sets the paragraph background attribute to the specified color. |
| public StyleAttributeMap. | |
| public StyleAttributeMap. | |
| public StyleAttributeMap. | Returns: this Builder instancethe first line indent value size)Sets the FIRST_LINE_INDENT attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe font family name name)Sets the font family attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe font size in points size)Sets the font size attribute. |
| public StyleAttributeMap. | Returns: this Builder instancetrue for italic typeface on)Sets the italic attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe line spacing value value)Sets the line spacing paragraph attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe paragraph direction d)Sets the paragraph direction attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe space amount value)Sets the space above paragraph attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe space amount value)Sets the space below paragraph attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe space amount value)Sets the space left paragraph attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe space amount value)Sets the space right paragraph attribute. |
| public StyleAttributeMap. | Returns: this Builder instancetrue for strike-through typeface on)Sets the strike-through attribute. |
| public StyleAttributeMap. | Returns: this Builder instancethe alignment a)Sets the text alignment attribute to the specified color. |
| public StyleAttributeMap. | Returns: this Builder instancethe color color)Sets the text color attribute to the specified color. |
| public StyleAttributeMap. | Returns: this Builder instancetrue for underline on)Sets the underline attribute. |
| private StyleAttributeMap. |
| attributes | back to summary |
|---|---|
| private final HashMap<StyleAttribute<?>, Object> attributes | |
| Builder | back to summary |
|---|---|
| private Builder() | |
| build | back to summary |
|---|---|
| public StyleAttributeMap build() Creates an immutable instance of
| |
| merge | back to summary |
|---|---|
| public StyleAttributeMap. Merges the specified attributes with the attributes in this instance. The new values override any existing ones.
| |
| set | back to summary |
|---|---|
| public <V> StyleAttributeMap. Sets the value for the specified attribute.
This method will throw an
| |
| setBackground | back to summary |
|---|---|
| public StyleAttributeMap. Sets the paragraph background attribute to the specified color. It is recommended to specify a translucent background color in order to avoid obstructing the selection and the current line highlights.
| |
| setBold | back to summary |
|---|---|
| public StyleAttributeMap. Sets the bold attribute.
| |
| setBullet | back to summary |
|---|---|
| public StyleAttributeMap. Sets the BULLET attribute.
| |
| setFirstLineIndent | back to summary |
|---|---|
| public StyleAttributeMap. Sets the FIRST_LINE_INDENT attribute.
| |
| setFontFamily | back to summary |
|---|---|
| public StyleAttributeMap. Sets the font family attribute.
| |
| setFontSize | back to summary |
|---|---|
| public StyleAttributeMap. Sets the font size attribute.
| |
| setItalic | back to summary |
|---|---|
| public StyleAttributeMap. Sets the italic attribute.
| |
| setLineSpacing | back to summary |
|---|---|
| public StyleAttributeMap. Sets the line spacing paragraph attribute.
| |
| setRTL | back to summary |
|---|---|
| public StyleAttributeMap. Sets the paragraph direction attribute.
| |
| setSpaceAbove | back to summary |
|---|---|
| public StyleAttributeMap. Sets the space above paragraph attribute. This method also sets SPACE attribute to Boolean.TRUE.
| |
| setSpaceBelow | back to summary |
|---|---|
| public StyleAttributeMap. Sets the space below paragraph attribute. This method also sets SPACE attribute to Boolean.TRUE.
| |
| setSpaceLeft | back to summary |
|---|---|
| public StyleAttributeMap. Sets the space left paragraph attribute. This method also sets SPACE attribute to Boolean.TRUE.
| |
| setSpaceRight | back to summary |
|---|---|
| public StyleAttributeMap. Sets the space right paragraph attribute. This method also sets SPACE attribute to Boolean.TRUE.
| |
| setStrikeThrough | back to summary |
|---|---|
| public StyleAttributeMap. Sets the strike-through attribute.
| |
| setTextAlignment | back to summary |
|---|---|
| public StyleAttributeMap. Sets the text alignment attribute to the specified color.
| |
| setTextColor | back to summary |
|---|---|
| public StyleAttributeMap. Sets the text color attribute to the specified color.
| |
| setUnderline | back to summary |
|---|---|
| public StyleAttributeMap. Sets the underline attribute.
| |
| setUnguarded | back to summary |
|---|---|
| private StyleAttributeMap. | |