|
|||||||||
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
Represents standard attribute keys. This class also contains a set of
useful static utility methods for querying and populating an
AttributeSet
.
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. |
Method Summary | |
---|---|
static int |
getAlignment(AttributeSet a)
Returns the alignment specified in the given attributes, or ALIGN_LEFT if no alignment is specified. |
static Color |
getBackground(AttributeSet a)
Returns the background color specified in the given attributes, or 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 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 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ALIGN_LEFT
StyleConstants.ParagraphConstants.Alignment
attribute.
public static final int ALIGN_CENTER
StyleConstants.ParagraphConstants.Alignment
attribute.
public static final int ALIGN_RIGHT
StyleConstants.ParagraphConstants.Alignment
attribute.
public static final int ALIGN_JUSTIFIED
StyleConstants.ParagraphConstants.Alignment
attribute.
public static final Object Background
StyleConstants.CharacterConstants.Background
.
public static final Object BidiLevel
StyleConstants.CharacterConstants.BidiLevel
.
public static final Object Bold
StyleConstants.CharacterConstants.Bold
.
public static final Object ComponentAttribute
StyleConstants.CharacterConstants.ComponentAttribute
.
public static final Object Family
StyleConstants.CharacterConstants.Family
.
public static final Object FontFamily
StyleConstants.CharacterConstants.Family
.
public static final Object FontSize
StyleConstants.CharacterConstants.Size
.
public static final Object Foreground
StyleConstants.CharacterConstants.Foreground
.
public static final Object IconAttribute
StyleConstants.CharacterConstants.IconAttribute
.
public static final Object Italic
StyleConstants.CharacterConstants.Italic
.
public static final Object Size
StyleConstants.CharacterConstants.Size
.
public static final Object StrikeThrough
StyleConstants.CharacterConstants.StrikeThrough
.
public static final Object Subscript
StyleConstants.CharacterConstants.Subscript
.
public static final Object Superscript
StyleConstants.CharacterConstants.Superscript
.
public static final Object Underline
StyleConstants.CharacterConstants.Underline
.
public static final Object Alignment
StyleConstants.ParagraphConstants.Alignment
.
public static final Object FirstLineIndent
StyleConstants.ParagraphConstants.FirstLineIndent
.
public static final Object LeftIndent
StyleConstants.ParagraphConstants.LeftIndent
.
public static final Object LineSpacing
StyleConstants.ParagraphConstants.LineSpacing
.
public static final Object Orientation
StyleConstants.ParagraphConstants.Orientation
.
public static final Object RightIndent
StyleConstants.ParagraphConstants.RightIndent
.
public static final Object SpaceAbove
StyleConstants.ParagraphConstants.SpaceAbove
.
public static final Object SpaceBelow
StyleConstants.ParagraphConstants.SpaceBelow
.
public static final Object TabSet
StyleConstants.ParagraphConstants.TabSet
.
public static final String ComponentElementName
public static final String IconElementName
public static final Object ComposedTextAttribute
public static final Object ModelAttribute
public static final Object NameAttribute
public static final Object ResolveAttribute
Method Detail |
---|
public String toString()
toString
in class Object
Object.getClass()
,
Object.hashCode()
,
Class.getName()
,
Integer.toHexString(int)
public static int getAlignment(AttributeSet a)
ALIGN_LEFT
if no alignment is specified.
a
- the attribute set (null
not permitted).
ALIGN_LEFT
,
ALIGN_RIGHT
, ALIGN_CENTER
or
ALIGN_JUSTIFIED
).setAlignment(MutableAttributeSet, int)
public static Color getBackground(AttributeSet a)
Color.BLACK
if no background color is specified.
a
- the attribute set (null
not permitted).
setBackground(MutableAttributeSet, Color)
public static int getBidiLevel(AttributeSet a)
0
if no bidi level is specified.
a
- the attribute set (null
not permitted).
setBidiLevel(MutableAttributeSet, int)
public static Component getComponent(AttributeSet a)
null
if no component is specified.
a
- the attribute set (null
not permitted).
null
).setComponent(MutableAttributeSet, Component)
public static float getFirstLineIndent(AttributeSet a)
0.0f
if no indentation is specified.
a
- the attribute set (null
not permitted).
setFirstLineIndent(MutableAttributeSet, float)
public static String getFontFamily(AttributeSet a)
Monospaced
if no font family is specified.
a
- the attribute set (null
not permitted).
setFontFamily(MutableAttributeSet, String)
public static int getFontSize(AttributeSet a)
12
if no font size is specified.
a
- the attribute set (null
not permitted).
setFontSize(MutableAttributeSet, int)
public static Color getForeground(AttributeSet a)
Color.BLACK
if no foreground color is specified.
a
- the attribute set (null
not permitted).
setForeground(MutableAttributeSet, Color)
public static Icon getIcon(AttributeSet a)
null
if no icon is specified.
a
- the attribute set (null
not permitted).
null
).setIcon(MutableAttributeSet, Icon)
public static float getLeftIndent(AttributeSet a)
0.0f
if no left indentation is specified.
a
- the attribute set (null
not permitted).
setLeftIndent(MutableAttributeSet, float)
public static float getLineSpacing(AttributeSet a)
0.0f
if no line spacing is specified.
a
- the attribute set (null
not permitted).
setLineSpacing(MutableAttributeSet, float)
public static float getRightIndent(AttributeSet a)
0.0f
if no right indentation is specified.
a
- the attribute set (null
not permitted).
setRightIndent(MutableAttributeSet, float)
public static float getSpaceAbove(AttributeSet a)
0.0f
if no 'space above' is specified.
a
- the attribute set (null
not permitted).
setSpaceAbove(MutableAttributeSet, float)
public static float getSpaceBelow(AttributeSet a)
0.0f
if no 'space below' is specified.
a
- the attribute set (null
not permitted).
setSpaceBelow(MutableAttributeSet, float)
public static TabSet getTabSet(AttributeSet a)
null
if no tab set is specified.
a
- the attribute set (null
not permitted).
setTabSet(MutableAttributeSet, javax.swing.text.TabSet)
public static boolean isBold(AttributeSet a)
false
if no bold flag is specified.
a
- the attribute set (null
not permitted).
setBold(MutableAttributeSet, boolean)
public static boolean isItalic(AttributeSet a)
false
if no italic flag is specified.
a
- the attribute set (null
not permitted).
setItalic(MutableAttributeSet, boolean)
public static boolean isStrikeThrough(AttributeSet a)
false
if no strike-through flag is specified.
a
- the attribute set (null
not permitted).
setStrikeThrough(MutableAttributeSet, boolean)
public static boolean isSubscript(AttributeSet a)
false
if no subscript flag is specified.
a
- the attribute set (null
not permitted).
setSubscript(MutableAttributeSet, boolean)
public static boolean isSuperscript(AttributeSet a)
false
if no superscript flag is specified.
a
- the attribute set (null
not permitted).
setSuperscript(MutableAttributeSet, boolean)
public static boolean isUnderline(AttributeSet a)
false
if no underline flag is specified.
a
- the attribute set (null
not permitted).
setUnderline(MutableAttributeSet, boolean)
public static void setAlignment(MutableAttributeSet a, int align)
a
- the attribute set (null
not permitted).align
- the alignment (typically one of
ALIGN_LEFT
,
ALIGN_RIGHT
,
ALIGN_CENTER
or
ALIGN_JUSTIFIED
).
NullPointerException
- if a
is null
.getAlignment(AttributeSet)
public static void setBackground(MutableAttributeSet a, Color bg)
a
- the attribute set (null
not permitted).bg
- the background (null
not permitted).
NullPointerException
- if either argument is null
.getBackground(AttributeSet)
public static void setBidiLevel(MutableAttributeSet a, int lev)
a
- the attribute set (null
not permitted).lev
- the level.
NullPointerException
- if a
is null
.getBidiLevel(AttributeSet)
public static void setBold(MutableAttributeSet a, boolean b)
a
- the attribute set (null
not permitted).b
- the new value of the bold attribute.
NullPointerException
- if a
is null
.isBold(AttributeSet)
public static void setComponent(MutableAttributeSet a, Component c)
a
- the attribute set (null
not permitted).c
- the component (null
not permitted).
NullPointerException
- if either argument is null
.getComponent(AttributeSet)
public static void setFirstLineIndent(MutableAttributeSet a, float i)
a
- the attribute set (null
not permitted).i
- the indentation.
NullPointerException
- if a
is null
.getFirstLineIndent(AttributeSet)
public static void setFontFamily(MutableAttributeSet a, String fam)
a
- the attribute set (null
not permitted).fam
- the font family name (null
not permitted).
NullPointerException
- if either argument is null
.getFontFamily(AttributeSet)
public static void setFontSize(MutableAttributeSet a, int s)
a
- the attribute set (null
not permitted).s
- the font size (in points).
NullPointerException
- if a
is null
.getFontSize(AttributeSet)
public static void setForeground(MutableAttributeSet a, Color fg)
a
- the attribute set (null
not permitted).fg
- the foreground color (null
not permitted).
NullPointerException
- if either argument is null
.getForeground(AttributeSet)
public static void setIcon(MutableAttributeSet a, Icon c)
a
- the attribute set (null
not permitted).c
- the icon (null
not permitted).
NullPointerException
- if either argument is null
.getIcon(AttributeSet)
public static void setItalic(MutableAttributeSet a, boolean b)
a
- the attribute set (null
not permitted).b
- the new value of the italic attribute.
NullPointerException
- if a
is null
.isItalic(AttributeSet)
public static void setLeftIndent(MutableAttributeSet a, float i)
a
- the attribute set (null
not permitted).i
- the indentation.
NullPointerException
- if a
is null
.getLeftIndent(AttributeSet)
public static void setLineSpacing(MutableAttributeSet a, float i)
a
- the attribute set (null
not permitted).i
- the line spacing.
NullPointerException
- if a
is null
.getLineSpacing(AttributeSet)
public static void setRightIndent(MutableAttributeSet a, float i)
a
- the attribute set (null
not permitted).i
- the right indentation.
NullPointerException
- if a
is null
.getRightIndent(AttributeSet)
public static void setSpaceAbove(MutableAttributeSet a, float i)
a
- the attribute set (null
not permitted).i
- the space above attribute value.
NullPointerException
- if a
is null
.getSpaceAbove(AttributeSet)
public static void setSpaceBelow(MutableAttributeSet a, float i)
a
- the attribute set (null
not permitted).i
- the space below attribute value.
NullPointerException
- if a
is null
.getSpaceBelow(AttributeSet)
public static void setStrikeThrough(MutableAttributeSet a, boolean b)
a
- the attribute set (null
not permitted).b
- the strike-through attribute value.
NullPointerException
- if a
is null
.isStrikeThrough(AttributeSet)
public static void setSubscript(MutableAttributeSet a, boolean b)
a
- the attribute set (null
not permitted).b
- the subscript attribute value.
NullPointerException
- if a
is null
.isSubscript(AttributeSet)
public static void setSuperscript(MutableAttributeSet a, boolean b)
a
- the attribute set (null
not permitted).b
- the superscript attribute value.
NullPointerException
- if a
is null
.isSuperscript(AttributeSet)
public static void setTabSet(MutableAttributeSet a, TabSet tabs)
TabSet
attribute to the specified set.
a
- the attribute set (null
not permitted).tabs
- the tab set (null
not permitted).
NullPointerException
- if either argument is null
.getTabSet(AttributeSet)
public static void setUnderline(MutableAttributeSet a, boolean b)
a
- the attribute set (null
not permitted).b
- the underline attribute value.
NullPointerException
- if a
is null
.isUnderline(AttributeSet)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |