Class NimbusLookAndFeel
- All Implemented Interfaces:
- Serializable
The NimbusLookAndFeel class.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected final ColorgetDerivedColor(Color color1, Color color2, float midPoint) Decodes and returns a color, which is derived from a offset between two other colors.protected final ColorgetDerivedColor(Color color1, Color color2, float midPoint, boolean uiResource) Decodes and returns a color, which is derived from an offset between two other colors.getDerivedColor(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource) 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.getID()Return a string that identifies this look and feel.getName()Return a short string that identifies this look and feel.static NimbusStylegetStyle(JComponent c, Region r) Gets the style associated with the given component and region.voidCalled by UIManager when this look and feel is installed.voidRegisters a third party component with the NimbusLookAndFeel.booleanReturns whether or not the UIs should update theirSynthStylesfrom theSynthStyleFactorywhen the ancestor of theJComponentchanges.protected booleanReturns whether or not the UIs should update their styles when a particular event occurs.voidCalled by UIManager when this look and feel is uninstalled.Methods declared in class javax.swing.plaf.synth.SynthLookAndFeelcreateUI, getDefaults, getRegion, getStyleFactory, isNativeLookAndFeel, isSupportedLookAndFeel, load, load, setStyleFactory, updateStylesMethods declared in class javax.swing.plaf.basic.BasicLookAndFeelcreateAudioAction, getAudioActionMap, initClassDefaults, initComponentDefaults, initSystemColorDefaults, loadSystemColors, playSoundMethods declared in class javax.swing.LookAndFeelgetDesktopPropertyValue, getDisabledIcon, getDisabledSelectedIcon, getLayoutStyle, getSupportsWindowDecorations, installBorder, installColors, installColorsAndFont, installProperty, loadKeyBindings, makeComponentInputMap, makeIcon, makeInputMap, makeKeyBindings, provideErrorFeedback, toString, uninstallBorder
- 
Constructor Details- 
NimbusLookAndFeelpublic NimbusLookAndFeel()Create a new NimbusLookAndFeel.
 
- 
- 
Method Details- 
initializepublic void initialize()Called by UIManager when this look and feel is installed.- Overrides:
- initializein class- SynthLookAndFeel
- See Also:
 
- 
uninitializepublic void uninitialize()Called by UIManager when this look and feel is uninstalled.- Overrides:
- uninitializein class- SynthLookAndFeel
- See Also:
 
- 
getStyleGets 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.- Parameters:
- c- a non-null reference to a JComponent
- r- a non-null reference to the region of the component c
- Returns:
- a non-null reference to a NimbusStyle.
 
- 
getNameReturn a short string that identifies this look and feel. This String will be the unquoted String "Nimbus".- Overrides:
- getNamein class- SynthLookAndFeel
- Returns:
- a short string identifying this look and feel.
 
- 
getIDReturn a string that identifies this look and feel. This String will be the unquoted String "Nimbus".- Overrides:
- getIDin class- SynthLookAndFeel
- Returns:
- a short string identifying this look and feel.
 
- 
getDescriptionReturns a textual description of this look and feel.- Overrides:
- getDescriptionin class- SynthLookAndFeel
- Returns:
- textual description of this look and feel.
 
- 
shouldUpdateStyleOnAncestorChangedpublic boolean shouldUpdateStyleOnAncestorChanged()Returns whether or not the UIs should update theirSynthStylesfrom theSynthStyleFactorywhen the ancestor of theJComponentchanges. A subclass that provided aSynthStyleFactorythat based the return value fromgetStyleoff the containment hierarchy would override this method to return true.- Overrides:
- shouldUpdateStyleOnAncestorChangedin class- SynthLookAndFeel
- Returns:
- true
 
- 
shouldUpdateStyleOnEventReturns whether or not the UIs should update their styles when a particular event occurs.Overridden to return truewhen one of the following properties change:- "Nimbus.Overrides"
- "Nimbus.Overrides.InheritDefaults"
- "JComponent.sizeVariant"
 - Overrides:
- shouldUpdateStyleOnEventin class- SynthLookAndFeel
- Parameters:
- ev- a- PropertyChangeEvent
- Returns:
- whether or not the UIs should update their styles
- Since:
- 1.7
 
- 
registerRegisters 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 getStylemethod.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 prefixFor 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));- Parameters:
- 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"
 
- 
getDerivedColorpublic Color getDerivedColor(String uiDefaultParentName, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource) Get a derived color, derived colors are shared instances and is color value will change when its parent UIDefault color changes.- Parameters:
- 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:
- The stored derived color
 
- 
getDerivedColorprotected final Color getDerivedColor(Color color1, Color color2, float midPoint, boolean uiResource) Decodes and returns a color, which is derived from an offset between two other colors.- Parameters:
- 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
- Returns:
- The derived color
 
- 
getDerivedColorDecodes and returns a color, which is derived from a offset between two other colors.- Parameters:
- 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;
- Returns:
- The derived color, which will be a UIResource
 
 
-