APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.nimbus

public final Class NimbusStyle

extends SynthStyle
Class Inheritance
Imports
javax.swing.Painter, .JComponent, .UIDefaults, .UIManager, javax.swing.plaf.ColorUIResource, javax.swing.plaf.synth.ColorType, .SynthContext, .SynthPainter, .SynthStyle, java.awt.Color, .Font, .Insets, java.lang.ref.WeakReference, java.util.ArrayList, .Comparator, .HashMap, .List, .Map, .TreeMap

A SynthStyle implementation used by Nimbus. Each Region that has been registered with the NimbusLookAndFeel will have an associated NimbusStyle. Third party components that are registered with the NimbusLookAndFeel will therefore be handed a NimbusStyle from the look and feel from the #getStyle(JComponent, Region) method.

This class properly reads and retrieves values placed in the UIDefaults according to the standard Nimbus naming conventions. It will create and retrieve painters, fonts, colors, and other data stored there.

NimbusStyle also supports the ability to override settings on a per component basis. NimbusStyle checks the component's client property map for "Nimbus.Overrides". If the value associated with this key is an instance of UIDefaults, then the values in that defaults table will override the standard Nimbus defaults in UIManager, but for that component instance only.

Optionally, you may specify the client property "Nimbus.Overrides.InheritDefaults". If true, this client property indicates that the defaults located in UIManager should first be read, and then replaced with defaults located in the component client properties. If false, then only the defaults located in the component client property map will be used. If not specified, it is assumed to be true.

You must specify "Nimbus.Overrides" for "Nimbus.Overrides.InheritDefaults" to have any effect. "Nimbus.Overrides" indicates whether there are any overrides, while "Nimbus.Overrides.InheritDefaults" indicates whether those overrides should first be initialized with the defaults from UIManager.

The NimbusStyle is reloaded whenever a property change event is fired for a component for "Nimbus.Overrides" or "Nimbus.Overrides.InheritDefaults". So for example, setting a new UIDefaults on a component would cause the style to be reloaded.

The values are only read out of UIManager once, and then cached. If you need to read the values again (for example, if the UI is being reloaded), then discard this NimbusStyle and read a new one from NimbusLookAndFeel using NimbusLookAndFeel.getStyle.

The primary API of interest in this class for 3rd party component authors are the three methods which retrieve painters: #getBackgroundPainter, #getForegroundPainter, and #getBorderPainter.

NimbusStyle allows you to specify custom states, or modify the order of states. Synth (and thus Nimbus) has the concept of a "state". For example, a JButton might be in the "MOUSE_OVER" state, or the "ENABLED" state, or the "DISABLED" state. These are all "standard" states which are defined in synth, and which apply to all synth Regions.

Sometimes, however, you need to have a custom state. For example, you want JButton to render differently if it's parent is a JToolbar. In Nimbus, you specify these custom states by including a special key in UIDefaults. The following UIDefaults entries define three states for this button:


    JButton.States = Enabled, Disabled, Toolbar
    JButton[Enabled].backgroundPainter = somePainter
    JButton[Disabled].background = BLUE
    JButton[Toolbar].backgroundPainter = someOtherPaint

As you can see, the JButton.States entry lists the states that the JButton style will support. You then specify the settings for each state. If you do not specify the JButton.States entry, then the standard Synth states will be assumed. If you specify the entry but the list of states is empty or null, then the standard synth states will be assumed.

Authors
Richard Bair, Jasper Potts

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
NimbusStyle.CacheKey

This implementation presupposes that key is never null and that the two keys being checked for equality are never null

private static class
NimbusStyle.RuntimeState

Contains values such as the UIDefaults and painters associated with a state.

private static class
NimbusStyle.Values

Essentially a struct of data for a style.

Field Summary

Modifier and TypeField and Description
private WeakReference<JComponent>
component

Some NimbusStyles are created for a specific component only.

private static final Color
DEFAULT_COLOR

