|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjavax.swing.plaf.synth.SynthStyleFactory
public abstract class SynthStyleFactory
用於獲得 SynthStyle 的處理器。每個 Synth ComponentUI 都將調用當前 SynthStyleFactory 來為它們所擁有的每個不同 region 獲得一個 SynthStyle。
以下範例創建了一個自定義 SynthStyleFactory,它基於 Region 返回不同的樣式:
class MyStyleFactory extends SynthStyleFactory {
public SynthStyle getStyle(JComponent c, Region id) {
if (id == Region.BUTTON) {
return buttonStyle;
}
else if (id == Region.TREE) {
return treeStyle;
}
return defaultStyle;
}
}
SynthLookAndFeel laf = new SynthLookAndFeel();
UIManager.setLookAndFeel(laf);
SynthLookAndFeel.setStyleFactory(new MyStyleFactory());
SynthStyleFactory,
SynthStyle| 建構子摘要 | |
|---|---|
SynthStyleFactory()
創建一個 SynthStyleFactory。 |
|
| 方法摘要 | |
|---|---|
abstract SynthStyle |
getStyle(JComponent c,
Region id)
返回指定 Component 的樣式。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 建構子詳細資訊 |
|---|
public SynthStyleFactory()
SynthStyleFactory。
| 方法詳細資訊 |
|---|
public abstract SynthStyle getStyle(JComponent c,
Region id)
c - 要請求的元件id - Region 標識符
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。