Home » openjdk-7 » javax » swing » text » [javadoc | source]
javax.swing.text
public class: StyleConstants [javadoc | source]
java.lang.Object
   javax.swing.text.StyleConstants

Direct Known Subclasses:
    ParagraphConstants, FontConstants, CharacterConstants, ColorConstants

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.

Diagram shows SpaceAbove, FirstLineIndent, LeftIndent, RightIndent,
     and SpaceBelow a paragraph.

Nested Class Summary:
public static class  StyleConstants.ParagraphConstants  This is a typesafe enumeration of the well-known attributes that contribute to a paragraph style. These are aliased by the outer class for general presentation. 
public static class  StyleConstants.CharacterConstants  This is a typesafe enumeration of the well-known attributes that contribute to a character style. These are aliased by the outer class for general presentation. 
public static class  StyleConstants.ColorConstants  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. 
public static class  StyleConstants.FontConstants  This is a typesafe enumeration of the well-known attributes that contribute to a font. These are aliased by the outer class for general presentation. 
Field Summary
public static final  String ComponentElementName    Name of elements used to represent components. 
public static final  String IconElementName    Name of elements used to represent icons. 
public static final  Object NameAttribute    Attribute name used to name the collection of attributes. 
public static final  Object ResolveAttribute    Attribute name used to identifiy the resolving parent set of attributes, if one is defined. 
public static final  Object ModelAttribute    Attribute used to identify the model for embedded objects that have a model view separation. 
public static final  Object BidiLevel    Bidirectional level of a character as assigned by the Unicode bidi algorithm. 
public static final  Object FontFamily    Name of the font family. 
public static final  Object Family    Name of the font family.
    since: 1.5 -
 
public static final  Object FontSize    Name of the font size. 
public static final  Object Size    Name of the font size.
    since: 1.5 -
 
public static final  Object Bold    Name of the bold attribute. 
public static final  Object Italic    Name of the italic attribute. 
public static final  Object Underline    Name of the underline attribute. 
public static final  Object StrikeThrough    Name of the Strikethrough attribute. 
public static final  Object Superscript    Name of the Superscript attribute. 
public static final  Object Subscript    Name of the Subscript attribute. 
public static final  Object Foreground    Name of the foreground color attribute. 
public static final  Object Background    Name of the background color attribute. 
public static final  Object ComponentAttribute    Name of the component attribute. 
public static final  Object IconAttribute    Name of the icon attribute. 
public static final  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. 
public static final  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. 
public static final  Object LeftIndent    The amount to indent the left side of the paragraph. Type is float and specifies the size in points. 
public static final  Object RightIndent    The amount to indent the right side of the paragraph. Type is float and specifies the size in points. 
public static final  Object LineSpacing    The amount of space between lines of the paragraph. Type is float and specifies the size as a factor of the line height 
public static final  Object SpaceAbove    The amount of space above the paragraph. Type is float and specifies the size in points. 
public static final  Object SpaceBelow    The amount of space below the paragraph. Type is float and specifies the size in points. 
public static final  Object Alignment    Alignment for the paragraph. The type is Integer. Valid values are:
  • ALIGN_LEFT
  • ALIGN_RIGHT
  • ALIGN_CENTER
  • ALIGN_JUSTIFED
 
public static final  Object TabSet    TabSet for the paragraph, type is a TabSet containing TabStops. 
public static final  Object Orientation    Orientation for a paragraph. 
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. 
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. 
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. 
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. 
static  Object[] keys     
Constructor:
 StyleConstants(String representation) 