The Color to return from getColorForState if it would otherwise have returned null.

public static final String
LARGE_KEY

Large key

public static final double
LARGE_SCALE

Large scale

public static final String
MINI_KEY

Mini key

public static final double
MINI_SCALE

Mini scale

private static final Object
NULL

Special constant used for performance reasons during the get() method.

private SynthPainter
painter

The SynthPainter that will be returned from this NimbusStyle.

private String
prefix

The prefix for the component or region that this NimbusStyle represents.

public static final String
SMALL_KEY

Small key

public static final double
SMALL_SCALE

Small scale

private static final Comparator<NimbusStyle.RuntimeState>
STATE_COMPARATOR

Simple Comparator for ordering the RuntimeStates according to their rank.

private NimbusStyle.CacheKey
tmpKey

A temporary CacheKey used to perform lookups.

private NimbusStyle.Values
values

Data structure containing all of the defaults, insets, states, and other values associated with this style.

Constructor Summary

AccessConstructor and Description
pack-priv
NimbusStyle(String
Something like Button or Slider.Thumb or org.jdesktop.swingx.JXStatusBar or ComboBox."ComboBox.arrowButton"
prefix
,
JComponent
an optional reference to a component that this NimbusStyle should be associated with. This is only used when the component has Nimbus overrides registered in its client properties and should be null otherwise.
c
)

Create a new NimbusStyle.

Method Summary

Modifier and TypeMethod and Description
private boolean

Returns:

true or false based on whether the given name is in the array
contains
(String[]
a non-null array of strings
names
,
String
the name to look for in the array
name
)

Simple utility method that searches the given array of Strings for the given string.

public Object
get(SynthContext
SynthContext identifying requester
ctx
,
Object
must not be null
key
)

Overrides javax.swing.plaf.synth.SynthStyle.get.

Getter for a region specific style property.

public Painter<Object>

Returns:

The background painter associated for the given state, or null if none could be found.
getBackgroundPainter
(SynthContext
The SynthContext. Must not be null.
ctx
)

Gets the appropriate background Painter, if there is one, for the state specified in the given SynthContext.

public Painter<Object>

Returns:

The border painter associated for the given state, or null if none could be found.
getBorderPainter
(SynthContext
The SynthContext. Must not be null.
ctx
)

Gets the appropriate border Painter, if there is one, for the state specified in the given SynthContext.

protected Color
getColorForState(SynthContext ctx, ColorType type)

Implements abstract javax.swing.plaf.synth.SynthStyle.getColorForState.

Returns the color for the specified state.

private int
getExtendedState(SynthContext ctx, NimbusStyle.Values v)

Gets the extended state for a given synth context.

protected Font
getFontForState(SynthContext ctx)

Implements abstract javax.swing.plaf.synth.SynthStyle.getFontForState.

Returns the font for the specified state.

public Painter<Object>

Returns:

The foreground painter associated for the given state, or null if none could be found.
getForegroundPainter
(SynthContext
The SynthContext. Must not be null.
ctx
)

Gets the appropriate foreground Painter, if there is one, for the state specified in the given SynthContext.

public Insets
getInsets(SynthContext ctx, Insets in)

Overrides javax.swing.plaf.synth.SynthStyle.getInsets.

Returns the Insets that are used to calculate sizing information.

private NimbusStyle.RuntimeState
getNextState(NimbusStyle.RuntimeState[] states, int[]
a 1 element array, allowing me to do pass-by-reference.
lastState
,
int xstate)

Gets the RuntimeState that most closely matches the state in the given context, but is less specific than the given "lastState".

private Painter<Object>
getPainter(Map<String, Object> defaults, String key)

public SynthPainter
getPainter(SynthContext ctx)

Overrides javax.swing.plaf.synth.SynthStyle.getPainter.

Returns the SynthPainter that will be used for painting.

private NimbusStyle.Values

Returns:

a non-null values reference
getValues
(SynthContext
The SynthContext
ctx
)

Utility method which returns the proper Values based on the given SynthContext.

public void
installDefaults(SynthContext ctx)

Overrides javax.swing.plaf.synth.SynthStyle.installDefaults.

Installs the necessary state from this Style on the JComponent from context.

public boolean
isOpaque(SynthContext ctx)

Overrides javax.swing.plaf.synth.SynthStyle.isOpaque.

Returns true if the region is opaque.

private static Painter<Object>
paintFilter(Painter<T> painter)

private void
validate()

Pulls data out of UIDefaults, if it has not done so already, and sets up the internal state.

Inherited from javax.swing.plaf.synth.SynthStyle:
getBooleangetColorgetFontgetGraphicsUtilsgetIcongetIntgetStringuninstallDefaults

Field Detail

componentback to summary
private WeakReference<JComponent> component

Some NimbusStyles are created for a specific component only. In Nimbus, this happens whenever the component has as a client property a UIDefaults which overrides (or supplements) those defaults found in UIManager.

DEFAULT_COLORback to summary
private static final Color DEFAULT_COLOR

The Color to return from getColorForState if it would otherwise have returned null.

Returning null from getColorForState is a very bad thing, as it causes the AWT peer for the component to install a SystemColor, which is not a UIResource. As a result, if null is returned from getColorForState, then thereafter the color is not updated for other states or on LAF changes or updates. This DEFAULT_COLOR is used to ensure that a ColorUIResource is always returned from getColorForState.

LARGE_KEYback to summary
public static final String LARGE_KEY

Large key

LARGE_SCALEback to summary
public static final double LARGE_SCALE

Large scale

MINI_KEYback to summary
public static final String MINI_KEY

Mini key

MINI_SCALEback to summary
public static final double MINI_SCALE

Mini scale

NULLback to summary
private static final Object NULL

Special constant used for performance reasons during the get() method. If get() runs through all of the search locations and determines that there is no value, then NULL will be placed into the values map. This way on subsequent lookups it will simply extract NULL, see it, and return null rather than continuing the lookup procedure.

painterback to summary
private SynthPainter painter

The SynthPainter that will be returned from this NimbusStyle. The SynthPainter returned will be a SynthPainterImpl, which will in turn delegate back to this NimbusStyle for the proper Painter (not SynthPainter) to use for painting the foreground, background, or border.

prefixback to summary
private String prefix

The prefix for the component or region that this NimbusStyle represents. This prefix is used to lookup state in the UIManager. It should be something like Button or Slider.Thumb or "MyButton" or ComboBox."ComboBox.arrowButton" or "MyComboBox"."ComboBox.arrowButton"

SMALL_KEYback to summary
public static final String SMALL_KEY

Small key

SMALL_SCALEback to summary
public static final double SMALL_SCALE

Small scale

STATE_COMPARATORback to summary
private static final Comparator<NimbusStyle.RuntimeState> STATE_COMPARATOR

Simple Comparator for ordering the RuntimeStates according to their rank.

tmpKeyback to summary
private NimbusStyle.CacheKey tmpKey

A temporary CacheKey used to perform lookups. This pattern avoids creating useless garbage keys, or concatenating strings, etc.

valuesback to summary
private NimbusStyle.Values values

Data structure containing all of the defaults, insets, states, and other values associated with this style. This instance refers to default values, and are used when no overrides are discovered in the client properties of a component. These values are lazily created on first access.

Constructor Detail

NimbusStyleback to summary
pack-priv NimbusStyle(String prefix, JComponent c)

Create a new NimbusStyle. Only the prefix must be supplied. At the appropriate time, installDefaults will be called. At that point, all of the state information will be pulled from UIManager and stored locally within this style.

Parameters
prefix:String

Something like Button or Slider.Thumb or org.jdesktop.swingx.JXStatusBar or ComboBox."ComboBox.arrowButton"

