public class SimpleAttributeSet extends Object implements MutableAttributeSet, Serializable, Cloneable
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans
包。请看XMLEncoder
。
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
Modifier and Type | Field and Description |
---|---|
static AttributeSet |
EMPTY
一个空的属性集。
|
NameAttribute, ResolveAttribute
Constructor and Description |
---|
SimpleAttributeSet()
创建一个新的属性集。
|
SimpleAttributeSet(AttributeSet source)
基于提供的属性集创建一个新的属性集。
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(Object name, Object value)
向列表中添加一个属性。
|
void |
addAttributes(AttributeSet attributes)
将一组属性添加到列表中。
|
Object |
clone()
克隆一组属性。
|
boolean |
containsAttribute(Object name, Object value)
检查属性列表是否包含指定的属性名称/值对。
|
boolean |
containsAttributes(AttributeSet attributes)
检查属性列表是否包含所有指定的名称/值对。
|
AttributeSet |
copyAttributes()
做一个属性的副本。
|
boolean |
equals(Object obj)
将此对象与指定的对象进行比较。
|
Object |
getAttribute(Object name)
获取属性的值。
|
int |
getAttributeCount()
获取属性数的计数。
|
Enumeration<?> |
getAttributeNames()
获取集合中属性的名称。
|
AttributeSet |
getResolveParent()
获取解决父。
|
int |
hashCode()
返回该属性集的hashCode。
|
boolean |
isDefined(Object attrName)
告诉一个给定的属性是否被定义。
|
boolean |
isEmpty()
检查属性集是否为空。
|
boolean |
isEqual(AttributeSet attr)
比较两个属性集。
|
void |
removeAttribute(Object name)
从列表中移除一个属性。
|
void |
removeAttributes(AttributeSet attributes)
从列表中移除一组属性。
|
void |
removeAttributes(Enumeration<?> names)
从列表中移除一组属性。
|
void |
setResolveParent(AttributeSet parent)
设置解决父。
|
String |
toString()
将属性设置为字符串。
|
public static final AttributeSet EMPTY
public SimpleAttributeSet()
public SimpleAttributeSet(AttributeSet source)
source
-属性设置
public boolean isEmpty()
public int getAttributeCount()
getAttributeCount
接口
AttributeSet
public boolean isDefined(Object attrName)
isDefined
接口
AttributeSet
attrName
-属性名称
public boolean isEqual(AttributeSet attr)
isEqual
接口
AttributeSet
attr
-第二属性设置
public AttributeSet copyAttributes()
copyAttributes
接口
AttributeSet
public Enumeration<?> getAttributeNames()
getAttributeNames
接口
AttributeSet
Enumeration
public Object getAttribute(Object name)
getAttribute
接口
AttributeSet
name
-属性名称
public boolean containsAttribute(Object name, Object value)
containsAttribute
接口
AttributeSet
name
-名称
value
-价值
public boolean containsAttributes(AttributeSet attributes)
containsAttributes
接口
AttributeSet
attributes
-属性列表
public void addAttribute(Object name, Object value)
addAttribute
接口
MutableAttributeSet
name
-属性名称
value
-属性值
public void addAttributes(AttributeSet attributes)
addAttributes
接口
MutableAttributeSet
attributes
-属性添加组
public void removeAttribute(Object name)
removeAttribute
接口
MutableAttributeSet
name
-属性名称
public void removeAttributes(Enumeration<?> names)
removeAttributes
接口
MutableAttributeSet
names
-名字删除设置
public void removeAttributes(AttributeSet attributes)
removeAttributes
接口
MutableAttributeSet
attributes
-属性删除设置
public AttributeSet getResolveParent()
getResolveParent
接口
AttributeSet
public void setResolveParent(AttributeSet parent)
setResolveParent
接口
MutableAttributeSet
parent
-母
public int hashCode()
hashCode
方法重写,继承类
Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public boolean equals(Object obj)
true
如果对象是等价的一组属性。
equals
方法重写,继承类
Object
obj
-对象比较属性设置
true
如果对象是平等的;
false
否则
Object.hashCode()
,
HashMap
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.