public class SynthLookAndFeel extends BasicLookAndFeel
load(java.io.InputStream, java.lang.Class<?>)方法提供配置文件,或提供您自己的SynthStyleFactory至setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory) 。
请参阅package summary ,用于加载文件的一个例子, SynthStyleFactory提供你自己的一个例子SynthStyleFactory到setStyleFactory 。
警告:此类实现Serializable作为其副作用扩展BasicLookAndFeel 。 它不打算串行化。 尝试序列化它将导致NotSerializableException 。
| Constructor and Description |
|---|
SynthLookAndFeel()
创建SynthLookAndFeel。
|
| Modifier and Type | Method and Description |
|---|---|
static ComponentUI |
createUI(JComponent c)
创建Synth的外观和感觉
ComponentUI传递给
JComponent 。
|
UIDefaults |
getDefaults()
返回此SynthLookAndFeel的默认值。
|
String |
getDescription()
返回SynthLookAndFeel的文本描述。
|
String |
getID()
返回一个识别这种外观和感觉的字符串。
|
String |
getName()
返回一个标识这种外观和感觉的短字符串。
|
static Region |
getRegion(JComponent c)
返回JComponent的
c 。
|
static SynthStyle |
getStyle(JComponent c, Region region)
获取指定组件的指定区域的SynthStyle。
|
static SynthStyleFactory |
getStyleFactory()
返回当前的SynthStyleFactory。
|
void |
initialize()
当这个外观和感觉被安装时,由UIManager打来的。
|
boolean |
isNativeLookAndFeel()
返回false,SynthLookAndFeel不是原生的外观。
|
boolean |
isSupportedLookAndFeel()
返回true,始终支持SynthLookAndFeel。
|
void |
load(InputStream input, 类<?> resourceBase)
加载
SynthStyle s将由该
SynthLookAndFeel使用的一
SynthLookAndFeel 。
|
void |
load(URL url)
加载
SynthStyle将使用的
SynthStyle s的
SynthLookAndFeel 。
|
static void |
setStyleFactory(SynthStyleFactory cache)
设置SynthStyleFactory,合成器提供的UI类将用于获取SynthStyle。
|
boolean |
shouldUpdateStyleOnAncestorChanged()
返回的UI是否应该更新其
SynthStyles从
SynthStyleFactory时的祖先
JComponent变化。
|
protected boolean |
shouldUpdateStyleOnEvent(PropertyChangeEvent ev)
返回在特定事件发生时,UI是否应更新其样式。
|
void |
uninitialize()
当这个外观和感觉被卸载时,由UIManager打电话。
|
static void |
updateStyles(Component c)
更新与
c及其所有子项相关
c的样式。
|
createAudioAction, getAudioActionMap, initClassDefaults, initComponentDefaults, initSystemColorDefaults, loadSystemColors, playSoundgetDesktopPropertyValue, getDisabledIcon, getDisabledSelectedIcon, getLayoutStyle, getSupportsWindowDecorations, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninstallBorderpublic SynthLookAndFeel()
对于返回的SynthLookAndFeel有用,您需要调用load指定SynthStyle s的集合,或调用setStyleFactory 。
public static void setStyleFactory(SynthStyleFactory cache)
cache - 用户界面应该使用的SynthStyleFactory。
public static SynthStyleFactory getStyleFactory()
public static SynthStyle getStyle(JComponent c, Region region)
c - 获取SynthStyle的JComponent
region - 标识指定组件的区域
public static void updateStyles(Component c)
c及其所有子项相关c的样式。
这是一个更轻的版本SwingUtilities.updateComponentTreeUI 。
c - 更新样式的组件。
public static Region getRegion(JComponent c)
c 。
c - 获取Region的JComponent
c
public static ComponentUI createUI(JComponent c)
ComponentUI通过了
JComponent 。
c - JComponent创建
ComponentUI
c
public void load(InputStream input, 类<?> resourceBase) throws ParseException
SynthStyle将使用的SynthStyle s的SynthLookAndFeel 。
resourceBase用于解析任何基于路径的资源,例如Image将由resourceBase.getResource(path)解决。
请参阅Synth File Format以获取更多信息。
input - 要加载的InputStream
resourceBase - 用于解决任何图像或其他资源
ParseException - 如果解析中有错误
IllegalArgumentException - 如果input或resourceBase为
null
public void load(URL url) throws ParseException, IOException
SynthStyle s将被这个SynthLookAndFeel使用的一SynthLookAndFeel 。
基于路径的资源相对于指定的URL的风格进行了解决。
例如Image将由new URL(synthFile, path)解决。
请参阅Synth File Format以获取更多信息。
url -
URL将
SynthStyle从
ParseException - 如果解析中有错误
IllegalArgumentException - 如果synthSet是
null
IOException - 如果synthSet无法作为
InputStream打开
public void initialize()
public void uninitialize()
public UIDefaults getDefaults()
public boolean isSupportedLookAndFeel()
isSupportedLookAndFeel在类
LookAndFeel
UIManager.setLookAndFeel(javax.swing.LookAndFeel)
public boolean isNativeLookAndFeel()
isNativeLookAndFeel在
LookAndFeel
public String getDescription()
getDescription在
LookAndFeel类
public String getName()
getName在
LookAndFeel
public String getID()
getID在
LookAndFeel
public boolean shouldUpdateStyleOnAncestorChanged()
SynthStyles从SynthStyleFactory时的祖先JComponent变化。
提供一个基于SynthStyleFactory的返回值从getStyle离开包含层次结构的子类将覆盖此方法返回true。
SynthStyleFactory更新他们的
SynthStyles 。
protected boolean shouldUpdateStyleOnEvent(PropertyChangeEvent ev)
ev - a
PropertyChangeEvent
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.