StyleConstants.ColorConstants (Java SE 26 & JDK 26)
Description: declaration: module: java.desktop, package: javax.swing.text, class: StyleConstants, class: ColorConstants
Keywords: javax.swing.text.StyleConstants.ColorConstants class

# Class StyleConstants.ColorConstants

java.lang.Object
javax.swing.text.StyleConstants
javax.swing.text.StyleConstants.ColorConstants

All Implemented Interfaces:
  `AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute`

Enclosing class:
  `StyleConstants`

public static final class StyleConstants.ColorConstants extends StyleConstants implements AttributeSet.ColorAttribute, AttributeSet.CharacterAttribute
This is a typesafe enumeration of the well-known attributes that contribute to a color. These are aliased by the outer class for general presentation.

- ## Nested Class Summary

  ### Nested classes/interfaces declared in class StyleConstants

  `StyleConstants.CharacterConstants, StyleConstants.ColorConstants, StyleConstants.FontConstants, StyleConstants.ParagraphConstants`
  Modifier and Type
  Class
  Description
  `static final class`
  `StyleConstants.CharacterConstants`
  This is a typesafe enumeration of the well-known attributes that contribute to a character style.
  `static final class`
  `StyleConstants.ColorConstants`
  This is a typesafe enumeration of the well-known attributes that contribute to a color.
  `static final class`
  `StyleConstants.FontConstants`
  This is a typesafe enumeration of the well-known attributes that contribute to a font.
  `static final class`
  `StyleConstants.ParagraphConstants`
  This is a typesafe enumeration of the well-known attributes that contribute to a paragraph style.

- ## Field Summary

  ### Fields declared in class StyleConstants

  `ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_LEFT, ALIGN_RIGHT, Alignment, Background, BidiLevel, Bold, ComponentAttribute, ComponentElementName, ComposedTextAttribute, Family, FirstLineIndent, FontFamily, FontSize, Foreground, IconAttribute, IconElementName, Italic, LeftIndent, LineSpacing, ModelAttribute, NameAttribute, Orientation, ResolveAttribute, RightIndent, Size, SpaceAbove, SpaceBelow, StrikeThrough, Subscript, Superscript, TabSet, Underline`
  Modifier and Type
  Field
  Description
  `static final int`
  `ALIGN_CENTER`
  A possible value for paragraph alignment.
  `static final int`
  `ALIGN_JUSTIFIED`
  A possible value for paragraph alignment.
  `static final int`
  `ALIGN_LEFT`
  A possible value for paragraph alignment.
  `static final int`
  `ALIGN_RIGHT`
  A possible value for paragraph alignment.
  `static final Object`
  `Alignment`
  Alignment for the paragraph.
  `static final Object`
  `Background`
  Name of the background color attribute.
  `static final Object`
  `BidiLevel`
  Bidirectional level of a character as assigned by the Unicode bidi algorithm.
  `static final Object`
  `Bold`
  Name of the bold attribute.
  `static final Object`
  `ComponentAttribute`
  Name of the component attribute.
  `static final String`
  `ComponentElementName`
  Name of elements used to represent components.
  `static final Object`
  `ComposedTextAttribute`
  Name of the input method composed text attribute.
  `static final Object`
  `Family`
  Name of the font family.
  `static final Object`
  `FirstLineIndent`
  The amount of space to indent the first line of the paragraph.
  `static final Object`
  `FontFamily`
  Name of the font family.
  `static final Object`
  `FontSize`
  Name of the font size.
  `static final Object`
  `Foreground`
  Name of the foreground color attribute.
  `static final Object`
  `IconAttribute`
  Name of the icon attribute.
  `static final String`
  `IconElementName`
  Name of elements used to represent icons.
  `static final Object`
  `Italic`
  Name of the italic attribute.
  `static final Object`
  `LeftIndent`
  The amount to indent the left side of the paragraph.
  `static final Object`
  `LineSpacing`
  The amount of space between lines of the paragraph.
  `static final Object`
  `ModelAttribute`
  Attribute used to identify the model for embedded objects that have a model view separation.
  `static final Object`
  `NameAttribute`
  Attribute name used to name the collection of attributes.
  `static final Object`
  `Orientation`
  Orientation for a paragraph.
  `static final Object`
  `ResolveAttribute`
  Attribute name used to identify the resolving parent set of attributes, if one is defined.
  `static final Object`
  `RightIndent`
  The amount to indent the right side of the paragraph.
  `static final Object`
  `Size`
  Name of the font size.
  `static final Object`
  `SpaceAbove`
  The amount of space above the paragraph.
  `static final Object`
  `SpaceBelow`
  The amount of space below the paragraph.
  `static final Object`
  `StrikeThrough`
  Name of the Strikethrough attribute.
  `static final Object`
  `Subscript`
  Name of the Subscript attribute.
  `static final Object`
  `Superscript`
  Name of the Superscript attribute.
  `static final Object`
  `TabSet`
  TabSet for the paragraph, type is a TabSet containing TabStops.
  `static final Object`
  `Underline`
  Name of the underline attribute.

