Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.swing.text
Class StyleConstants

    java.lang.Object
      |
      +--javax.swing.text.StyleConstants

Direct Known Subclasses:
  StyleConstants.CharacterConstants, StyleConstants.ColorConstants, StyleConstants.FontConstants, StyleConstants.ParagraphConstants

public class StyleConstants
extends java.lang.Object

A collection of well known or common attribute keys and methods to apply to an AttributeSet or MutableAttributeSet to get/set the properties in a typesafe manner.

The paragraph attributes form the definition of a paragraph to be rendered. All sizes are specified in points (such as found in postscript), a device independent measure.

Inner Class Summary
`static class` | `StyleConstants.CharacterConstants` This is a typesafe enumeration of the well-known attributes that contribute to a character style.
`static class` | `StyleConstants.ColorConstants` This is a typesafe enumeration of the well-known attributes that contribute to a color.
`static class` | `StyleConstants.FontConstants` This is a typesafe enumeration of the well-known attributes that contribute to a font.
`static class` | `StyleConstants.ParagraphConstants` This is a typesafe enumeration of the well-known attributes that contribute to a paragraph style.

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

Method Summary
`static int` | `getAlignment(AttributeSet a)` Gets the alignment setting.
`static java.awt.Color` | `getBackground(AttributeSet a)` Gets the background color setting from the attribute list.
`static int` | `getBidiLevel(AttributeSet a)` Gets the BidiLevel setting.
`static java.awt.Component` | `getComponent(AttributeSet a)` Gets the component setting from the attribute list.
`static float` | `getFirstLineIndent(AttributeSet a)` Gets the first line indent setting.
`static java.lang.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 java.awt.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, java.awt.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, java.awt.Component c)` Sets the component attribute.
`static void` | `setFirstLineIndent(MutableAttributeSet a, float i)` Sets the first line indent.
`static void` | `setFontFamily(MutableAttributeSet a, java.lang.String fam)` Sets the font attribute.
`static void` | `setFontSize(MutableAttributeSet a, int s)` Sets the font size attribute.
`static void` | `setForeground(MutableAttributeSet a, java.awt.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.
`java.lang.String` | `toString()` Returns the string representation.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### ComponentElementName

    public static final java.lang.String ComponentElementName

  Name of elements used to represent components.

### IconElementName

    public static final java.lang.String IconElementName

  Name of elements used to represent icons.

### NameAttribute

    public static final java.lang.Object NameAttribute

  Attribute name used to name the collection of attributes.

### ResolveAttribute

    public static final java.lang.Object ResolveAttribute

  Attribute name used to identifiy the resolving parent set of attributes, if one is defined.

### ModelAttribute

    public static final java.lang.Object ModelAttribute

  Attribute used to identify the model for embedded objects that have a model view separation.

### BidiLevel

    public static final java.lang.Object BidiLevel

  Bidirectional level of a character as assigned by the Unicode bidi algorithm.

### FontFamily

    public static final java.lang.Object FontFamily

  Name of the font family.

### FontSize

    public static final java.lang.Object FontSize

  Name of the font size.

### Bold

    public static final java.lang.Object Bold

  Name of the bold attribute.

### Italic

    public static final java.lang.Object Italic

  Name of the italic attribute.

### Underline

    public static final java.lang.Object Underline

  Name of the underline attribute.

### StrikeThrough

    public static final java.lang.Object StrikeThrough

  Name of the Strikethrough attribute.

### Superscript

    public static final java.lang.Object Superscript

  Name of the Superscript attribute.

### Subscript

    public static final java.lang.Object Subscript

  Name of the Subscript attribute.

### Foreground

    public static final java.lang.Object Foreground

  Name of the foreground color attribute.

### Background

    public static final java.lang.Object Background

  Name of the background color attribute.

### ComponentAttribute

    public static final java.lang.Object ComponentAttribute

  Name of the component attribute.

### IconAttribute

    public static final java.lang.Object IconAttribute

  Name of the icon attribute.

### ComposedTextAttribute

    public static final java.lang.Object ComposedTextAttribute

  Name of the input method composed text attribute. The value of this attribute is an instance of AttributedString which represents the composed text.

### FirstLineIndent

    public static final java.lang.Object FirstLineIndent

  The amount of space to indent the first line of the paragraph. This value may be negative to offset in the reverse direction. The type is Float and specifies the size of the space in points.

### LeftIndent

    public static final java.lang.Object LeftIndent

  The amount to indent the left side of the paragraph. Type is float and specifies the size in points.

### RightIndent

    public static final java.lang.Object RightIndent

  The amount to indent the right side of the paragraph. Type is float and specifies the size in points.

### LineSpacing

    public static final java.lang.Object LineSpacing

  The amount of space between lines of the paragraph. Type is float and specifies the size in points.

### SpaceAbove

    public static final java.lang.Object SpaceAbove

  The amount of space above the paragraph. Type is float and specifies the size in points.

### SpaceBelow

    public static final java.lang.Object SpaceBelow

  The amount of space below the paragraph. Type is float and specifies the size in points.

### Alignment

    public static final java.lang.Object Alignment

  Alignment for the paragraph. The type is Integer. Valid values are:
  - ALIGN_LEFT
  - ALIGN_RIGHT
  - ALIGN_CENTER
  - ALIGN_JUSTIFED

### TabSet

    public static final java.lang.Object TabSet

  TabSet for the paragraph, type is a TabSet containing TabStops.

### Orientation

    public static final java.lang.Object Orientation

  Orientation for a paragraph.

### ALIGN_LEFT

    public static final int ALIGN_LEFT

  A possible value for paragraph alignment. This specifies that the text is aligned to the left indent and extra whitespace should be placed on the right.

### ALIGN_CENTER

    public static final int ALIGN_CENTER

  A possible value for paragraph alignment. This specifies that the text is aligned to the center and extra whitespace should be placed equally on the left and right.

### ALIGN_RIGHT

    public static final int ALIGN_RIGHT

  A possible value for paragraph alignment. This specifies that the text is aligned to the right indent and extra whitespace should be placed on the left.

### ALIGN_JUSTIFIED

    public static final int ALIGN_JUSTIFIED

  A possible value for paragraph alignment. This specifies that extra whitespace should be spread out through the rows of the paragraph with the text lined up with the left and right indent except on the last line which should be aligned to the left.

Method Detail

### toString

    public java.lang.String toString()

  Returns the string representation.
  Returns:
    the string
  Overrides:
    toString in class java.lang.Object

### getBidiLevel

    public static int getBidiLevel(AttributeSet a)

  Gets the BidiLevel setting.
  Parameters:
    `a` - the attribute set

### setBidiLevel

    public static void setBidiLevel(MutableAttributeSet a,
                                    int o)

  Sets the BidiLevel.
  Parameters:
    `a` - the attribute set
    `o` - the bidi level value

### getComponent

    public static java.awt.Component getComponent(AttributeSet a)

  Gets the component setting from the attribute list.
  Parameters:
    `a` - the attribute set
  Returns:
    the component, null if none

### setComponent

    public static void setComponent(MutableAttributeSet a,
                                    java.awt.Component c)

  Sets the component attribute.
  Parameters:
    `a` - the attribute set
    `c` - the component

### getIcon

    public static Icon getIcon(AttributeSet a)

  Gets the icon setting from the attribute list.
  Parameters:
    `a` - the attribute set
  Returns:
    the icon, null if none

### setIcon

    public static void setIcon(MutableAttributeSet a,
                               Icon c)

  Sets the icon attribute.
  Parameters:
    `a` - the attribute set
    `c` - the icon

### getFontFamily

    public static java.lang.String getFontFamily(AttributeSet a)

  Gets the font family setting from the attribute list.
  Parameters:
    `a` - the attribute set
  Returns:
    the font family, "Monospaced" as the default

### setFontFamily

    public static void setFontFamily(MutableAttributeSet a,
                                     java.lang.String fam)

  Sets the font attribute.
  Parameters:
    `a` - the attribute set
    `fam` - the font

### getFontSize

    public static int getFontSize(AttributeSet a)

  Gets the font size setting from the attribute list.
  Parameters:
    `a` - the attribute set
  Returns:
    the font size, 12 as the default

### setFontSize

    public static void setFontSize(MutableAttributeSet a,
                                   int s)

  Sets the font size attribute.
  Parameters:
    `a` - the attribute set
    `s` - the font size

### isBold

    public static boolean isBold(AttributeSet a)

  Checks whether the bold attribute is set.
  Parameters:
    `a` - the attribute set
  Returns:
    true if set else false

### setBold

    public static void setBold(MutableAttributeSet a,
                               boolean b)

  Sets the bold attribute.
  Parameters:
    `a` - the attribute set
    `b` - specifies true/false for setting the attribute

### isItalic

    public static boolean isItalic(AttributeSet a)

  Checks whether the italic attribute is set.
  Parameters:
    `a` - the attribute set
  Returns:
    true if set else false

### setItalic

    public static void setItalic(MutableAttributeSet a,
                                 boolean b)

  Sets the italic attribute.
  Parameters:
    `a` - the attribute set
    `b` - specifies true/false for setting the attribute

### isUnderline

    public static boolean isUnderline(AttributeSet a)

  Checks whether the underline attribute is set.
  Parameters:
    `a` - the attribute set
  Returns:
    true if set else false

### isStrikeThrough

    public static boolean isStrikeThrough(AttributeSet a)

  Checks whether the strikethrough attribute is set.
  Parameters:
    `a` - the attribute set
  Returns:
    true if set else false

### isSuperscript

    public static boolean isSuperscript(AttributeSet a)

  Checks whether the superscript attribute is set.
  Parameters:
    `a` - the attribute set
  Returns:
    true if set else false

### isSubscript

    public static boolean isSubscript(AttributeSet a)

  Checks whether the subscript attribute is set.
  Parameters:
    `a` - the attribute set
  Returns:
    true if set else false

### setUnderline

    public static void setUnderline(MutableAttributeSet a,
                                    boolean b)

  Sets the underline attribute.
  Parameters:
    `a` - the attribute set
    `b` - specifies true/false for setting the attribute

### setStrikeThrough

    public static void setStrikeThrough(MutableAttributeSet a,
                                        boolean b)

  Sets the strikethrough attribute.
  Parameters:
    `a` - the attribute set
    `b` - specifies true/false for setting the attribute

### setSuperscript

    public static void setSuperscript(MutableAttributeSet a,
                                      boolean b)

  Sets the superscript attribute.
  Parameters:
    `a` - the attribute set
    `b` - specifies true/false for setting the attribute

### setSubscript

    public static void setSubscript(MutableAttributeSet a,
                                    boolean b)

  Sets the subscript attribute.
  Parameters:
    `a` - the attribute set
    `b` - specifies true/false for setting the attribute

### getForeground

    public static java.awt.Color getForeground(AttributeSet a)

  Gets the foreground color setting from the attribute list.
  Parameters:
    `a` - the attribute set
  Returns:
    the color, Color.black as the default

### setForeground

    public static void setForeground(MutableAttributeSet a,
                                     java.awt.Color fg)

  Sets the foreground color.
  Parameters:
    `a` - the attribute set
    `fg` - the color

### getBackground

    public static java.awt.Color getBackground(AttributeSet a)

  Gets the background color setting from the attribute list.
  Parameters:
    `a` - the attribute set
  Returns:
    the color, Color.black as the default

### setBackground

    public static void setBackground(MutableAttributeSet a,
                                     java.awt.Color fg)

  Sets the background color.
  Parameters:
    `a` - the attribute set
    `fg` - the color

### getFirstLineIndent

    public static float getFirstLineIndent(AttributeSet a)

  Gets the first line indent setting.
  Parameters:
    `a` - the attribute set

### setFirstLineIndent

    public static void setFirstLineIndent(MutableAttributeSet a,
                                          float i)

  Sets the first line indent.
  Parameters:
    `a` - the attribute set
    `i` - the value

### getRightIndent

    public static float getRightIndent(AttributeSet a)

  Gets the right indent setting.
  Parameters:
    `a` - the attribute set

### setRightIndent

    public static void setRightIndent(MutableAttributeSet a,
                                      float i)

  Sets right indent.
  Parameters:
    `a` - the attribute set
    `i` - the value

### getLeftIndent

    public static float getLeftIndent(AttributeSet a)

  Gets the left indent setting.
  Parameters:
    `a` - the attribute set

### setLeftIndent

    public static void setLeftIndent(MutableAttributeSet a,
                                     float i)

  Sets left indent.
  Parameters:
    `a` - the attribute set
    `i` - the value

### getLineSpacing

    public static float getLineSpacing(AttributeSet a)

  Gets the line spacing setting.
  Parameters:
    `a` - the attribute set

### setLineSpacing

    public static void setLineSpacing(MutableAttributeSet a,
                                      float i)

  Sets line spacing.
  Parameters:
    `a` - the attribute set
    `i` - the value

### getSpaceAbove

    public static float getSpaceAbove(AttributeSet a)

  Gets the space above setting.
  Parameters:
    `a` - the attribute set

### setSpaceAbove

    public static void setSpaceAbove(MutableAttributeSet a,
                                     float i)

  Sets space above.
  Parameters:
    `a` - the attribute set
    `i` - the value

### getSpaceBelow

    public static float getSpaceBelow(AttributeSet a)

  Gets the space below setting.
  Parameters:
    `a` - the attribute set

### setSpaceBelow

    public static void setSpaceBelow(MutableAttributeSet a,
                                     float i)

  Sets space below.
  Parameters:
    `a` - the attribute set
    `i` - the value

### getAlignment

    public static int getAlignment(AttributeSet a)

  Gets the alignment setting.
  Parameters:
    `a` - the attribute set

### setAlignment

    public static void setAlignment(MutableAttributeSet a,
                                    int align)

  Sets alignment.
  Parameters:
    `a` - the attribute set
    `align` - the alignment value

### getTabSet

    public static TabSet getTabSet(AttributeSet a)

  Gets the TabSet.
  Parameters:
    `a` - the attribute set

### setTabSet

    public static void setTabSet(MutableAttributeSet a,
                                 TabSet tabs)

  Sets the TabSet.
  Parameters:
    `a` - the attribute set.
    `tabs` - the TabSet

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Swing 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.