public class NimbusLookAndFeel extends SynthLookAndFeel
的nimbuslookandfeel类。
Constructor and Description |
---|
NimbusLookAndFeel()
创建一个新的nimbuslookandfeel。
|
Modifier and Type | Method and Description |
---|---|
UIDefaults |
getDefaults()
返回此synthlookandfeel默认。
|
protected Color |
getDerivedColor(Color color1, Color color2, float midPoint)
解码并返回一个颜色,这是来自一个偏移的另外两种颜色之间。
|
protected Color |
getDerivedColor(Color color1, Color color2, float midPoint, boolean uiResource)
解码并返回一个颜色,这是来自两个其他颜色之间的偏移量。
|
Color |
getDerivedColor(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource)
获得衍生的颜色,得到颜色是共享的实例和颜色值会改变时,其母uidefault颜色变化。
|
String |
getDescription()
返回这个外观和感觉的文本描述。
|
Icon |
getDisabledIcon(JComponent component, Icon icon)
返回一个残疾的
Icon 外观。
|
String |
getID()
返回一个字符串,确定了这个外观和感觉。
|
String |
getName()
返回一个简短的字符串,确定了这个外观和感觉。
|
static NimbusStyle |
getStyle(JComponent c, Region r)
获取与给定组件和区域关联的样式。
|
void |
initialize()
被称为”当这感觉是安装。
|
void |
register(Region region, String prefix)
寄存器三分之一方组件与NimbusLookAndFeel。
|
boolean |
shouldUpdateStyleOnAncestorChanged()
返回是否UI应该更新他们的
SynthStyles 从
SynthStyleFactory 当祖先的
JComponent 变化。
|
protected boolean |
shouldUpdateStyleOnEvent(PropertyChangeEvent ev)
返回是否UI应该更新他们的风格时,一个特定的事件发生。
|
void |
uninitialize()
被称为”这感觉是当卸载。
|
createUI, getRegion, getStyleFactory, isNativeLookAndFeel, isSupportedLookAndFeel, load, load, setStyleFactory, updateStyles
createAudioAction, getAudioActionMap, initClassDefaults, initComponentDefaults, initSystemColorDefaults, loadSystemColors, playSound
getDesktopPropertyValue, getDisabledSelectedIcon, getLayoutStyle, getSupportsWindowDecorations, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninstallBorder
public void initialize()
public void uninitialize()
public UIDefaults getDefaults()
public static NimbusStyle getStyle(JComponent c, Region r)
c
-非空引用一个组件
r
-非空引用的组件C区
public String getName()
getName
方法重写,继承类
SynthLookAndFeel
public String getID()
getID
方法重写,继承类
SynthLookAndFeel
public String getDescription()
getDescription
方法重写,继承类
SynthLookAndFeel
public boolean shouldUpdateStyleOnAncestorChanged()
SynthStyleFactory
当祖先的
JComponent
变化更新自己的
SynthStyles
。子类提供了一个
SynthStyleFactory
基于返回的值
getStyle
关闭控制层次会重写此方法以返回true。
shouldUpdateStyleOnAncestorChanged
方法重写,继承类
SynthLookAndFeel
true
protected boolean shouldUpdateStyleOnEvent(PropertyChangeEvent ev)
重写返回true
当下列性质的变化:
"Nimbus.Overrides"
"Nimbus.Overrides.InheritDefaults"
"JComponent.sizeVariant"
shouldUpdateStyleOnEvent
方法重写,继承类
SynthLookAndFeel
ev
-
PropertyChangeEvent
public void register(Region region, String prefix)
寄存器三分之一方组件与NimbusLookAndFeel。
区域代表的组件,作为独立的绘画领域的组件和区域。一旦注册了的NimbusLookAndFeel,为这些地区nimbusstyles可以通过getStyle
方法。
的nimbuslookandfeel使用标准的命名方案,在uidefaults表条目。对于每个属性,状态,画家的关键,和其他uidefaults默认注册为一个特定的区域将从指定的prefix
例如,假设我有一部分叫JFoo。假如我再注册该组件以这种方式和NimbusLookAndFeel:
laf.register(NimbusFooUI.FOO_REGION, "Foo");
在这种情况下,我可以登记在下列方式uidefaults这个组件的属性:
UIManager.put("Foo.background", new ColorUIResource(Color.BLACK));
UIManager.put("Foo.Enabled.backgroundPainter", new FooBackgroundPainter());
它也可以登记命名组件与灵气。例如,假设您想要的风格一个JPanel命名为“mypanel”不同于其他jpanels背景。你可以做到这一做如下:
laf.register(Region.PANEL, "\"MyPanel\"");
UIManager.put("\"MyPanel\".background", new ColorUIResource(Color.RED));
region
-合成区域被注册。如按钮,或scrollbarthumb,或nimbusfooui.foo_region。
prefix
- uidefault前缀。例如,可以组合,或者叫组件,“mycombobox”,甚至像工具栏”。mycombobox”。”组合。arrowbutton”
public Icon getDisabledIcon(JComponent component, Icon icon)
LookAndFeel
Icon
外观。这种方法是用来产生一个残疾人
Icon
时未指定。例如,如果你创建了一个
JButton
只指定一个
Icon
通过
setIcon
这个方法来生成禁用
Icon
。如果
null
是
icon
null
通过此方法返回。
一些看起来和感觉不可能使残疾人Icon
,在这种情况下,他们会忽略这。
getDisabledIcon
方法重写,继承类
LookAndFeel
component
-
JComponent
将显示
Icon
,可能
null
icon
-
Icon
产生残疾人图标
Icon
,或
null
如果合适的
Icon
无法生成
public Color getDerivedColor(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource)
uiDefaultParentName
-母uidefault关键
hOffset
-色相偏移
sOffset
-饱和度偏移
bOffset
-亮度偏移
aOffset
-阿尔法偏移
uiResource
真如果派生的颜色应该是uiresource,假如果它不应该
protected final Color getDerivedColor(Color color1, Color color2, float midPoint, boolean uiResource)
color1
-第一个颜色
color2
-第二颜色
midPoint
1色和色之间的偏移值2,0是1,1是颜色2色;
uiResource
真如果派生的颜色应该是uiresource
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.