所有类


javax.swing.text
类 StyleConstants

java.lang.Object
  继承者 javax.swing.text.StyleConstants
直接已知子类:
StyleConstants.CharacterConstants, StyleConstants.ColorConstants, StyleConstants.FontConstants, StyleConstants.ParagraphConstants

public class StyleConstants
   
   
   
   
extends Object

一个已知的 或常见的属性键和方法的集合,可通过应用 AttributeSet 或 MutableAttributeSet 方法以类型安全的方式获取/设置属性。

段落属性定义了所呈现的段落。所有的大小都是以点的形式指定的(如 postscript 中所示),其测量与设备无关。

图表显示 SpaceAbove、FirstLineIndent、LeftIndent、RightIndent 和 SpaceBelow 为一个段落。


嵌套类摘要
static classStyleConstants.CharacterConstants
          这是一个类型安全的已知 属性的枚举,它用于字符样式。
static classStyleConstants.ColorConstants
          这是一个类型安全的已知 属性的枚举,它用于颜色样式。
static classStyleConstants.FontConstants
          这是一个类型安全的已知 属性的枚举,它用于字体样式。
static classStyleConstants.ParagraphConstants
          这是一个类型安全的已知 属性的枚举,它用于段落样式。
 
字段摘要
static intALIGN_CENTER
          段落对齐的可能值。
static intALIGN_JUSTIFIED
          段落对齐的可能值。
static intALIGN_LEFT
          段落对齐方式的可能值。
static intALIGN_RIGHT
          段落对齐的可能值。
static ObjectAlignment
          段落的对齐方式。
static ObjectBackground
          背景色属性的名称。
static ObjectBidiLevel
          由 Unicode bidi 算法指派的字符双向级别。
static ObjectBold
          粗体属性的名称。
static ObjectComponentAttribute
          组件属性的名称。
static StringComponentElementName
          用于表示组件的元素名称。
static ObjectComposedTextAttribute
          撰写文本的输入法属性的名称。
static ObjectFamily
          字体系列的名称。
static ObjectFirstLineIndent
          段落第一行要缩进的空间量。
static ObjectFontFamily
          字体系列的名称。
static ObjectFontSize
          字体大小的名称。
static ObjectForeground
          前景色属性的名称。
static ObjectIconAttribute
          图标属性的名称。
static StringIconElementName
          用于表示图标的元素名称。
static ObjectItalic
          斜体属性的名称。
static ObjectLeftIndent
          段落左边的缩进量。
static ObjectLineSpacing
          段落的行之间的空间量。
static ObjectModelAttribute
          用来标识嵌入了对象的模型的属性,这些嵌入的对象具有分开的模型视图。
static ObjectNameAttribute
          用于命名属性集合的属性名称。
static ObjectOrientation
          段落的方向。
static ObjectResolveAttribute
          用来标识属性的解析父集的属性名(如果定义了属性的解析父集)。
static ObjectRightIndent
          段落右边的缩进量。
static ObjectSize
          字体大小的名称。
static ObjectSpaceAbove
          段落上方的空间量。
static ObjectSpaceBelow
          段落下方的空间量。
static ObjectStrikeThrough
          删除线属性的名称。
static ObjectSubscript
          下标属性的名称。
static ObjectSuperscript
          上标属性的名称。
static ObjectTabSet
          段落的 TabSet,类型为包含了 TabStop 的 TabSet。
static ObjectUnderline
          下划线属性的名称。
 
方法摘要
static intgetAlignment(AttributeSet a)
          获取对齐设置。
static ColorgetBackground(AttributeSet a)
          从属性列表中获取背景色设置。
static intgetBidiLevel(AttributeSet a)
          获取 BidiLevel 设置。
static ComponentgetComponent(AttributeSet a)
          从属性列表中获取组件设置。
static floatgetFirstLineIndent(AttributeSet a)
          获取首行缩进设置。
static StringgetFontFamily(AttributeSet a)
          从属性列表中获取字体系列设置。
