| 
 | Java™ Platform Standard Ed. 6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.text.StyleConstants
public class StyleConstants
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.

| Nested Class Summary | |
|---|---|
| static class | StyleConstants.CharacterConstantsThis is a typesafe enumeration of the well-known attributes that contribute to a character style. | 
| static class | StyleConstants.ColorConstantsThis is a typesafe enumeration of the well-known attributes that contribute to a color. | 
| static class | StyleConstants.FontConstantsThis is a typesafe enumeration of the well-known attributes that contribute to a font. | 
| static class | StyleConstants.ParagraphConstantsThis is a typesafe enumeration of the well-known attributes that contribute to a paragraph style. | 
| Field Summary | |
|---|---|
| static int | ALIGN_CENTERA possible value for paragraph alignment. | 
| static int | ALIGN_JUSTIFIEDA possible value for paragraph alignment. | 
| static int | ALIGN_LEFTA possible value for paragraph alignment. | 
| static int | ALIGN_RIGHTA possible value for paragraph alignment. | 
| static Object | AlignmentAlignment for the paragraph. | 
| static Object | BackgroundName of the background color attribute. | 
| static Object | BidiLevelBidirectional level of a character as assigned by the Unicode bidi algorithm. | 
| static Object | BoldName of the bold attribute. | 
| static Object | ComponentAttributeName of the component attribute. | 
| static String | ComponentElementNameName of elements used to represent components. | 
| static Object | ComposedTextAttributeName of the input method composed text attribute. | 
| static Object | FamilyName of the font family. | 
| static Object | FirstLineIndentThe amount of space to indent the first line of the paragraph. | 
| static Object | FontFamilyName of the font family. | 
| static Object | FontSizeName of the font size. | 
| static Object | ForegroundName of the foreground color attribute. | 
| static Object | IconAttributeName of the icon attribute. | 
| static String | IconElementNameName of elements used to represent icons. | 
| static Object | ItalicName of the italic attribute. | 
| static Object | LeftIndentThe amount to indent the left side of the paragraph. | 
| static Object | LineSpacingThe amount of space between lines of the paragraph. | 
| static Object | ModelAttributeAttribute used to identify the model for embedded objects that have a model view separation. | 
| static Object | NameAttributeAttribute name used to name the collection of attributes. | 
| static Object | OrientationOrientation for a paragraph. | 
| static Object | ResolveAttributeAttribute name used to identifiy the resolving parent set of attributes, if one is defined. | 
| static Object | RightIndentThe amount to indent the right side of the paragraph. | 
| static Object | SizeName of the font size. | 
| static Object | SpaceAboveThe amount of space above the paragraph. | 
| static Object | SpaceBelowThe amount of space below the paragraph. | 
| static Object | StrikeThroughName of the Strikethrough attribute. | 
| static Object | SubscriptName of the Subscript attribute. | 
| static Object | SuperscriptName of the Superscript attribute. | 
| static Object | TabSetTabSet for the paragraph, type is a TabSet containing TabStops. | 
| static Object | UnderlineName of the underline attribute. | 
| Method Summary | |
|---|---|
| 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 inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final String ComponentElementName
public static final String IconElementName
public static final Object NameAttribute
public static final Object ResolveAttribute
public static final Object ModelAttribute
public static final Object BidiLevel
public static final Object FontFamily
public static final Object Family
public static final Object FontSize
public static final Object Size
public static final Object Bold
public static final Object Italic
public static final Object Underline
public static final Object StrikeThrough
public static final Object Superscript
public static final Object Subscript
public static final Object Foreground
public static final Object Background
public static final Object ComponentAttribute
public static final Object IconAttribute
public static final Object ComposedTextAttribute
public static final Object FirstLineIndent
public static final Object LeftIndent
public static final Object RightIndent
public static final Object LineSpacing
public static final Object SpaceAbove
public static final Object SpaceBelow
public static final Object Alignment
public static final Object TabSet
public static final Object Orientation
public static final int ALIGN_LEFT
public static final int ALIGN_CENTER
public static final int ALIGN_RIGHT
public static final int ALIGN_JUSTIFIED
| Method Detail | 
|---|
public String toString()
toString in class Objectpublic static int getBidiLevel(AttributeSet a)
a - the attribute set
public static void setBidiLevel(MutableAttributeSet a,
                                int o)
