| 
 | JavaTM 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 Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。