static intgetFontSize(AttributeSet a)
          从属性列表中获取字体大小设置。
static ColorgetForeground(AttributeSet a)
          从属性列表中获取前景色设置。
static IcongetIcon(AttributeSet a)
          从属性列表中获取图标设置。
static floatgetLeftIndent(AttributeSet a)
          获取左边缩进设置。
static floatgetLineSpacing(AttributeSet a)
          获取行间距设置。
static floatgetRightIndent(AttributeSet a)
          获取右边缩进设置。
static floatgetSpaceAbove(AttributeSet a)
          获取上部空间设置。
static floatgetSpaceBelow(AttributeSet a)
          获取下部空间设置。
static TabSetgetTabSet(AttributeSet a)
          获取 TabSet。
static booleanisBold(AttributeSet a)
          确定是否设置了粗体属性。
static booleanisItalic(AttributeSet a)
          确定是否设置了斜体属性。
static booleanisStrikeThrough(AttributeSet a)
          确定是否设置了删除线属性。
static booleanisSubscript(AttributeSet a)
          确定是否设置了下标属性。
static booleanisSuperscript(AttributeSet a)
          确定是否设置了上标属性。
static booleanisUnderline(AttributeSet a)
          确定是否设置了下划线属性。
static voidsetAlignment(MutableAttributeSet a, int align)
          设置对齐方式。
static voidsetBackground(MutableAttributeSet a, Color fg)
          设置背景色。
static voidsetBidiLevel(MutableAttributeSet a, int o)
          设置 BidiLevel。
static voidsetBold(MutableAttributeSet a, boolean b)
          设置粗体属性。
static voidsetComponent(MutableAttributeSet a, Component c)
          设置组件属性。
static voidsetFirstLineIndent(MutableAttributeSet a, float i)
          设置首行缩进。
static voidsetFontFamily(MutableAttributeSet a, String fam)
          设置字体属性。
static voidsetFontSize(MutableAttributeSet a, int s)
          设置字体大小属性。
static voidsetForeground(MutableAttributeSet a, Color fg)
          设置前景色。
static voidsetIcon(MutableAttributeSet a, Icon c)
          设置图标属性。
static voidsetItalic(MutableAttributeSet a, boolean b)
          设置斜体属性。
static voidsetLeftIndent(MutableAttributeSet a, float i)
          设置左边缩进。
static voidsetLineSpacing(MutableAttributeSet a, float i)
          设置行间距。
static voidsetRightIndent(MutableAttributeSet a, float i)
          设置右边缩进。
static voidsetSpaceAbove(MutableAttributeSet a, float i)
          设置上部空间。
static voidsetSpaceBelow(MutableAttributeSet a, float i)
          设置下部空间。
static voidsetStrikeThrough(MutableAttributeSet a, boolean b)
          设置删除线属性。
static voidsetSubscript(MutableAttributeSet a, boolean b)
          设置下标属性。
static voidsetSuperscript(MutableAttributeSet a, boolean b)
          设置上标属性。
static voidsetTabSet(MutableAttributeSet a, TabSet tabs)
          设置 TabSet。
static voidsetUnderline(MutableAttributeSet a, boolean b)
          设置下标属性。
 StringtoString()
          返回字符串表示形式。
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

ComponentElementName

public static final String ComponentElementName
用于表示组件的元素名称。

另请参见:
常量字段值

IconElementName

public static final String IconElementName
用于表示图标的元素名称。

另请参见:
常量字段值

NameAttribute

public static final Object NameAttribute
用于命名属性集合的属性名称。


ResolveAttribute

public static final Object ResolveAttribute
用来标识属性的解析父集的属性名(如果定义了属性的解析父集)。


ModelAttribute

public static final Object ModelAttribute
用来标识嵌入了对象的模型的属性,这些嵌入的对象具有分开的模型视图。


BidiLevel

public static final Object BidiLevel
由 Unicode bidi 算法指派的字符双向级别。


FontFamily

public static final Object FontFamily
字体系列的名称。