public class SynthLookAndFeel extends BasicLookAndFeel
load(java.io.InputStream, java.lang.Class<?>)
方法,或提供自己的
SynthStyleFactory
到
setStyleFactory(javax.swing.plaf.synth.SynthStyleFactory)
。指的是加载一个文件的一个例子
package summary,对
setStyleFactory
提供自己的
SynthStyleFactory
例
SynthStyleFactory
。
警告:这个类实现了Serializable
作为它的延伸BasicLookAndFeel
副作用。它的目的不是要序列化。试图将它会导致NotSerializableException
。
Constructor and Description |
---|
SynthLookAndFeel()
创建一个synthlookandfeel。
|
Modifier and Type | Method and Description |
---|---|
static ComponentUI |
createUI(JComponent c)
创建Synth外观和感觉传入的
JComponent
ComponentUI 。
|
UIDefaults |
getDefaults()
返回此synthlookandfeel默认。
|
String |
getDescription()
返回synthlookandfeel文本描述。
|
String |
getID()
返回一个字符串,确定了这个外观和感觉。
|
String |
getName()
返回一个简短的字符串,确定了这个外观和感觉。
|
static Region |
getRegion(JComponent c)
返回
c JComponent的区域。
|
static SynthStyle |
getStyle(JComponent c, Region region)
获取指定的组件的指定区域的synthstyle。
|
static SynthStyleFactory |
getStyleFactory()
返回当前synthstylefactory。
|
void |
initialize()
被称为”当这感觉是安装。
|
boolean |
isNativeLookAndFeel()
返回false,SynthLookAndFeel不是一个自然的外观和感觉。
|
boolean |
isSupportedLookAndFeel()
返回true,synthlookandfeel总是支持。
|
void |
load(InputStream input, 类<?> resourceBase)
荷载组
SynthStyle s将由这
SynthLookAndFeel 使用。
|
void |
load(URL url)
SynthStyle s负荷将由这
SynthLookAndFeel 采用集。
|
static void |
setStyleFactory(SynthStyleFactory cache)
集synthstylefactory了合成器的UI类将使用获得synthstyle。
|
boolean |
shouldUpdateStyleOnAncestorChanged()
返回是否UI应该从
SynthStyleFactory 当祖先的
JComponent 变化更新自己的
SynthStyles 。
|
protected boolean |
shouldUpdateStyleOnEvent(PropertyChangeEvent ev)
返回是否UI应该更新他们的风格时,一个特定的事件发生。
|
void |
uninitialize()
被称为”这感觉是当卸载。
|
static void |
updateStyles(Component c)
更新与
c 风格,和所有的孩子。
|
createAudioAction, getAudioActionMap, initClassDefaults, initComponentDefaults, initSystemColorDefaults, loadSystemColors, playSound
getDesktopPropertyValue, getDisabledIcon, getDisabledSelectedIcon, getLayoutStyle, getSupportsWindowDecorations, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninstallBorder
public SynthLookAndFeel()
对于返回SynthLookAndFeel
有用,你需要调用load
指定SynthStyle
s集,或调用setStyleFactory
。
public static void setStyleFactory(SynthStyleFactory cache)
cache
- synthstylefactory UIS应使用。
public static SynthStyleFactory getStyleFactory()
public static SynthStyle getStyle(JComponent c, Region region)
c
- JComponent得到synthstyle为
region
识别指定的组件的区域
public static void updateStyles(Component c)
c
风格,和所有的孩子。这是一个更轻的版本
SwingUtilities.updateComponentTreeUI
。
c
组件的更新方式。
public static Region getRegion(JComponent c)
c
JComponent的区域。
c
- JComponent取区
c
相应区域
public static ComponentUI createUI(JComponent c)
JComponent
ComponentUI
。
c
- JComponent创造
ComponentUI
为
c
ComponentUI
public void load(InputStream input, 类<?> resourceBase) throws ParseException
SynthStyle
s将由这
SynthLookAndFeel
使用。
resourceBase
用于解决基于资源的任何路径,例如
Image
将解决
resourceBase.getResource(path)
。参考
Synth File Format更多信息。
input
- InputStream装载
resourceBase
用来解决任何图像或其他资源
ParseException
-如果有分析错误
IllegalArgumentException
如果输入或资源基础是
null
public void load(URL url) throws ParseException, IOException
SynthStyle
s将由这
SynthLookAndFeel
使用。基于路径的资源是解决相对指定的
URL
的风格。例如,
Image
将解决
new URL(synthFile, path)
。参考
Synth File Format更多信息。
url
-
URL
加载
SynthStyle
集
ParseException
-如果有分析错误
null
synthset
IllegalArgumentException
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()
SynthStyleFactory
当祖先的
JComponent
变化更新自己的
SynthStyles
。子类提供了一个
SynthStyleFactory
基于返回的值
getStyle
关闭控制层次会重写此方法以返回true。
SynthStyleFactory
更新他们的
SynthStyles
。
protected boolean shouldUpdateStyleOnEvent(PropertyChangeEvent ev)
ev
-
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.