c:JComponent

an optional reference to a component that this NimbusStyle should be associated with. This is only used when the component has Nimbus overrides registered in its client properties and should be null otherwise.

Method Detail

containsback to summary
private boolean contains(String[] names, String name)

Simple utility method that searches the given array of Strings for the given string. This method is only called from getExtendedState if the developer has specified a specific state for the component to be in (ie, has "wedged" the component in that state) by specifying they client property "Nimbus.State".

Parameters
names:String[]

a non-null array of strings

name:String

the name to look for in the array

Returns:boolean

true or false based on whether the given name is in the array

getback to summary
public Object get(SynthContext ctx, Object key)

Overrides javax.swing.plaf.synth.SynthStyle.get.

Doc from javax.swing.plaf.synth.SynthStyle.get.

Getter for a region specific style property.

Overridden to cause this style to populate itself with data from UIDefaults, if necessary.

Properties in UIDefaults may be specified in a chained manner. For example:

background
Button.opacity
Button.Enabled.foreground
Button.Enabled+Selected.background

In this example, suppose you were in the Enabled+Selected state and searched for "foreground". In this case, we first check for Button.Enabled+Selected.foreground, but no such color exists. We then fall back to the next valid state, in this case, Button.Enabled.foreground, and have a match. So we return it.

Again, if we were in the state Enabled and looked for "background", we wouldn't find it in Button.Enabled, or in Button, but would at the top level in UIManager. So we return that value.

One special note: the "key" passed to this method could be of the form "background" or "Button.background" where "Button" equals the prefix passed to the NimbusStyle constructor. In either case, it looks for "background".

Parameters
ctx:SynthContext

SynthContext identifying requester

key:Object

must not be null

Annotations
@Override
getBackgroundPainterback to summary
public Painter<Object> getBackgroundPainter(SynthContext ctx)

Gets the appropriate background Painter, if there is one, for the state specified in the given SynthContext. This method does appropriate fallback searching, as described in #get.

Parameters
ctx:SynthContext

The SynthContext. Must not be null.

Returns:Painter<Object>

The background painter associated for the given state, or null if none could be found.

getBorderPainterback to summary
public Painter<Object> getBorderPainter(SynthContext ctx)

Gets the appropriate border Painter, if there is one, for the state specified in the given SynthContext. This method does appropriate fallback searching, as described in #get.

Parameters
ctx:SynthContext

The SynthContext. Must not be null.

Returns:Painter<Object>

The border painter associated for the given state, or null if none could be found.

getColorForStateback to summary
protected Color getColorForState(SynthContext ctx, ColorType type)

Implements abstract javax.swing.plaf.synth.SynthStyle.getColorForState.

Doc from javax.swing.plaf.synth.SynthStyle.getColorForState.

Returns the color for the specified state. This should NOT call any methods on the JComponent.

Overridden to cause this style to populate itself with data from UIDefaults, if necessary.

In addition, NimbusStyle handles ColorTypes slightly differently from Synth.

  • ColorType.BACKGROUND will equate to the color stored in UIDefaults named "background".
  • ColorType.TEXT_BACKGROUND will equate to the color stored in UIDefaults named "textBackground".
  • ColorType.FOREGROUND will equate to the color stored in UIDefaults named "textForeground".
  • ColorType.TEXT_FOREGROUND will equate to the color stored in UIDefaults named "textForeground".
Annotations
@Override
getExtendedStateback to summary
private int getExtendedState(SynthContext ctx, NimbusStyle.Values v)

Gets the extended state for a given synth context. Nimbus supports the ability to define custom states. The algorithm used for choosing what style information to use for a given state requires a single integer bit string where each bit in the integer represents a different state that the component is in. This method uses the componentState as reported in the SynthContext, in addition to custom states, to determine what this extended state is.

