public class MultiLookAndFeel extends LookAndFeel
复用外观和感觉,允许多个UI同时与组件相关联。 主要的外观和感觉被称为默认的外观和感觉,其他的外观和感觉被称为辅助 。
有关更多信息,请参阅Using the Multiplexing Look and Feel.
警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已经添加到java.beans包中。 请参阅XMLEncoder 。
| Constructor and Description |
|---|
MultiLookAndFeel() |
| Modifier and Type | Method and Description |
|---|---|
static ComponentUI |
createUIs(ComponentUI mui, Vector uis, JComponent target)
创建
ComponentUI呈现所需的对象
target部件,将所述对象中
uis矢量并返回
ComponentUI对象最能代表该组件的UI。
|
UIDefaults |
getDefaults()
创建,初始化和返回外观和感觉特定的默认值。
|
String |
getDescription()
返回这种外观的一行描述。
|
String |
getID()
返回适用于应用程序/服务的字符串,用于标识此外观。
|
String |
getName()
返回适合在菜单中使用的字符串,用于标识这种外观。
|
boolean |
isNativeLookAndFeel()
退货 false ;
这种外观和感觉不是任何平台的原生。
|
boolean |
isSupportedLookAndFeel()
退货 true ;
每个平台都允许这种外观和感觉。
|
protected static ComponentUI[] |
uisToArray(Vector uis)
创建一个数组,并从传入的向量中填充UI对象,并返回数组。
|
getDesktopPropertyValue, getDisabledIcon, getDisabledSelectedIcon, getLayoutStyle, getSupportsWindowDecorations, initialize, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninitialize, uninstallBorderpublic String getName()
getName在
LookAndFeel
public String getID()
getID在
LookAndFeel
public String getDescription()
getDescription在
LookAndFeel
public boolean isNativeLookAndFeel()
false ;
这种外观和感觉不是任何平台的原生。
isNativeLookAndFeel在
LookAndFeel
false
public boolean isSupportedLookAndFeel()
true ;
每个平台都允许这种外观和感觉。
isSupportedLookAndFeel在
LookAndFeel
true
UIManager.setLookAndFeel(javax.swing.LookAndFeel)
public UIDefaults getDefaults()
ComponentUI类名称(例如“javax.swing.plaf.multi.MultiButtonUI”)。
getDefaults在
LookAndFeel
UIDefaults对象
JComponent.getUIClassID()
public static ComponentUI createUIs(ComponentUI mui, Vector uis, JComponent target)
ComponentUI呈现所需的对象target部件,将所述对象中uis矢量并返回ComponentUI对象最能代表该组件的UI。
此方法通过调用getDefaults().getUI(target)对每个默认和辅助外观和目前使用的方式找到ComponentUI对象。
这个方法添加到uis矢量的第一个UI对象是默认的外观和感觉。
该方法由createUI方法调用MultiXxxxUI类。
mui -所述ComponentUI对象,表示为完整的UI target组分;
这应该是MultiXxxxUI之一的一个实例
uis - a Vector ;
通常这是uis所述的场mui参数
target - 其UI由
mui表示的
mui
mui如果组件有任何辅助UI对象;
否则,如果找不到默认UI对象,则返回默认外观的UI对象或null
UIManager.getAuxiliaryLookAndFeels() ,
UIDefaults.getUI(javax.swing.JComponent) ,
MultiButtonUI.uis ,
MultiButtonUI.createUI(javax.swing.JComponent)
protected static ComponentUI[] uisToArray(Vector uis)
uis为null,则此方法返回一个零元素的数组。
如果uis是空的向量,此方法返回null 。
如果uis向量中的任何对象不是类型ComponentUI则会发生运行时错误。
uis - 一个包含
ComponentUI对象的向量
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.