java.lang.Object
javax.swing.text.DefaultStyledDocument.ElementSpec
建筑构件规范。
Warning: 此类的序列化对象将与未来的 Swing 版本不兼容。当前的序列化支持适用于运行相同版本 Swing 的应用程序之间的短期存储或 RMI。从 1.4 开始,对所有 JavaBeans 的长期存储的支持已添加到 java.beans 包中。请参阅 XMLEncoder 。
-
字段摘要
字段修饰符和类型Field描述static final shortgetType 的可能值。static final shortgetType 的可能值。static final shortgetDirection 的可能值。static final shortgetDirection 的可能值。static final shortgetDirection 的可能值。static final shortgetDirection 的可能值。static final shortgetType 的可能值。 -
构造方法总结
构造方法构造方法描述ElementSpec(AttributeSet a, short type) 当标记不存储在文档中时,构造方法对标记很有用。ElementSpec(AttributeSet a, short type, char[] txt, int offs, int len) 用于在外部创建规范以将内容和标记批量输入到文档中的构造方法。ElementSpec(AttributeSet a, short type, int len) 当已经添加了数据但需要 len 信息时,用于在文档内部解析的构造方法。 -
方法总结
修饰符和类型方法描述char[]getArray()获取字符数组。获取元素属性。short获取方向。int获取长度。int获取起始偏移量。shortgetType()获取元素类型。voidsetDirection(short direction) 设置方向。voidsetType(short type) 设置元素类型。toString()将元素转换为字符串。
-
字段详细信息
-
StartTagType
public static final short StartTagTypegetType 的可能值。这指定此记录类型是开始标记并表示指定元素开始的标记。- 参见:
-
EndTagType
public static final short EndTagTypegetType 的可能值。这指定此记录类型是结束标记并表示指定元素结束的标记。- 参见:
-
ContentType
public static final short ContentTypegetType 的可能值。这指定此记录类型表示内容。- 参见:
-
JoinPreviousDirection
public static final short JoinPreviousDirectiongetDirection 的可能值。这指定与此记录相关联的数据应该连接到它之前的内容。- 参见:
-
JoinNextDirection
public static final short JoinNextDirectiongetDirection 的可能值。这指定与此记录关联的数据应连接到它后面的内容。- 参见:
-
OriginateDirection
public static final short OriginateDirectiongetDirection 的可能值。这指定与此记录关联的数据应该用于生成新元素。这将是正常值。- 参见:
-
JoinFractureDirection
public static final short JoinFractureDirectiongetDirection 的可能值。这指定与此记录关联的数据应连接到断裂元素。- 参见:
-
-
构造方法详细信息
-
ElementSpec
当标记不存储在文档中时,构造方法对标记很有用。- 参数:
a- 元素的属性type- 元素的类型(StartTagType、EndTagType、ContentType)
-
ElementSpec
当已经添加了数据但需要 len 信息时,用于在文档内部解析的构造方法。- 参数:
a- 元素的属性type- 元素的类型(StartTagType、EndTagType、ContentType)len- 长度 >= 0
-
ElementSpec
用于在外部创建规范以将内容和标记批量输入到文档中的构造方法。- 参数:
a- 元素的属性type- 元素的类型(StartTagType、EndTagType、ContentType)txt- 元素的文本offs- 文本中的偏移量 >= 0len- 文本长度 >= 0
-
-
方法详情
-
setType
public void setType(short type) 设置元素类型。- 参数:
type- 元素的类型(StartTagType、EndTagType、ContentType)
-
getType
public short getType()获取元素类型。- 返回:
- 元素的类型(StartTagType、EndTagType、ContentType)
-
setDirection
public void setDirection(short direction) 设置方向。- 参数:
direction- 方向(JoinPreviousDirection、JoinNextDirection)
-
getDirection
public short getDirection()获取方向。- 返回:
- 方向 (JoinPreviousDirection, JoinNextDirection)
-
getAttributes
获取元素属性。- 返回:
- 属性集
-
getArray
public char[] getArray()获取字符数组。- 返回:
- 数组
-
getOffset
public int getOffset()获取起始偏移量。- 返回:
- offset >= 0
-
getLength
public int getLength()获取长度。- 返回:
- 长度 >= 0
-
toString
将元素转换为字符串。
-