- ## Method Summary

  ### Methods declared in class StyleConstants

  `getAlignment, getBackground, getBidiLevel, getComponent, getFirstLineIndent, getFontFamily, getFontSize, getForeground, getIcon, getLeftIndent, getLineSpacing, getRightIndent, getSpaceAbove, getSpaceBelow, getTabSet, isBold, isItalic, isStrikeThrough, isSubscript, isSuperscript, isUnderline, setAlignment, setBackground, setBidiLevel, setBold, setComponent, setFirstLineIndent, setFontFamily, setFontSize, setForeground, setIcon, setItalic, setLeftIndent, setLineSpacing, setRightIndent, setSpaceAbove, setSpaceBelow, setStrikeThrough, setSubscript, setSuperscript, setTabSet, setUnderline, toString`
  Modifier and Type
  Method
  Description
  `static int`
  `getAlignment(AttributeSet a)`
  Gets the alignment setting.
  `static Color`
  `getBackground(AttributeSet a)`
  Gets the background color setting from the attribute list.
  `static int`
  `getBidiLevel(AttributeSet a)`
  Gets the BidiLevel setting.
  `static Component`
  `getComponent(AttributeSet a)`
  Gets the component setting from the attribute list.
  `static float`
  `getFirstLineIndent(AttributeSet a)`
  Gets the first line indent setting.
  `static String`
  `getFontFamily(AttributeSet a)`
  Gets the font family setting from the attribute list.
  `static int`
  `getFontSize(AttributeSet a)`
  Gets the font size setting from the attribute list.
  `static Color`
  `getForeground(AttributeSet a)`
  Gets the foreground color setting from the attribute list.
  `static Icon`
  `getIcon(AttributeSet a)`
  Gets the icon setting from the attribute list.
  `static float`
  `getLeftIndent(AttributeSet a)`
  Gets the left indent setting.
  `static float`
  `getLineSpacing(AttributeSet a)`
  Gets the line spacing setting.
  `static float`
  `getRightIndent(AttributeSet a)`
  Gets the right indent setting.
  `static float`
  `getSpaceAbove(AttributeSet a)`
  Gets the space above setting.
  `static float`
  `getSpaceBelow(AttributeSet a)`
  Gets the space below setting.
  `static TabSet`
  `getTabSet(AttributeSet a)`
  Gets the TabSet.
  `static boolean`
  `isBold(AttributeSet a)`
  Checks whether the bold attribute is set.
  `static boolean`
  `isItalic(AttributeSet a)`
  Checks whether the italic attribute is set.
  `static boolean`
  `isStrikeThrough(AttributeSet a)`
  Checks whether the strikethrough attribute is set.
  `static boolean`
  `isSubscript(AttributeSet a)`
  Checks whether the subscript attribute is set.
  `static boolean`
  `isSuperscript(AttributeSet a)`
  Checks whether the superscript attribute is set.
  `static boolean`
  `isUnderline(AttributeSet a)`
  Checks whether the underline attribute is set.
  `static void`
  `setAlignment(MutableAttributeSet a, int align)`
  Sets alignment.
  `static void`
  `setBackground(MutableAttributeSet a, Color fg)`
  Sets the background color.
  `static void`
  `setBidiLevel(MutableAttributeSet a, int o)`
  Sets the BidiLevel.
  `static void`
  `setBold(MutableAttributeSet a, boolean b)`
  Sets the bold attribute.
  `static void`
  `setComponent(MutableAttributeSet a, Component c)`
  Sets the component attribute.
  `static void`
  `setFirstLineIndent(MutableAttributeSet a, float i)`
  Sets the first line indent.
  `static void`
  `setFontFamily(MutableAttributeSet a, String fam)`
  Sets the font attribute.
  `static void`
  `setFontSize(MutableAttributeSet a, int s)`
  Sets the font size attribute.
  `static void`
  `setForeground(MutableAttributeSet a, Color fg)`
  Sets the foreground color.
  `static void`
  `setIcon(MutableAttributeSet a, Icon c)`
  Sets the icon attribute.
  `static void`
  `setItalic(MutableAttributeSet a, boolean b)`
  Sets the italic attribute.
  `static void`
  `setLeftIndent(MutableAttributeSet a, float i)`
  Sets left indent.
  `static void`
  `setLineSpacing(MutableAttributeSet a, float i)`
  Sets line spacing.
  `static void`
  `setRightIndent(MutableAttributeSet a, float i)`
  Sets right indent.
  `static void`
  `setSpaceAbove(MutableAttributeSet a, float i)`
  Sets space above.
  `static void`
  `setSpaceBelow(MutableAttributeSet a, float i)`
  Sets space below.
  `static void`
  `setStrikeThrough(MutableAttributeSet a, boolean b)`
  Sets the strikethrough attribute.
  `static void`
  `setSubscript(MutableAttributeSet a, boolean b)`
  Sets the subscript attribute.
  `static void`
  `setSuperscript(MutableAttributeSet a, boolean b)`
  Sets the superscript attribute.
  `static void`
  `setTabSet(MutableAttributeSet a, TabSet tabs)`
  Sets the TabSet.
  `static void`
  `setUnderline(MutableAttributeSet a, boolean b)`
  Sets the underline attribute.
  `String`
  `toString()`
  Returns the string representation.

  ### Methods declared in class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  Creates and returns a copy of this object.
  `boolean`
  `equals(Object obj)`
  Indicates whether some other object is "equal to" this one.
  `protected void`
  `finalize()`
  Deprecated, for removal: This API element is subject to removal in a future version.
  Finalization is deprecated and subject to removal in a future release.
  `final Class<?>`
  `getClass()`
  Returns the runtime class of this `Object`.
  `int`
  `hashCode()`
  Returns a hash code value for this object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `final void`
  `wait()`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted.
  `final void`
  `wait(long timeoutMillis)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
  `final void`
  `wait(long timeoutMillis, int nanos)`
  Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.