java.lang.Object | ||||
↳ | javax.swing.LookAndFeel | |||
↳ | javax.swing.plaf.basic.BasicLookAndFeel | |||
↳ | javax.swing.plaf.synth.SynthLookAndFeel | |||
↳ | com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel |
The NimbusLookAndFeel class.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new NimbusLookAndFeel.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns the defaults for this SynthLookAndFeel.
| |||||||||||
Get a derived color, derived colors are shared instances and is color
value will change when its parent UIDefault color changes.
| |||||||||||
Returns a textual description of this look and feel.
| |||||||||||
Returns an
Icon with a disabled appearance. | |||||||||||
Return a string that identifies this look and feel.
| |||||||||||
Return a short string that identifies this look and feel.
| |||||||||||
Gets the style associated with the given component and region.
| |||||||||||
Called by UIManager when this look and feel is installed.
| |||||||||||
Registers a third party component with the NimbusLookAndFeel. | |||||||||||
@inheritDoc
| |||||||||||
Returns whether or not the UIs should update their styles when a particular event occurs. | |||||||||||
Called by UIManager when this look and feel is uninstalled.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Decodes and returns a color, which is derived from a offset between two
other colors.
| |||||||||||
Decodes and returns a color, which is derived from an offset between two
other colors.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
javax.swing.plaf.synth.SynthLookAndFeel
| |||||||||||
From class
javax.swing.plaf.basic.BasicLookAndFeel
| |||||||||||
From class
javax.swing.LookAndFeel
| |||||||||||
From class
java.lang.Object
|
Create a new NimbusLookAndFeel.
Returns the defaults for this SynthLookAndFeel.
Get a derived color, derived colors are shared instances and is color value will change when its parent UIDefault color changes.
uiDefaultParentName | The parent UIDefault key |
---|---|
hOffset | The hue offset |
sOffset | The saturation offset |
bOffset | The brightness offset |
aOffset | The alpha offset |
uiResource | True if the derived color should be a UIResource, false if it should not be |
Returns a textual description of this look and feel.
Returns an Icon
with a disabled appearance.
This method is used to generate a disabled Icon
when
one has not been specified. For example, if you create a
JButton
and only specify an Icon
via
setIcon
this method will be called to generate the
disabled Icon
. If null
is passed as
icon
this method returns null
.
Some look and feels might not render the disabled Icon
, in which
case they will ignore this.
component | JComponent that will display the Icon ,
may be null |
---|---|
icon | Icon to generate the disabled icon from |
Icon
, or null
if a suitable
Icon
can not be generatedReturn a string that identifies this look and feel. This String will be the unquoted String "Nimbus".
Return a short string that identifies this look and feel. This String will be the unquoted String "Nimbus".
Gets the style associated with the given component and region. This will never return null. If an appropriate component and region cannot be determined, then a default style is returned.
c | a non-null reference to a JComponent |
---|---|
r | a non-null reference to the region of the component c |
Called by UIManager when this look and feel is installed.
Registers a third party component with the NimbusLookAndFeel.
Regions represent Components and areas within Components that act as
independent painting areas. Once registered with the NimbusLookAndFeel,
NimbusStyles for these Regions can be retrieved via the
getStyle
method.
The NimbusLookAndFeel uses a standard naming scheme for entries in the
UIDefaults table. The key for each property, state, painter, and other
default registered in UIDefaults for a specific Region will begin with
the specified prefix
For example, suppose I had a component named JFoo. Suppose I then registered this component with the NimbusLookAndFeel in this manner:
laf.register(NimbusFooUI.FOO_REGION, "Foo");
In this case, I could then register properties for this component with UIDefaults in the following manner:
UIManager.put("Foo.background", new ColorUIResource(Color.BLACK));
UIManager.put("Foo.Enabled.backgroundPainter", new FooBackgroundPainter());
It is also possible to register a named component with Nimbus. For example, suppose you wanted to style the background of a JPanel named "MyPanel" differently from other JPanels. You could accomplish this by doing the following:
laf.register(Region.PANEL, "\"MyPanel\"");
UIManager.put("\"MyPanel\".background", new ColorUIResource(Color.RED));
region | The Synth Region that is being registered. Such as Button, or ScrollBarThumb, or NimbusFooUI.FOO_REGION. |
---|---|
prefix | The UIDefault prefix. For example, could be ComboBox, or if a named components, "MyComboBox", or even something like ToolBar."MyComboBox"."ComboBox.arrowButton" |
@inheritDoc
Returns whether or not the UIs should update their styles when a
particular event occurs. Returns true
when one of the following
properties change:
"name"
"ancestor"
"Nimbus.Overrides"
"Nimbus.Overrides.InheritDefaults"
"JComponent.sizeVariant"
ev | a PropertyChangeEvent |
---|
Called by UIManager when this look and feel is uninstalled.
Decodes and returns a color, which is derived from a offset between two other colors.
color1 | The first color |
---|---|
color2 | The second color |
midPoint | The offset between color 1 and color 2, a value of 0.0 is color 1 and 1.0 is color 2; |
Decodes and returns a color, which is derived from an offset between two other colors.
color1 | The first color |
---|---|
color2 | The second color |
midPoint | The offset between color 1 and color 2, a value of 0.0 is color 1 and 1.0 is color 2; |
uiResource | True if the derived color should be a UIResource |