javax.swing.text
public class StyleConstants extends Object
Since: 1.2
Nested Class Summary | |
---|---|
static class | StyleConstants.CharacterConstants
A set of keys for attributes that apply to characters. |
static class | StyleConstants.ColorConstants
A set of keys for attributes that relate to colors. |
static class | StyleConstants.FontConstants
A set of keys for attributes that apply to fonts. |
static class | StyleConstants.ParagraphConstants
A set of keys for attributes that apply to paragraphs. |
Field Summary | |
---|---|
static Object | Alignment An alias for {@link ParagraphConstants#Alignment}. |
static int | ALIGN_CENTER
A value representing center alignment for the
{@link ParagraphConstants#Alignment} attribute. |
static int | ALIGN_JUSTIFIED
A value representing ful justification for the
{@link ParagraphConstants#Alignment} attribute. |
static int | ALIGN_LEFT
A value representing left alignment for the
{@link ParagraphConstants#Alignment} attribute. |
static int | ALIGN_RIGHT
A value representing right alignment for the
{@link ParagraphConstants#Alignment} attribute. |
static Object | Background An alias for {@link CharacterConstants#Background}. |
static Object | BidiLevel An alias for {@link CharacterConstants#BidiLevel}. |
static Object | Bold An alias for {@link CharacterConstants#Bold}. |
static Object | ComponentAttribute An alias for {@link CharacterConstants#ComponentAttribute}. |
static String | ComponentElementName |
static Object | ComposedTextAttribute |
static Object | Family An alias for {@link CharacterConstants#Family}. |
static Object | FirstLineIndent An alias for {@link ParagraphConstants#FirstLineIndent}. |
static Object | FontFamily An alias for {@link CharacterConstants#Family}. |
static Object | FontSize An alias for {@link CharacterConstants#Size}. |
static Object | Foreground An alias for {@link CharacterConstants#Foreground}. |
static Object | IconAttribute An alias for {@link CharacterConstants#IconAttribute}. |
static String | IconElementName |
static Object | Italic An alias for {@link CharacterConstants#Italic}. |
static Object | LeftIndent An alias for {@link ParagraphConstants#LeftIndent}. |
static Object | LineSpacing An alias for {@link ParagraphConstants#LineSpacing}. |
static Object | ModelAttribute |
static Object | NameAttribute |
static Object | Orientation An alias for {@link ParagraphConstants#Orientation}. |
static Object | ResolveAttribute |
static Object | RightIndent An alias for {@link ParagraphConstants#RightIndent}. |
static Object | Size An alias for {@link CharacterConstants#Size}. |
static Object | SpaceAbove An alias for {@link ParagraphConstants#SpaceAbove}. |
static Object | SpaceBelow An alias for {@link ParagraphConstants#SpaceBelow}. |
static Object | StrikeThrough An alias for {@link CharacterConstants#StrikeThrough}. |
static Object | Subscript An alias for {@link CharacterConstants#Subscript}. |
static Object | Superscript An alias for {@link CharacterConstants#Superscript}. |
static Object | TabSet An alias for {@link ParagraphConstants#TabSet}. |
static Object | Underline An alias for {@link CharacterConstants#Underline}. |
Method Summary | |
---|---|
static int | getAlignment(AttributeSet a)
Returns the alignment specified in the given attributes, or
{@link #ALIGN_LEFT} if no alignment is specified.
|
static Color | getBackground(AttributeSet a)
Returns the background color specified in the given attributes, or
{@link Color#BLACK} if no background color is specified.
|
static int | getBidiLevel(AttributeSet a)
Returns the bidi level specified in the given attributes, or
0 if no bidi level is specified.
|
static Component | getComponent(AttributeSet a)
Returns the component specified in the given attributes, or
null if no component is specified.
|
static float | getFirstLineIndent(AttributeSet a)
Returns the indentation specified in the given attributes, or
0.0f if no indentation is specified.
|
static String | getFontFamily(AttributeSet a)
Returns the font family specified in the given attributes, or
Monospaced if no font family is specified.
|
static int | getFontSize(AttributeSet a)
Returns the font size specified in the given attributes, or
12 if no font size is specified.
|
static Color | getForeground(AttributeSet a)
Returns the foreground color specified in the given attributes, or
{@link Color#BLACK} if no foreground color is specified.
|
static Icon | getIcon(AttributeSet a)
Returns the icon specified in the given attributes, or
null if no icon is specified.
|
static float | getLeftIndent(AttributeSet a)
Returns the left indentation specified in the given attributes, or
0.0f if no left indentation is specified.
|
static float | getLineSpacing(AttributeSet a)
Returns the line spacing specified in the given attributes, or
0.0f if no line spacing is specified.
|
static float | getRightIndent(AttributeSet a)
Returns the right indentation specified in the given attributes, or
0.0f if no right indentation is specified.
|
static float | getSpaceAbove(AttributeSet a)
Returns the 'space above' specified in the given attributes, or
0.0f if no 'space above' is specified.
|
static float | getSpaceBelow(AttributeSet a)
Returns the 'space below' specified in the given attributes, or
0.0f if no 'space below' is specified.
|
static TabSet | getTabSet(AttributeSet a)
Returns the tab set specified in the given attributes, or
null if no tab set is specified.
|
static boolean | isBold(AttributeSet a)
Returns the value of the bold flag in the given attributes, or
false if no bold flag is specified.
|
static boolean | isItalic(AttributeSet a)
Returns the value of the italic flag in the given attributes, or
false if no italic flag is specified.
|
static boolean | isStrikeThrough(AttributeSet a)
Returns the value of the strike-through flag in the given attributes, or
false if no strike-through flag is specified.
|
static boolean | isSubscript(AttributeSet a)
Returns the value of the subscript flag in the given attributes, or
false if no subscript flag is specified.
|
static boolean | isSuperscript(AttributeSet a)
Returns the value of the superscript flag in the given attributes, or
false if no superscript flag is specified.
|
static boolean | isUnderline(AttributeSet a)
Returns the value of the underline flag in the given attributes, or
false if no underline flag is specified.
|
static void | setAlignment(MutableAttributeSet a, int align)
Adds an alignment attribute to the specified set.
|
static void | setBackground(MutableAttributeSet a, Color bg)
Adds a background attribute to the specified set.
|
static void | setBidiLevel(MutableAttributeSet a, int lev)
Adds a bidi-level attribute to the specified set.
|
static void | setBold(MutableAttributeSet a, boolean b)
Adds a bold attribute to the specified set.
|
static void | setComponent(MutableAttributeSet a, Component c)
Adds a component attribute to the specified set.
|
static void | setFirstLineIndent(MutableAttributeSet a, float i)
Adds a first line indentation attribute to the specified set.
|
static void | setFontFamily(MutableAttributeSet a, String fam)
Adds a font family attribute to the specified set.
|
static void | setFontSize(MutableAttributeSet a, int s)
Adds a font size attribute to the specified set.
|
static void | setForeground(MutableAttributeSet a, Color fg)
Adds a foreground color attribute to the specified set.
|
static void | setIcon(MutableAttributeSet a, Icon c)
Adds an icon attribute to the specified set.
|
static void | setItalic(MutableAttributeSet a, boolean b)
Adds an italic attribute to the specified set.
|
static void | setLeftIndent(MutableAttributeSet a, float i)
Adds a left indentation attribute to the specified set.
|
static void | setLineSpacing(MutableAttributeSet a, float i)
Adds a line spacing attribute to the specified set.
|
static void | setRightIndent(MutableAttributeSet a, float i)
Adds a right indentation attribute to the specified set.
|
static void | setSpaceAbove(MutableAttributeSet a, float i)
Adds a 'space above' attribute to the specified set.
|
static void | setSpaceBelow(MutableAttributeSet a, float i)
Adds a 'space below' attribute to the specified set.
|
static void | setStrikeThrough(MutableAttributeSet a, boolean b)
Adds a strike-through attribue to the specified set.
|
static void | setSubscript(MutableAttributeSet a, boolean b)
Adds a subscript attribute to the specified set.
|
static void | setSuperscript(MutableAttributeSet a, boolean b)
Adds a superscript attribute to the specified set.
|
static void | setTabSet(MutableAttributeSet a, TabSet tabs)
Adds a {@link TabSet} attribute to the specified set.
|
static void | setUnderline(MutableAttributeSet a, boolean b)
Adds an underline attribute to the specified set.
|
String | toString()
Returns a string representation of the attribute key.
|
Parameters: a the attribute set (null
not permitted).
Returns: The alignment (typically one of {@link #ALIGN_LEFT}, {@link #ALIGN_RIGHT}, {@link #ALIGN_CENTER} or {@link #ALIGN_JUSTIFIED}).
See Also: StyleConstants
Parameters: a the attribute set (null
not permitted).
Returns: The background color.
See Also: StyleConstants
0
if no bidi level is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The bidi level.
See Also: StyleConstants
null
if no component is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The component (possibly null
).
See Also: StyleConstants
0.0f
if no indentation is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The indentation.
See Also: StyleConstants
Monospaced
if no font family is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The font family.
See Also: StyleConstants
12
if no font size is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The font size.
See Also: StyleConstants
Parameters: a the attribute set (null
not permitted).
Returns: The foreground color.
See Also: StyleConstants
null
if no icon is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The icon (possibly null
).
See Also: StyleConstants
0.0f
if no left indentation is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The left indentation.
See Also: StyleConstants
0.0f
if no line spacing is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The line spacing.
See Also: StyleConstants
0.0f
if no right indentation is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The right indentation.
See Also: StyleConstants
0.0f
if no 'space above' is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The 'space above'.
See Also: StyleConstants
0.0f
if no 'space below' is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The 'space below'.
See Also: StyleConstants
null
if no tab set is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The tab set.
See Also: StyleConstants
false
if no bold flag is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The bold flag.
See Also: StyleConstants
false
if no italic flag is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The italic flag.
See Also: StyleConstants
false
if no strike-through flag is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The strike-through flag.
See Also: StyleConstants
false
if no subscript flag is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The subscript flag.
See Also: StyleConstants
false
if no superscript flag is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The superscript flag.
See Also: StyleConstants
false
if no underline flag is specified.
Parameters: a the attribute set (null
not permitted).
Returns: The underline flag.
See Also: StyleConstants
Parameters: a the attribute set (null
not permitted). align the alignment (typically one of
{@link StyleConstants#ALIGN_LEFT},
{@link StyleConstants#ALIGN_RIGHT},
{@link StyleConstants#ALIGN_CENTER} or
{@link StyleConstants#ALIGN_JUSTIFIED}).
Throws: NullPointerException if a
is null
.
See Also: getAlignment
Parameters: a the attribute set (null
not permitted). bg the background (null
not permitted).
Throws: NullPointerException if either argument is null
.
See Also: getBackground
Parameters: a the attribute set (null
not permitted). lev the level.
Throws: NullPointerException if a
is null
.
See Also: getBidiLevel
Parameters: a the attribute set (null
not permitted). b the new value of the bold attribute.
Throws: NullPointerException if a
is null
.
See Also: isBold
Parameters: a the attribute set (null
not permitted). c the component (null
not permitted).
Throws: NullPointerException if either argument is null
.
See Also: getComponent
Parameters: a the attribute set (null
not permitted). i the indentation.
Throws: NullPointerException if a
is null
.
See Also: getFirstLineIndent
Parameters: a the attribute set (null
not permitted). fam the font family name (null
not permitted).
Throws: NullPointerException if either argument is null
.
See Also: getFontFamily
Parameters: a the attribute set (null
not permitted). s the font size (in points).
Throws: NullPointerException if a
is null
.
See Also: getFontSize
Parameters: a the attribute set (null
not permitted). fg the foreground color (null
not permitted).
Throws: NullPointerException if either argument is null
.
See Also: getForeground
Parameters: a the attribute set (null
not permitted). c the icon (null
not permitted).
Throws: NullPointerException if either argument is null
.
See Also: getIcon
Parameters: a the attribute set (null
not permitted). b the new value of the italic attribute.
Throws: NullPointerException if a
is null
.
See Also: isItalic
Parameters: a the attribute set (null
not permitted). i the indentation.
Throws: NullPointerException if a
is null
.
See Also: getLeftIndent
Parameters: a the attribute set (null
not permitted). i the line spacing.
Throws: NullPointerException if a
is null
.
See Also: getLineSpacing
Parameters: a the attribute set (null
not permitted). i the right indentation.
Throws: NullPointerException if a
is null
.
See Also: getRightIndent
Parameters: a the attribute set (null
not permitted). i the space above attribute value.
Throws: NullPointerException if a
is null
.
See Also: getSpaceAbove
Parameters: a the attribute set (null
not permitted). i the space below attribute value.
Throws: NullPointerException if a
is null
.
See Also: getSpaceBelow
Parameters: a the attribute set (null
not permitted). b the strike-through attribute value.
Throws: NullPointerException if a
is null
.
See Also: isStrikeThrough
Parameters: a the attribute set (null
not permitted). b the subscript attribute value.
Throws: NullPointerException if a
is null
.
See Also: isSubscript
Parameters: a the attribute set (null
not permitted). b the superscript attribute value.
Throws: NullPointerException if a
is null
.
See Also: isSuperscript
Parameters: a the attribute set (null
not permitted). tabs the tab set (null
not permitted).
Throws: NullPointerException if either argument is null
.
See Also: getTabSet
Parameters: a the attribute set (null
not permitted). b the underline attribute value.
Throws: NullPointerException if a
is null
.
See Also: isUnderline
Returns: A string representation of the attribute key.