public class StyleContext.NamedStyle extends Object implements Style, Serializable
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans
包。请看XMLEncoder
。
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute
Modifier and Type | Field and Description |
---|---|
protected ChangeEvent |
changeEvent
只有一个changeevent是需要每个模型实例事件以来唯一的(只读)国家财产的来源。
|
protected EventListenerList |
listenerList
模型的更改侦听器。
|
NameAttribute, ResolveAttribute
Constructor and Description |
---|
NamedStyle()
创建一个新的命名样式,用一个空名称和父。
|
NamedStyle(String name, Style parent)
创建一个新的命名样式。
|
NamedStyle(Style parent)
创建一个新的命名样式。
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(Object name, Object value)
添加一个属性。
|
void |
addAttributes(AttributeSet attr)
向元素添加一组属性。
|
void |
addChangeListener(ChangeListener l)
添加一个更改侦听器。
|
boolean |
containsAttribute(Object name, Object value)
检查一个给定的属性名称/值是否被定义。
|
boolean |
containsAttributes(AttributeSet attrs)
检查元素是否包含所有的属性。
|
AttributeSet |
copyAttributes()
复制一组属性。
|
protected void |
fireStateChanged()
通知所有的听众,关于这一事件的类型通知已注册的兴趣。
|
Object |
getAttribute(Object attrName)
获取属性的值。
|
int |
getAttributeCount()
获取定义的属性的数目。
|
Enumeration<?> |
getAttributeNames()
获取所有属性的名称。
|
ChangeListener[] |
getChangeListeners()
返回所有的
ChangeListener s数组添加到这个namedstyle与addchangelistener()。
|
<T extends EventListener> |
getListeners(类<T> listenerType)
返回添加到该模型的给定类型的所有侦听器的数组。
|
String |
getName()
取样式的名称。
|
AttributeSet |
getResolveParent()
从父获取属性。
|
boolean |
isDefined(Object attrName)
检查一个给定的属性是否被定义。
|
boolean |
isEqual(AttributeSet attr)
检查两个属性集是否相等。
|
void |
removeAttribute(Object name)
从集合中移除一个属性。
|
void |
removeAttributes(AttributeSet attrs)
移除元素的一组属性。
|
void |
removeAttributes(Enumeration<?> names)
移除元素的一组属性。
|
void |
removeChangeListener(ChangeListener l)
移除一个更改侦听器。
|
void |
setName(String name)
更改样式的名称。
|
void |
setResolveParent(AttributeSet parent)
设置解决父。
|
String |
toString()
将样式转换为字符串。
|
protected EventListenerList listenerList
protected transient ChangeEvent changeEvent
public NamedStyle(String name, Style parent)
name
-风格的名字,空名
parent
-母的风格,如果没有返回null
public NamedStyle(Style parent)
parent
-母的风格,如果没有返回null
public NamedStyle()
public String getName()
public void setName(String name)
name
-新的名字
public void addChangeListener(ChangeListener l)
addChangeListener
接口
Style
l
-更改侦听器
public void removeChangeListener(ChangeListener l)
removeChangeListener
接口
Style
l
-更改侦听器
public ChangeListener[] getChangeListeners()
ChangeListener
s数组添加到这个namedstyle与addchangelistener()。
ChangeListener
s说如果没有听众已添加一个空数组
protected void fireStateChanged()
EventListenerList
public <T extends EventListener> T[] getListeners(类<T> listenerType)
public int getAttributeCount()
getAttributeCount
接口
AttributeSet
AttributeSet.getAttributeCount()
public boolean isDefined(Object attrName)
isDefined
接口
AttributeSet
attrName
-非空属性名称
AttributeSet.isDefined(java.lang.Object)
public boolean isEqual(AttributeSet attr)
isEqual
接口
AttributeSet
attr
-属性设置为对照
AttributeSet.isEqual(javax.swing.text.AttributeSet)
public AttributeSet copyAttributes()
copyAttributes
接口
AttributeSet
AttributeSet.copyAttributes()
public Object getAttribute(Object attrName)
getAttribute
接口
AttributeSet
attrName
-非空属性名称
AttributeSet.getAttribute(java.lang.Object)
public Enumeration<?> getAttributeNames()
getAttributeNames
接口
AttributeSet
AttributeSet.getAttributeNames()
public boolean containsAttribute(Object name, Object value)
containsAttribute
接口
AttributeSet
name
-非空属性名称
value
-属性值
AttributeSet.containsAttribute(java.lang.Object, java.lang.Object)
public boolean containsAttributes(AttributeSet attrs)
containsAttributes
接口
AttributeSet
attrs
-查看属性
AttributeSet.containsAttributes(javax.swing.text.AttributeSet)
public AttributeSet getResolveParent()
getResolveParent
接口
AttributeSet
AttributeSet.getResolveParent()
public void addAttribute(Object name, Object value)
addAttribute
接口
MutableAttributeSet
name
-非空属性名称
value
-属性值
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
public void addAttributes(AttributeSet attr)
addAttributes
接口
MutableAttributeSet
attr
-添加属性
MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)
public void removeAttribute(Object name)
removeAttribute
接口
MutableAttributeSet
name
-非空属性名称
MutableAttributeSet.removeAttribute(java.lang.Object)
public void removeAttributes(Enumeration<?> names)
removeAttributes
接口
MutableAttributeSet
names
-属性名称
MutableAttributeSet.removeAttributes(java.util.Enumeration<?>)
public void removeAttributes(AttributeSet attrs)
removeAttributes
接口
MutableAttributeSet
attrs
-属性
MutableAttributeSet.removeAttributes(java.util.Enumeration<?>)
public void setResolveParent(AttributeSet parent)
setResolveParent
接口
MutableAttributeSet
parent
-家长,如果没有返回null
MutableAttributeSet.setResolveParent(javax.swing.text.AttributeSet)
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.