- java.lang.Object
-
- javax.swing.text.TabSet
-
- All Implemented Interfaces:
-
Serializable
public class TabSet extends Object implements Serializable
TabSet由许多TabStops组成。 它提供了将最接近的TabStop定位到给定位置并查找所有潜在的TabStops的方法。 这也是不变的。警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,支持所有JavaBeans的长期存储已被添加到
java.beans包中。 请参阅XMLEncoder。- 另请参见:
- Serialized Form
-
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 booleanequals(Object o)指示这个TabSet是否等于另一个。TabStopgetTab(int index)返回索引号为index的TabStop。TabStopgetTabAfter(float location)返回location后的Tab实例。intgetTabCount()返回接收器包含的Tab实例数。intgetTabIndex(TabStop tab)返回TabStoptab的索引,如果tab不包含在接收器中,则返回-1。intgetTabIndexAfter(float location)返回location后使用的Tab的索引。inthashCode()返回此组TabStops的哈希码。StringtoString()返回一组选项卡的字符串表示形式。
-
-
-
构造方法详细信息
-
TabSet
public TabSet(TabStop[] tabs)
创建并返回TabSet的实例。 传入的标签数组必须按升序排序。- 参数
-
tabs- TabStops初始化TabSet
-
-
方法详细信息
-
getTabCount
public int getTabCount()
返回接收器包含的Tab实例数。- 结果
- 接收器包含的Tab实例的数量
-
getTab
public TabStop getTab(int index)
返回索引号为index的TabStop。 如果index超出了选项卡的范围,这将抛出IllegalArgumentExceptionindex。- 参数
-
index- 哪个TapStop要返回 - 结果
-
TabStop在索引
index
-
getTabAfter
public TabStop getTabAfter(float location)
在location之后返回Tab实例。 如果在location之后没有选项卡,则返回null。- 参数
-
location- 找到一个Tab后的位置 - 结果
-
该标签实例后
location
-
getTabIndex
public int getTabIndex(TabStop tab)
返回TabStoptab的索引,如果tab不包含在接收器中,则返回-1。- 参数
-
tab- TabStop找到 - 结果
-
TabStop
tab的索引,如果tab的索引不包含在接收器中。
-
getTabIndexAfter
public int getTabIndexAfter(float location)
返回location后使用的Tab的索引。 如果在location之后没有选项卡,则返回-1。- 参数
-
location- 找到一个Tab后的位置 - 结果
-
该标签的索引将在
location之后location
-
equals
public boolean equals(Object o)
指示这个TabSet是否等于另一个。- 重写:
-
equals在Object - 参数
-
o- 这个实例应该比较的TabSet实例。 - 结果
-
true如果o是实例TabSet,具有相同数量的TabStopS和他们都是平等的,false否则。 - 从以下版本开始:
- 1.5
- 另请参见:
-
Object.hashCode(),HashMap
-
hashCode
public int hashCode()
返回此组TabStops的哈希码。- 重写:
-
hashCode在Object - 结果
- 一组TabStops的哈希码值。
- 从以下版本开始:
- 1.5
- 另请参见:
-
Object.equals(java.lang.Object),System.identityHashCode(java.lang.Object)
-
-