In addition, this method checks the component in the given context for a client property called "Nimbus.State". If one exists, then it will decompose the String associated with that property to determine what state to return. In this way, the developer can force a component to be in a specific state, regardless of what the "real" state of the component is.

The string associated with "Nimbus.State" would be of the form:

Enabled+CustomState+MouseOver

Annotations
@SuppressWarnings:unchecked, rawtypes
getFontForStateback to summary
protected Font getFontForState(SynthContext ctx)

Implements abstract javax.swing.plaf.synth.SynthStyle.getFontForState.

Doc from javax.swing.plaf.synth.SynthStyle.getFontForState.

Returns the font for the specified state. This should NOT call any method on the JComponent. Overridden to cause this style to populate itself with data from UIDefaults, if necessary. If a value named "font" is not found in UIDefaults, then the "defaultFont" font in UIDefaults will be returned instead.

Annotations
@Override
getForegroundPainterback to summary
public Painter<Object> getForegroundPainter(SynthContext ctx)

Gets the appropriate foreground Painter, if there is one, for the state specified in the given SynthContext. This method does appropriate fallback searching, as described in #get.

Parameters
ctx:SynthContext

The SynthContext. Must not be null.

Returns:Painter<Object>

The foreground painter associated for the given state, or null if none could be found.

getInsetsback to summary
public Insets getInsets(SynthContext ctx, Insets in)

Overrides javax.swing.plaf.synth.SynthStyle.getInsets.

Doc from javax.swing.plaf.synth.SynthStyle.getInsets.

Returns the Insets that are used to calculate sizing information. Overridden to cause this style to populate itself with data from UIDefaults, if necessary.

Annotations
@Override
getNextStateback to summary
private NimbusStyle.RuntimeState getNextState(NimbusStyle.RuntimeState[] states, int[] lastState, int xstate)

Gets the RuntimeState that most closely matches the state in the given context, but is less specific than the given "lastState". Essentially, this allows you to search for the next best state.

For example, if you had the following three states:

Enabled
Enabled+Pressed
Disabled
And you wanted to find the state that best represented ENABLED+PRESSED+FOCUSED and lastState was null (or an empty array, or an array with a single int with index == -1), then Enabled+Pressed would be returned. If you then call this method again but pass the index of Enabled+Pressed as the "lastState", then Enabled would be returned. If you call this method a third time and pass the index of Enabled in as the lastState, then null would be returned.

The actual code path for determining the proper state is the same as in Synth.

Parameters
lastState:int[]

a 1 element array, allowing me to do pass-by-reference.

getPainterback to summary
private Painter<Object> getPainter(Map<String, Object> defaults, String key)
getPainterback to summary
public SynthPainter getPainter(SynthContext ctx)

Overrides javax.swing.plaf.synth.SynthStyle.getPainter.

Doc from javax.swing.plaf.synth.SynthStyle.getPainter.

Returns the SynthPainter that will be used for painting. This may return null. Returns the SynthPainter for this style, which ends up delegating to the Painters installed in this style.

Annotations
@Override
getValuesback to summary
private NimbusStyle.Values getValues(SynthContext ctx)

Utility method which returns the proper Values based on the given SynthContext. Ensures that parsing of the values has occurred, or reoccurs as necessary.

Parameters
ctx:SynthContext

The SynthContext

Returns:NimbusStyle.Values

a non-null values reference

installDefaultsback to summary
public void installDefaults(SynthContext ctx)

Overrides javax.swing.plaf.synth.SynthStyle.installDefaults.

Doc from javax.swing.plaf.synth.SynthStyle.installDefaults.

Installs the necessary state from this Style on the JComponent from context. Overridden to cause this style to populate itself with data from UIDefaults, if necessary.

Annotations
@Override
isOpaqueback to summary
public boolean isOpaque(SynthContext ctx)

Overrides javax.swing.plaf.synth.SynthStyle.isOpaque.

Doc from javax.swing.plaf.synth.SynthStyle.isOpaque.

