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.

| Modifier and Type | Class and Description |
|---|---|
static class |
StyleConstants
This is a typesafe enumeration of the
well-known attributes that contribute to a character style.
|
static class |
StyleConstants
This is a typesafe enumeration of the
well-known attributes that contribute to a color.
|
static class |
StyleConstants
This is a typesafe enumeration of the
well-known attributes that contribute to a font.
|
static class |
StyleConstants
This is a typesafe enumeration of the
well-known attributes that contribute to a paragraph style.
|
| Modifier and Type | Field and Description |
|---|---|
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 Object |
Alignment
Alignment for the paragraph.
|
static Object |
Background
Name of the background color attribute.
|
static Object |
BidiLevel
Bidirectional level of a character as assigned by the Unicode bidi algorithm.
|
static Object |
Bold
Name of the bold attribute.
|
static Object |
ComponentAttribute
Name of the component attribute.
|
static String |
ComponentElementName
Name of elements used to represent components.
|
static Object |
ComposedTextAttribute
Name of the input method composed text attribute.
|
static Object |
Family
Name of the font family.
|
static Object |
FirstLineIndent
The amount of space to indent the first line of the paragraph.
|
static Object |
FontFamily
Name of the font family.
|
static Object |
FontSize
Name of the font size.
|
static Object |
Foreground
Name of the foreground color attribute.
|
static Object |
IconAttribute
Name of the icon attribute.
|
static String |
IconElementName
Name of elements used to represent icons.
|
static Object |
Italic
Name of the italic attribute.
|
static Object |
LeftIndent
The amount to indent the left side of the paragraph.
|
static Object |
LineSpacing
The amount of space between lines of the paragraph.
|
static Object |
ModelAttribute
Attribute used to identify the model for embedded objects that have a model view separation.
|
static Object |
NameAttribute
Attribute name used to name the collection of attributes.
|
static Object |
Orientation
Orientation for a paragraph.
|
static Object |
ResolveAttribute
Attribute name used to identify the resolving parent set of attributes, if one is defined.
|
static Object |
RightIndent
The amount to indent the right side of the paragraph.
|
static Object |
Size
Name of the font size.
|
static Object |
SpaceAbove
The amount of space above the paragraph.
|
static Object |
SpaceBelow
The amount of space below the paragraph.
|
static Object |
StrikeThrough
Name of the Strikethrough attribute.
|
static Object |
Subscript
Name of the Subscript attribute.
|
static Object |
Superscript
Name of the Superscript attribute.
|
static Object |
TabSet
TabSet for the paragraph, type is a TabSet containing TabStops.
|
static Object |
Underline
Name of the underline attribute.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getAlignment(AttributeSet
Gets the alignment setting.
|
static Color |
getBackground(AttributeSet
Gets the background color setting from the attribute list.
|
static int |
getBidiLevel(AttributeSet
Gets the BidiLevel setting.
|
static Component |
getComponent(AttributeSet
Gets the component setting from the attribute list.
|
static float |
getFirstLineIndent(AttributeSet
Gets the first line indent setting.
|
static String |
getFontFamily(AttributeSet
Gets the font family setting from the attribute list.
|
static int |
getFontSize(AttributeSet
Gets the font size setting from the attribute list.
|
static Color |
getForeground(AttributeSet
Gets the foreground color setting from the attribute list.
|
static Icon |
getIcon(AttributeSet
Gets the icon setting from the attribute list.
|
static float |
getLeftIndent(AttributeSet
Gets the left indent setting.
|
static float |
getLineSpacing(AttributeSet
Gets the line spacing setting.
|
static float |
getRightIndent(AttributeSet
Gets the right indent setting.
|
static float |
getSpaceAbove(AttributeSet
Gets the space above setting.
|
static float |
getSpaceBelow(AttributeSet
Gets the space below setting.
|
static TabSet |
getTabSet(AttributeSet
Gets the TabSet.
|
static boolean |
isBold(AttributeSet
Checks whether the bold attribute is set.
|
static boolean |
isItalic(AttributeSet
Checks whether the italic attribute is set.
|
static boolean |
isStrikeThrough(AttributeSet
Checks whether the strikethrough attribute is set.
|
static boolean |
isSubscript(AttributeSet
Checks whether the subscript attribute is set.
|
static boolean |
isSuperscript(AttributeSet
Checks whether the superscript attribute is set.
|
static boolean |
isUnderline(AttributeSet
Checks whether the underline attribute is set.
|
static void |
setAlignment(MutableAttributeSet
Sets alignment.
|
static void |
setBackground(MutableAttributeSet
Sets the background color.
|
static void |
setBidiLevel(MutableAttributeSet
Sets the BidiLevel.
|
static void |
setBold(MutableAttributeSet
Sets the bold attribute.
|
static void |
setComponent(MutableAttributeSet
Sets the component attribute.
|
static void |
setFirstLineIndent(MutableAttributeSet
Sets the first line indent.
|
static void |
setFontFamily(MutableAttributeSet
Sets the font attribute.
|
static void |
setFontSize(MutableAttributeSet
Sets the font size attribute.
|
static void |
setForeground(MutableAttributeSet
Sets the foreground color.
|
static void |
setIcon(MutableAttributeSet
Sets the icon attribute.
|
static void |
setItalic(MutableAttributeSet
Sets the italic attribute.
|
static void |
setLeftIndent(MutableAttributeSet
Sets left indent.
|
static void |
setLineSpacing(MutableAttributeSet
Sets line spacing.
|
static void |
setRightIndent(MutableAttributeSet
Sets right indent.
|
static void |
setSpaceAbove(MutableAttributeSet
Sets space above.
|
static void |
setSpaceBelow(MutableAttributeSet
Sets space below.
|
static void |
setStrikeThrough(MutableAttributeSet
Sets the strikethrough attribute.
|
static void |
setSubscript(MutableAttributeSet
Sets the subscript attribute.
|
static void |
setSuperscript(MutableAttributeSet
Sets the superscript attribute.
|
static void |
setTabSet(MutableAttributeSet
Sets the TabSet.
|
static void |
setUnderline(MutableAttributeSet
Sets the underline attribute.
|
String |
toString()
Returns the string representation.
|
public static final StringComponentElementName
public static final StringIconElementName
public static final ObjectNameAttribute
public static final ObjectResolveAttribute
public static final ObjectModelAttribute
public static final ObjectBidiLevel
public static final ObjectFontFamily
public static final ObjectFamily
public static final ObjectFontSize
public static final ObjectSize
public static final ObjectBold
public static final ObjectItalic
public static final ObjectUnderline
public static final ObjectStrikeThrough
public static final ObjectSuperscript
public static final ObjectSubscript
public static final ObjectForeground
public static final ObjectBackground
public static final ObjectComponentAttribute
public static final ObjectIconAttribute
public static final ObjectComposedTextAttribute
public static final ObjectFirstLineIndent
public static final ObjectLeftIndent
public static final ObjectRightIndent
public static final ObjectLineSpacing
public static final ObjectSpaceAbove
public static final ObjectSpaceBelow
public static final ObjectAlignment
public static final ObjectTabSet
public static final ObjectOrientation
public static final int ALIGN_LEFT
public static final int ALIGN_CENTER
public static final int ALIGN_RIGHT
public static final int ALIGN_JUSTIFIED
public StringtoString()
public static int getBidiLevel(AttributeSeta)
a - the attribute set
public static void setBidiLevel(MutableAttributeSeta, int o)
a - the attribute set
o - the bidi level value
public static ComponentgetComponent(AttributeSet a)
a - the attribute set
public static void setComponent(MutableAttributeSeta, Component c)
a - the attribute set
c - the component
public static IcongetIcon(AttributeSet a)
a - the attribute set
public static void setIcon(MutableAttributeSeta, Icon c)
a - the attribute set
c - the icon
public static StringgetFontFamily(AttributeSet a)
a - the attribute set
public static void setFontFamily(MutableAttributeSeta, String fam)
a - the attribute set
fam - the font
public static int getFontSize(AttributeSeta)
a - the attribute set
public static void setFontSize(MutableAttributeSeta, int s)
a - the attribute set
s - the font size
public static boolean isBold(AttributeSeta)
a - the attribute set
public static void setBold(MutableAttributeSeta, boolean b)
a - the attribute set
b - specifies true/false for setting the attribute
public static boolean isItalic(AttributeSeta)
a - the attribute set
public static void setItalic(MutableAttributeSeta, boolean b)
a - the attribute set
b - specifies true/false for setting the attribute
public static boolean isUnderline(AttributeSeta)
a - the attribute set
public static boolean isStrikeThrough(AttributeSeta)
a - the attribute set
public static boolean isSuperscript(AttributeSeta)
a - the attribute set
public static boolean isSubscript(AttributeSeta)
a - the attribute set
public static void setUnderline(MutableAttributeSeta, boolean b)
a - the attribute set
b - specifies true/false for setting the attribute
public static void setStrikeThrough(MutableAttributeSeta, boolean b)
a - the attribute set
b - specifies true/false for setting the attribute
public static void setSuperscript(MutableAttributeSeta, boolean b)
a - the attribute set
b - specifies true/false for setting the attribute
public static void setSubscript(MutableAttributeSeta, boolean b)
a - the attribute set
b - specifies true/false for setting the attribute
public static ColorgetForeground(AttributeSet a)
a - the attribute set
public static void setForeground(MutableAttributeSeta, Color fg)
a - the attribute set
fg - the color
public static ColorgetBackground(AttributeSet a)
a - the attribute set
public static void setBackground(MutableAttributeSeta, Color fg)
a - the attribute set
fg - the color
public static float getFirstLineIndent(AttributeSeta)
a - the attribute set
public static void setFirstLineIndent(MutableAttributeSeta, float i)
a - the attribute set
i - the value
public static float getRightIndent(AttributeSeta)
a - the attribute set
public static void setRightIndent(MutableAttributeSeta, float i)
a - the attribute set
i - the value
public static float getLeftIndent(AttributeSeta)
a - the attribute set
public static void setLeftIndent(MutableAttributeSeta, float i)
a - the attribute set
i - the value
public static float getLineSpacing(AttributeSeta)
a - the attribute set
public static void setLineSpacing(MutableAttributeSeta, float i)
a - the attribute set
i - the value
public static float getSpaceAbove(AttributeSeta)
a - the attribute set
public static void setSpaceAbove(MutableAttributeSeta, float i)
a - the attribute set
i - the value
public static float getSpaceBelow(AttributeSeta)
a - the attribute set
public static void setSpaceBelow(MutableAttributeSeta, float i)
a - the attribute set
i - the value
public static int getAlignment(AttributeSeta)
a - the attribute set
StyleConstants.ALIGN_LEFT if not set
public static void setAlignment(MutableAttributeSeta, int align)
a - the attribute set
align - the alignment value
public static TabSetgetTabSet(AttributeSet a)
a - the attribute set
TabSet
public static void setTabSet(MutableAttributeSeta, TabSet tabs)
a - the attribute set.
tabs - the TabSet