|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.swing.text.StyleContext.NamedStyle
public class StyleContext.NamedStyle
通常用於表示字元和段落樣式的屬性集合。這是 MutableAttributeSet(在需要時可以觀察它)的一個實作。當集合足夠小時這些樣式將利用不可變性的優勢,並且可能比諸如 SimpleAttributeSet 之類別更為高效。
警告:此類別的已序列化物件與以後的 Swing 版本不相容。當前序列化支持適用於短期存儲或運行相同 Swing 版本的應用程序之間的 RMI。從 1.4 版本開始,已在 java.beans 套件中添加了支持所有 JavaBeansTM 長期存儲的功能。請參見 XMLEncoder。
| 巢狀類別摘要 |
|---|
| 從介面 javax.swing.text.AttributeSet 繼承的巢狀類別/介面 |
|---|
AttributeSet.CharacterAttribute, AttributeSet.ColorAttribute, AttributeSet.FontAttribute, AttributeSet.ParagraphAttribute |
| 欄位摘要 | |
|---|---|
protected ChangeEvent |
changeEvent
由於事件的惟一狀態(只讀)為源屬性,因此每個模型實例只需要一個 ChangeEvent。 |
protected EventListenerList |
listenerList
模型的更改偵聽器。 |
| 從介面 javax.swing.text.AttributeSet 繼承的欄位 |
|---|
NameAttribute, ResolveAttribute |
| 建構子摘要 | |
|---|---|
StyleContext.NamedStyle()
利用 null 名稱和父級創建新的命名樣式。 |
|
StyleContext.NamedStyle(String name,
Style parent)
創建新的命名樣式。 |
|
StyleContext.NamedStyle(Style parent)
創建新的命名樣式。 |
|
| 方法摘要 | ||
|---|---|---|
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()
返回使用 addChangeListener() 添加到此 NamedStyle 中的所有 ChangeListener 組成的陣列。 |
|
|
getListeners(Class<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()
將樣式轉換成為字元串。 |
|
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 欄位詳細資訊 |
|---|
protected EventListenerList listenerList
protected transient ChangeEvent changeEvent
| 建構子詳細資訊 |
|---|
public StyleContext.NamedStyle(String name,
Style parent)
name - 樣式名稱,未命名則為 nullparent - 父樣式,如果沒有則為 nullpublic StyleContext.NamedStyle(Style parent)
parent - 父樣式,如果沒有則為 nullpublic StyleContext.NamedStyle()
| 方法詳細資訊 |
|---|
public String toString()
Object 中的 toStringpublic String getName()
Style 中的 getNamepublic void setName(String name)
name - 新名稱public void addChangeListener(ChangeListener l)
Style 中的 addChangeListenerl - 更改偵聽器public void removeChangeListener(ChangeListener l)
Style 中的 removeChangeListenerl - 更改偵聽器public ChangeListener[] getChangeListeners()
ChangeListener 組成的陣列。
ChangeListener,或者在沒有添加偵聽器時返回空陣列protected void fireStateChanged()
EventListenerListpublic <T extends EventListener> T[] getListeners(Class<T> listenerType)
public int getAttributeCount()
AttributeSet 中的 getAttributeCountAttributeSet.getAttributeCount()public boolean isDefined(Object attrName)
AttributeSet 中的 isDefinedattrName - 非空(null)的屬性名
AttributeSet.isDefined(java.lang.Object)public boolean isEqual(AttributeSet attr)
AttributeSet 中的 isEqualattr - 要檢查的屬性集
AttributeSet.isEqual(javax.swing.text.AttributeSet)public AttributeSet copyAttributes()
AttributeSet 中的 copyAttributesAttributeSet.copyAttributes()public Object getAttribute(Object attrName)
AttributeSet 中的 getAttributeattrName - 非空(null)屬性名
AttributeSet.getAttribute(java.lang.Object)public Enumeration<?> getAttributeNames()
AttributeSet 中的 getAttributeNamesAttributeSet.getAttributeNames()
public boolean containsAttribute(Object name,
Object value)
AttributeSet 中的 containsAttributename - 非空(null)屬性名value - 屬性值
AttributeSet.containsAttribute(java.lang.Object, java.lang.Object)public boolean containsAttributes(AttributeSet attrs)
AttributeSet 中的 containsAttributesattrs - 要檢查的屬性
AttributeSet.containsAttributes(javax.swing.text.AttributeSet)public AttributeSet getResolveParent()
AttributeSet 中的 getResolveParentAttributeSet.getResolveParent()
public void addAttribute(Object name,
Object value)
MutableAttributeSet 中的 addAttributename - 非空(null)屬性名value - 屬性值MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)public void addAttributes(AttributeSet attr)
MutableAttributeSet 中的 addAttributesattr - 要添加的屬性MutableAttributeSet.addAttribute(java.lang.Object, java.lang.Object)public void removeAttribute(Object name)
MutableAttributeSet 中的 removeAttributename - 非空(null)屬性名MutableAttributeSet.removeAttribute(java.lang.Object)public void removeAttributes(Enumeration<?> names)
MutableAttributeSet 中的 removeAttributesnames - 屬性名稱MutableAttributeSet.removeAttributes(java.util.Enumeration>)public void removeAttributes(AttributeSet attrs)
MutableAttributeSet 中的 removeAttributesattrs - 屬性MutableAttributeSet.removeAttributes(java.util.Enumeration>)public void setResolveParent(AttributeSet parent)
MutableAttributeSet 中的 setResolveParentparent - 父級,如果沒有則為 nullMutableAttributeSet.setResolveParent(javax.swing.text.AttributeSet)
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。