Returns true if the region is opaque. Overridden to cause this style to populate itself with data from UIDefaults, if necessary. If opacity is not specified in UI defaults, then it defaults to being non-opaque.

Annotations
@Override
paintFilterback to summary
private static Painter<Object> paintFilter(Painter<T> painter)
Annotations
@SuppressWarnings:unchecked
validateback to summary
private void validate()

Pulls data out of UIDefaults, if it has not done so already, and sets up the internal state.

javax.swing.plaf.nimbus back to summary

private final Class NimbusStyle.CacheKey

extends Object
Class Inheritance

This implementation presupposes that key is never null and that the two keys being checked for equality are never null

Field Summary

Modifier and TypeField and Description
private String
private int

Constructor Summary

AccessConstructor and Description
pack-priv
CacheKey(Object key, int xstate)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object obj)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

pack-priv void
init(Object key, int xstate)

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private String key
xstateback to summary
private int xstate

Constructor Detail

CacheKeyback to summary
pack-priv CacheKey(Object key, int xstate)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override
initback to summary
pack-priv void init(Object key, int xstate)
javax.swing.plaf.nimbus back to summary

private final Class NimbusStyle.RuntimeState

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable

Contains values such as the UIDefaults and painters associated with a state. Whereas State represents a distinct state that a component can be in (such as Enabled), this class represents the colors, fonts, painters, etc associated with some state for this style.

Field Summary

Modifier and TypeField and Description
pack-priv Painter<Object>
pack-priv Painter<Object>
pack-priv UIDefaults
pack-priv Painter<Object>
pack-priv int
pack-priv String

Constructor Summary

AccessConstructor and Description
private
RuntimeState(int state, String stateName)

Method Summary

Modifier and TypeMethod and Description
public NimbusStyle.RuntimeState
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

backgroundPainterback to summary
pack-priv Painter<Object> backgroundPainter
borderPainterback to summary
pack-priv Painter<Object> borderPainter
defaultsback to summary
pack-priv UIDefaults defaults
foregroundPainterback to summary
pack-priv Painter<Object> foregroundPainter
stateback to summary
pack-priv int state
stateNameback to summary
pack-priv String stateName

Constructor Detail

RuntimeStateback to summary
private RuntimeState(int state, String stateName)

Method Detail

cloneback to summary
public NimbusStyle.RuntimeState clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
javax.swing.plaf.nimbus back to summary

private final Class NimbusStyle.Values

extends Object
Class Inheritance

Essentially a struct of data for a style. A default instance of this class is used by NimbusStyle. Additional instances exist for each component that has overrides.

Field Summary

Modifier and TypeField and Description
pack-priv Map<NimbusStyle.CacheKey, Object>
cache

Simple cache.

pack-priv Insets
contentMargins

The content margins for this region.

pack-priv UIDefaults
defaults

Defaults on the region/component level.

pack-priv NimbusStyle.RuntimeState[]
states

The list of actual runtime state representations.

pack-priv State<?>[]
stateTypes

The list of State types.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheback to summary
pack-priv Map<NimbusStyle.CacheKey, Object> cache

Simple cache. After a value has been looked up, it is stored in this cache for later retrieval. The key is a concatenation of the property being looked up, two dollar signs, and the extended state. So for example: foo.bar$$2353

contentMarginsback to summary
pack-priv Insets contentMargins

The content margins for this region.

defaultsback to summary
pack-priv UIDefaults defaults

Defaults on the region/component level.

statesback to summary
pack-priv NimbusStyle.RuntimeState[] states

The list of actual runtime state representations. These can represent things such as Enabled + Focused. Thus, they differ from States in that they contain several states together, and have associated properties, data, etc.

stateTypesback to summary
pack-priv State<?>[] stateTypes

The list of State types. A State represents a type of state, such as Enabled, Default, WindowFocused, etc. These can be custom states.

Constructor Detail

Valuesback to summary
private Values()