Method from javax.swing.text.StyleConstants Summary:
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
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.text.StyleConstants Detail:
 public static int getAlignment(AttributeSet a) 
    Gets the alignment setting.
 public static Color getBackground(AttributeSet a) 
    Gets the background color setting from the attribute list.
 public static int getBidiLevel(AttributeSet a) 
    Gets the BidiLevel setting.
 public static Component getComponent(AttributeSet a) 
    Gets the component setting from the attribute list.
 public static float getFirstLineIndent(AttributeSet a) 
    Gets the first line indent setting.
 public static String getFontFamily(AttributeSet a) 
    Gets the font family setting from the attribute list.
 public static int getFontSize(AttributeSet a) 
    Gets the font size setting from the attribute list.
 public static Color getForeground(AttributeSet a) 
    Gets the foreground color setting from the attribute list.
 public static Icon getIcon(AttributeSet a) 
    Gets the icon setting from the attribute list.
 public static float getLeftIndent(AttributeSet a) 
    Gets the left indent setting.
 public static float getLineSpacing(AttributeSet a) 
    Gets the line spacing setting.
 public static float getRightIndent(AttributeSet a) 
    Gets the right indent setting.
 public static float getSpaceAbove(AttributeSet a) 
    Gets the space above setting.
 public static float getSpaceBelow(AttributeSet a) 
    Gets the space below setting.
 public static TabSet getTabSet(AttributeSet a) 
    Gets the TabSet.
 public static boolean isBold(AttributeSet a) 
    Checks whether the bold attribute is set.
 public static boolean isItalic(AttributeSet a) 
    Checks whether the italic attribute is set.
 public static boolean isStrikeThrough(AttributeSet a) 
    Checks whether the strikethrough attribute is set.
 public static boolean isSubscript(AttributeSet a) 
    Checks whether the subscript attribute is set.
 public static boolean isSuperscript(AttributeSet a) 
    Checks whether the superscript attribute is set.
 public static boolean isUnderline(AttributeSet a) 
    Checks whether the underline attribute is set.
 public static  void setAlignment(MutableAttributeSet a,
    int align) 
    Sets alignment.
 public static  void setBackground(MutableAttributeSet a,
    Color fg) 
    Sets the background color.
 public static  void setBidiLevel(MutableAttributeSet a,
    int o) 
    Sets the BidiLevel.
 public static  void setBold(MutableAttributeSet a,
    boolean b) 
    Sets the bold attribute.
 public static  void setComponent(MutableAttributeSet a,
    Component c) 
    Sets the component attribute.
 public static  void setFirstLineIndent(MutableAttributeSet a,
    float i) 
    Sets the first line indent.
 public static  void setFontFamily(MutableAttributeSet a,
    String fam) 
    Sets the font attribute.
 public static  void setFontSize(MutableAttributeSet a,
    int s) 
    Sets the font size attribute.
 public static  void setForeground(MutableAttributeSet a,
    Color fg) 
    Sets the foreground color.
 public static  void setIcon(MutableAttributeSet a,
    Icon c) 
    Sets the icon attribute.
 public static  void setItalic(MutableAttributeSet a,
    boolean b) 
    Sets the italic attribute.
 public static  void setLeftIndent(MutableAttributeSet a,
    float i) 
    Sets left indent.
 public static  void setLineSpacing(MutableAttributeSet a,
    float i) 
    Sets line spacing.
 public static  void setRightIndent(MutableAttributeSet a,
    float i) 
    Sets right indent.
 public static  void setSpaceAbove(MutableAttributeSet a,
    float i) 
    Sets space above.
 public static  void setSpaceBelow(MutableAttributeSet a,
    float i) 
    Sets space below.
 public static  void setStrikeThrough(MutableAttributeSet a,
    boolean b) 
    Sets the strikethrough attribute.
 public static  void setSubscript(MutableAttributeSet a,
    boolean b) 
    Sets the subscript attribute.
 public static  void setSuperscript(MutableAttributeSet a,
    boolean b) 
    Sets the superscript attribute.
 public static  void setTabSet(MutableAttributeSet a,
    TabSet tabs) 
    Sets the TabSet.
 public static  void setUnderline(MutableAttributeSet a,
    boolean b) 
    Sets the underline attribute.
 public String toString() 
    Returns the string representation.