Package Summary  Overview Summary

class:StyleConstants [NONE]

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

public class StyleConstants
extends 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.

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

field:ComponentElementName [NONE]

  • ComponentElementName

    public static final  String ComponentElementName
    Name of elements used to represent components.
    See Also:
    Constant Field Values
  • field:IconElementName [NONE]

    IconElementName

    public static final  String IconElementName
    Name of elements used to represent icons.
    See Also:
    Constant Field Values

    field:NameAttribute [NONE]

    NameAttribute

    public static final  Object NameAttribute
    Attribute name used to name the collection of attributes.

    field:ResolveAttribute [NONE]

    ResolveAttribute

    public static final  Object ResolveAttribute
    Attribute name used to identify the resolving parent set of attributes, if one is defined.

    field:ModelAttribute [NONE]

    ModelAttribute

    public static final  Object ModelAttribute
    Attribute used to identify the model for embedded objects that have a model view separation.

    field:BidiLevel [NONE]

    BidiLevel

    public static final  Object BidiLevel
    Bidirectional level of a character as assigned by the Unicode bidi algorithm.

    field:FontFamily [NONE]

    FontFamily

    public static final  Object FontFamily
    Name of the font family.

    field:Family [NONE]

    Family

    public static final  Object Family
    Name of the font family.
    Since:
    1.5

    field:FontSize [NONE]

    FontSize

    public static final  Object FontSize
    Name of the font size.

    field:Size [NONE]

    Size

    public static final  Object Size
    Name of the font size.
    Since:
    1.5

    field:Bold [NONE]

    Bold

    public static final  Object Bold
    Name of the bold attribute.

    field:Italic [NONE]

    Italic

    public static final  Object Italic
    Name of the italic attribute.

    field:Underline [NONE]

    Underline

    public static final  Object Underline
    Name of the underline attribute.

    field:StrikeThrough [NONE]

    StrikeThrough

    public static final  Object StrikeThrough
    Name of the Strikethrough attribute.

    field:Superscript [NONE]

    Superscript

    public static final  Object Superscript
    Name of the Superscript attribute.

    field:Subscript [NONE]

    Subscript

    public static final  Object Subscript
    Name of the Subscript attribute.

    field:Foreground [NONE]

    Foreground

    public static final  Object Foreground
    Name of the foreground color attribute.

    field:Background [NONE]

    Background

    public static final  Object Background
    Name of the background color attribute.

    field:ComponentAttribute [NONE]

    ComponentAttribute

    public static final  Object ComponentAttribute
    Name of the component attribute.

    field:IconAttribute [NONE]

    IconAttribute

    public static final  Object IconAttribute
    Name of the icon attribute.

    field:ComposedTextAttribute [NONE]

    ComposedTextAttribute

    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.

    field:FirstLineIndent [NONE]

    FirstLineIndent

    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.

    field:LeftIndent [NONE]

    LeftIndent

    public static final  Object LeftIndent
    The amount to indent the left side of the paragraph. Type is float and specifies the size in points.

    field:RightIndent [NONE]

    RightIndent

    public static final  Object RightIndent
    The amount to indent the right side of the paragraph. Type is float and specifies the size in points.

    field:LineSpacing [NONE]

    LineSpacing

    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

    field:SpaceAbove [NONE]

    SpaceAbove

    public static final  Object SpaceAbove
    The amount of space above the paragraph. Type is float and specifies the size in points.

    field:SpaceBelow [NONE]

    SpaceBelow

    public static final  Object SpaceBelow
    The amount of space below the paragraph. Type is float and specifies the size in points.

    field:Alignment [NONE]

    Alignment

    public static final  Object Alignment
    Alignment for the paragraph. The type is Integer. Valid values are:
    • ALIGN_LEFT
    • ALIGN_RIGHT
    • ALIGN_CENTER
    • ALIGN_JUSTIFED

    field:TabSet [NONE]

    TabSet

    public static final  Object TabSet
    TabSet for the paragraph, type is a TabSet containing TabStops.

    field:Orientation [NONE]

    Orientation

    public static final  Object Orientation
    Orientation for a paragraph.

    field:ALIGN_LEFT [NONE]

    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.
    See Also:
    Constant Field Values

    field:ALIGN_CENTER [NONE]

    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.
    See Also:
    Constant Field Values

    field:ALIGN_RIGHT [NONE]

    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.
    See Also:
    Constant Field Values

    field:ALIGN_JUSTIFIED [NONE]

    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.
    See Also:
    Constant Field Values

    method:toString() [NONE]

  • toString

    public String toString()
    Returns the string representation.
    Overrides:
    toString in class Object
    Returns:
    the string
  • method:getBidiLevel(javax.swing.text.AttributeSet) [NONE]

    getBidiLevel

    public static  int getBidiLevel?(AttributeSet a)
    Gets the BidiLevel setting.
    Parameters:
    a - the attribute set
    Returns:
    the value

    method:setBidiLevel(javax.swing.text.MutableAttributeSet,int) [NONE]

    setBidiLevel

    public static  void setBidiLevel?(MutableAttributeSet a, int o)
    Sets the BidiLevel.
    Parameters:
    a - the attribute set
    o - the bidi level value

    method:getComponent(javax.swing.text.AttributeSet) [NONE]

    getComponent

    public static  Component getComponent?(AttributeSet a)
    Gets the component setting from the attribute list.
    Parameters:
    a - the attribute set
    Returns:
    the component, null if none

    method:setComponent(javax.swing.text.MutableAttributeSet,java.awt.Component) [NONE]

    setComponent

    public static  void setComponent?(MutableAttributeSet a, Component c)
    Sets the component attribute.
    Parameters:
    a - the attribute set
    c - the component

    method:getIcon(javax.swing.text.AttributeSet) [NONE]

    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

    method:setIcon(javax.swing.text.MutableAttributeSet,javax.swing.Icon) [NONE]

    setIcon

    public static  void setIcon?(MutableAttributeSet a, Icon c)
    Sets the icon attribute.
    Parameters:
    a - the attribute set
    c - the icon

    method:getFontFamily(javax.swing.text.AttributeSet) [NONE]

    getFontFamily

    public static  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

    method:setFontFamily(javax.swing.text.MutableAttributeSet,java.lang.String) [NONE]

    setFontFamily

    public static  void setFontFamily?(MutableAttributeSet a, String fam)
    Sets the font attribute.
    Parameters:
    a - the attribute set
    fam - the font

    method:getFontSize(javax.swing.text.AttributeSet) [NONE]

    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

    method:setFontSize(javax.swing.text.MutableAttributeSet,int) [NONE]

    setFontSize

    public static  void setFontSize?(MutableAttributeSet a, int s)
    Sets the font size attribute.
    Parameters:
    a - the attribute set
    s - the font size

    method:isBold(javax.swing.text.AttributeSet) [NONE]

    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

    method:setBold(javax.swing.text.MutableAttributeSet,boolean) [NONE]

    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

    method:isItalic(javax.swing.text.AttributeSet) [NONE]

    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

    method:setItalic(javax.swing.text.MutableAttributeSet,boolean) [NONE]

    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

    method:isUnderline(javax.swing.text.AttributeSet) [NONE]

    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

    method:isStrikeThrough(javax.swing.text.AttributeSet) [NONE]

    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

    method:isSuperscript(javax.swing.text.AttributeSet) [NONE]

    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

    method:isSubscript(javax.swing.text.AttributeSet) [NONE]

    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

    method:setUnderline(javax.swing.text.MutableAttributeSet,boolean) [NONE]

    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

    method:setStrikeThrough(javax.swing.text.MutableAttributeSet,boolean) [NONE]

    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

    method:setSuperscript(javax.swing.text.MutableAttributeSet,boolean) [NONE]

    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

    method:setSubscript(javax.swing.text.MutableAttributeSet,boolean) [NONE]

    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

    method:getForeground(javax.swing.text.AttributeSet) [NONE]

    getForeground

    public static  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

    method:setForeground(javax.swing.text.MutableAttributeSet,java.awt.Color) [NONE]

    setForeground

    public static  void setForeground?(MutableAttributeSet a, Color fg)
    Sets the foreground color.
    Parameters:
    a - the attribute set
    fg - the color

    method:getBackground(javax.swing.text.AttributeSet) [NONE]

    getBackground

    public static  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

    method:setBackground(javax.swing.text.MutableAttributeSet,java.awt.Color) [NONE]

    setBackground

    public static  void setBackground?(MutableAttributeSet a, Color fg)
    Sets the background color.
    Parameters:
    a - the attribute set
    fg - the color

    method:getFirstLineIndent(javax.swing.text.AttributeSet) [NONE]

    getFirstLineIndent

    public static  float getFirstLineIndent?(AttributeSet a)
    Gets the first line indent setting.
    Parameters:
    a - the attribute set
    Returns:
    the value, 0 if not set

    method:setFirstLineIndent(javax.swing.text.MutableAttributeSet,float) [NONE]

    setFirstLineIndent

    public static  void setFirstLineIndent?(MutableAttributeSet a, float i)
    Sets the first line indent.
    Parameters:
    a - the attribute set
    i - the value

    method:getRightIndent(javax.swing.text.AttributeSet) [NONE]

    getRightIndent

    public static  float getRightIndent?(AttributeSet a)
    Gets the right indent setting.
    Parameters:
    a - the attribute set
    Returns:
    the value, 0 if not set

    method:setRightIndent(javax.swing.text.MutableAttributeSet,float) [NONE]

    setRightIndent

    public static  void setRightIndent?(MutableAttributeSet a, float i)
    Sets right indent.
    Parameters:
    a - the attribute set
    i - the value

    method:getLeftIndent(javax.swing.text.AttributeSet) [NONE]

    getLeftIndent

    public static  float getLeftIndent?(AttributeSet a)
    Gets the left indent setting.
    Parameters:
    a - the attribute set
    Returns:
    the value, 0 if not set

    method:setLeftIndent(javax.swing.text.MutableAttributeSet,float) [NONE]

    setLeftIndent

    public static  void setLeftIndent?(MutableAttributeSet a, float i)
    Sets left indent.
    Parameters:
    a - the attribute set
    i - the value

    method:getLineSpacing(javax.swing.text.AttributeSet) [NONE]

    getLineSpacing

    public static  float getLineSpacing?(AttributeSet a)
    Gets the line spacing setting.
    Parameters:
    a - the attribute set
    Returns:
    the value, 0 if not set

    method:setLineSpacing(javax.swing.text.MutableAttributeSet,float) [NONE]

    setLineSpacing

    public static  void setLineSpacing?(MutableAttributeSet a, float i)
    Sets line spacing.
    Parameters:
    a - the attribute set
    i - the value

    method:getSpaceAbove(javax.swing.text.AttributeSet) [NONE]

    getSpaceAbove

    public static  float getSpaceAbove?(AttributeSet a)
    Gets the space above setting.
    Parameters:
    a - the attribute set
    Returns:
    the value, 0 if not set

    method:setSpaceAbove(javax.swing.text.MutableAttributeSet,float) [NONE]

    setSpaceAbove

    public static  void setSpaceAbove?(MutableAttributeSet a, float i)
    Sets space above.
    Parameters:
    a - the attribute set
    i - the value

    method:getSpaceBelow(javax.swing.text.AttributeSet) [NONE]

    getSpaceBelow

    public static  float getSpaceBelow?(AttributeSet a)
    Gets the space below setting.
    Parameters:
    a - the attribute set
    Returns:
    the value, 0 if not set

    method:setSpaceBelow(javax.swing.text.MutableAttributeSet,float) [NONE]

    setSpaceBelow

    public static  void setSpaceBelow?(MutableAttributeSet a, float i)
    Sets space below.
    Parameters:
    a - the attribute set
    i - the value

    method:getAlignment(javax.swing.text.AttributeSet) [NONE]

    getAlignment

    public static  int getAlignment?(AttributeSet a)
    Gets the alignment setting.
    Parameters:
    a - the attribute set
    Returns:
    the value StyleConstants.ALIGN_LEFT if not set

    method:setAlignment(javax.swing.text.MutableAttributeSet,int) [NONE]

    setAlignment

    public static  void setAlignment?(MutableAttributeSet a, int align)
    Sets alignment.
    Parameters:
    a - the attribute set
    align - the alignment value

    method:getTabSet(javax.swing.text.AttributeSet) [NONE]

    getTabSet

    public static  TabSet getTabSet?(AttributeSet a)
    Gets the TabSet.
    Parameters:
    a - the attribute set
    Returns:
    the TabSet

    method:setTabSet(javax.swing.text.MutableAttributeSet,javax.swing.text.TabSet) [NONE]

    setTabSet

    public static  void setTabSet?(MutableAttributeSet a, TabSet tabs)
    Sets the TabSet.
    Parameters:
    a - the attribute set.
    tabs - the TabSet

    © 2021 Oracle Corporation and/or its affiliates