a - the attribute seto - the bidi level valuepublic static Component getComponent(AttributeSet a)
a - the attribute set
public static void setComponent(MutableAttributeSet a,
                                Component c)
a - the attribute setc - the componentpublic static Icon getIcon(AttributeSet a)
a - the attribute set
public static void setIcon(MutableAttributeSet a,
                           Icon c)
a - the attribute setc - the iconpublic static String getFontFamily(AttributeSet a)
a - the attribute set
public static void setFontFamily(MutableAttributeSet a,
                                 String fam)
a - the attribute setfam - the fontpublic static int getFontSize(AttributeSet a)
a - the attribute set
public static void setFontSize(MutableAttributeSet a,
                               int s)
a - the attribute sets - the font sizepublic static boolean isBold(AttributeSet a)
a - the attribute set
public static void setBold(MutableAttributeSet a,
                           boolean b)
a - the attribute setb - specifies true/false for setting the attributepublic static boolean isItalic(AttributeSet a)
a - the attribute set
public static void setItalic(MutableAttributeSet a,
                             boolean b)
a - the attribute setb - specifies true/false for setting the attributepublic static boolean isUnderline(AttributeSet a)
a - the attribute set
public static boolean isStrikeThrough(AttributeSet a)
a - the attribute set
public static boolean isSuperscript(AttributeSet a)
a - the attribute set
public static boolean isSubscript(AttributeSet a)
a - the attribute set
public static void setUnderline(MutableAttributeSet a,
                                boolean b)
a - the attribute setb - specifies true/false for setting the attribute
public static void setStrikeThrough(MutableAttributeSet a,
                                    boolean b)
a - the attribute setb - specifies true/false for setting the attribute
public static void setSuperscript(MutableAttributeSet a,
                                  boolean b)
a - the attribute setb - specifies true/false for setting the attribute
public static void setSubscript(MutableAttributeSet a,
                                boolean b)
a - the attribute setb - specifies true/false for setting the attributepublic static Color getForeground(AttributeSet a)
a - the attribute set
public static void setForeground(MutableAttributeSet a,
                                 Color fg)
a - the attribute setfg - the colorpublic static Color getBackground(AttributeSet a)
a - the attribute set
public static void setBackground(MutableAttributeSet a,
                                 Color fg)
a - the attribute setfg - the colorpublic static float getFirstLineIndent(AttributeSet a)
a - the attribute set
public static void setFirstLineIndent(MutableAttributeSet a,
                                      float i)
a - the attribute seti - the valuepublic static float getRightIndent(AttributeSet a)
a - the attribute set
public static void setRightIndent(MutableAttributeSet a,
                                  float i)
a - the attribute seti - the valuepublic static float getLeftIndent(AttributeSet a)
a - the attribute set
public static void setLeftIndent(MutableAttributeSet a,
                                 float i)
a - the attribute seti - the valuepublic static float getLineSpacing(AttributeSet a)
a - the attribute set
public static void setLineSpacing(MutableAttributeSet a,
                                  float i)
a - the attribute seti - the valuepublic static float getSpaceAbove(AttributeSet a)
a - the attribute set
public static void setSpaceAbove(MutableAttributeSet a,
                                 float i)
a - the attribute seti - the valuepublic static float getSpaceBelow(AttributeSet a)
a - the attribute set
public static void setSpaceBelow(MutableAttributeSet a,
                                 float i)
a - the attribute seti - the valuepublic static int getAlignment(AttributeSet a)
a - the attribute set
StyleConstants.ALIGN_LEFT if not set
public static void setAlignment(MutableAttributeSet a,
                                int align)
a - the attribute setalign - the alignment valuepublic static TabSet getTabSet(AttributeSet a)
a - the attribute set
TabSet
public static void setTabSet(MutableAttributeSet a,
                             TabSet tabs)
a - the attribute set.tabs - the TabSet| 
 | Java™ Platform Standard Ed. 6 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.