| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class | NimbusDefaults.
Listener to update derived colors on UIManager Defaults changes |
| pack-priv static class | NimbusDefaults.
Derives its font value based on a parent font and a set of offsets and attributes. |
| private static class | NimbusDefaults.
This class is private because it relies on the constructor of the auto-generated AbstractRegionPainter subclasses. |
| private class | NimbusDefaults.
A class which creates the NimbusStyle associated with it lazily, but also manages a lot more information about the style. |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private NimbusDefaults. | |
| private FontUIResource | defaultFont
The default font that will be used. |
| private NimbusDefaults. | defaultsListener
Listener for changes to user defaults table |
| private DefaultSynthStyle | defaultStyle
Our fallback style to avoid NPEs if the proper style cannot be found in this class. |
| private Map | |
| private Map | m
The map of SynthStyles. |
| private Map | |
| private Map | registeredRegions
A map of regions which have been registered. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | addColor(UIDefaults d, String uin, String parentUin, float hOffset, float sOffset, float bOffset, int aOffset)
|
| private void | addColor(UIDefaults d, String uin, String parentUin, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource)
|
| public void | |
| public DerivedColor | Returns: The stored derived colorThe parent UIDefault key parentUin, float The hue offset hOffset, float The saturation offset sOffset, float The brightness offset bOffset, int The alpha offset aOffset, boolean True if the derived color should be a UIResource,
false if it should not be a UIResource uiResource)Get a derived color, derived colors are shared instances and will be updated when its parent UIDefault color changes. |
| private DerivedColor | getDerivedColor(String uin, String parentUin, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource)
|
| pack-priv SynthStyle | getStyle(JComponent
The component associated with this region. For example, if
the Region is Region.Button then the component will be a JButton.
If the Region is a subregion, such as ScrollBarThumb, then the
associated component will be the component that subregion belongs
to, such as JScrollBar. The JComponent may be named. It may not be
null. comp, Region The region we are looking for a style for. May not be null. r)Locate the style associated with the given region, and component. |
| pack-priv void | |
| pack-priv void | initializeDefaults(UIDefaults
UIDefaults table to initialize. This will never be null.
If listeners are attached to d)d, then you will
only receive notification of LookAndFeel level defaults, not
all defaults on the UIManager.Called from NimbusLookAndFeel to initialize the UIDefaults. |
| pack-priv void | register(Region
The Synth Region that is being registered. Such as Button,
or ScrollBarThumb. region, String The UIDefault prefix. For example, could be ComboBox, or if
a named components, "MyComboBox", or even something like
ToolBar:"MyComboBox":"ComboBox.arrowButton" prefix)Registers the given region and prefix. |
| pack-priv void |
| colorTree | back to summary |
|---|---|
| private NimbusDefaults. | |
| defaultFont | back to summary |
|---|---|
| private FontUIResource defaultFont The default font that will be used. I store this value so that it can be set in the UIDefaults when requested. | |
| defaultsListener | back to summary |
|---|---|
| private NimbusDefaults. Listener for changes to user defaults table | |
| defaultStyle | back to summary |
|---|---|
| private DefaultSynthStyle defaultStyle Our fallback style to avoid NPEs if the proper style cannot be found in this class. Not sure if relying on DefaultSynthStyle is the best choice. | |
| derivedColors | back to summary |
|---|---|
| private Map<DerivedColor, DerivedColor> derivedColors | |
| m | back to summary |
|---|---|
| private Map<Region, List<NimbusDefaults. The map of SynthStyles. This map is keyed by Region. Each Region maps to a List of LazyStyles. Each LazyStyle has a reference to the prefix that was registered with it. This reference can then be inspected to see if it is the proper lazy style. There can be more than one LazyStyle for a single Region if there is more than one prefix defined for a given region. For example, both Button and "MyButton" might be prefixes assigned to the Region.Button region. | |
| overridesCache | back to summary |
|---|---|
| private Map<JComponent, Map<Region, SynthStyle>> overridesCache | |
| registeredRegions | back to summary |
|---|---|
| private Map<String, Region> registeredRegions A map of regions which have been registered. This mapping is maintained so that the Region can be found based on prefix in a very fast manner. This is used in the "matches" method of LazyStyle. | |
| NimbusDefaults | back to summary |
|---|---|
| pack-priv NimbusDefaults() Create a new NimbusDefaults. This constructor is only called from within NimbusLookAndFeel. | |
| addColor | back to summary |
|---|---|
| private void addColor(UIDefaults d, String uin, int r, int g, int b, int a) | |
| addColor | back to summary |
|---|---|
| private void addColor(UIDefaults d, String uin, String parentUin, float hOffset, float sOffset, float bOffset, int aOffset) | |
| addColor | back to summary |
|---|---|
| private void addColor(UIDefaults d, String uin, String parentUin, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource) | |
| clearOverridesCache | back to summary |
|---|---|
| public void clearOverridesCache(JComponent c) | |
| getDerivedColor | back to summary |
|---|---|
| public DerivedColor getDerivedColor(String parentUin, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource) Get a derived color, derived colors are shared instances and will be updated when its parent UIDefault color changes.
| |
| getDerivedColor | back to summary |
|---|---|
| private DerivedColor getDerivedColor(String uin, String parentUin, float hOffset, float sOffset, float bOffset, int aOffset, boolean uiResource) | |
| getStyle | back to summary |
|---|---|
| pack-priv SynthStyle getStyle(JComponent comp, Region r) Locate the style associated with the given region, and component. This is called from NimbusLookAndFeel in the SynthStyleFactory implementation. Lookup occurs as follows:
| |
| initialize | back to summary |
|---|---|
| pack-priv void initialize() Called by UIManager when this look and feel is installed. | |
| initializeDefaults | back to summary |
|---|---|
| pack-priv void initializeDefaults(UIDefaults d) Called from NimbusLookAndFeel to initialize the UIDefaults.
| |
| register | back to summary |
|---|---|
| pack-priv void register(Region region, String prefix) Registers the given region and prefix. The prefix, if it contains quoted sections, refers to certain named components. If there are not quoted sections, then the prefix refers to a generic component type. If the given region/prefix combo has already been registered, then it will not be registered twice. The second registration attempt will fail silently. | |
| uninitialize | back to summary |
|---|---|
| pack-priv void uninitialize() Called by UIManager when this look and feel is uninstalled. | |
| Modifier and Type | Class and Description |
|---|---|
| pack-priv class |
| Modifier and Type | Field and Description |
|---|---|
| private Map | |
| private NimbusDefaults. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public Color | |
| private NimbusDefaults. | |
| public void | propertyChange(PropertyChangeEvent ev)
Implements java. This method gets called when a bound property is changed. |
| public void |
| nodes | back to summary |
|---|---|
| private Map<String, NimbusDefaults. | |
| root | back to summary |
|---|---|
| private NimbusDefaults. | |
| ColorTree | back to summary |
|---|---|
| private ColorTree() | |
| addColor | back to summary |
|---|---|
| public void addColor(String uin, Color color) | |
| getColor | back to summary |
|---|---|
| public Color getColor(String uin) | |
| getParentNode | back to summary |
|---|---|
| private NimbusDefaults. | |
| propertyChange | back to summary |
|---|---|
| public void propertyChange(PropertyChangeEvent ev) Implements java. Doc from java. This method gets called when a bound property is changed.
| |
| update | back to summary |
|---|---|
| public void update() | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv List | |
| pack-priv Color | |
| pack-priv NimbusDefaults. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void |
| children | back to summary |
|---|---|
| pack-priv List<NimbusDefaults. | |
| color | back to summary |
|---|---|
| pack-priv Color color | |
| parent | back to summary |
|---|---|
| pack-priv NimbusDefaults. | |
| Node | back to summary |
|---|---|
| pack-priv Node(Color color, NimbusDefaults. | |
| set | back to summary |
|---|---|
| public void set(Color color, NimbusDefaults. | |
| update | back to summary |
|---|---|
| public void update() | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | propertyChange(PropertyChangeEvent evt)
Implements java. This method gets called when a bound property is changed. |
| DefaultsListener | back to summary |
|---|---|
| private DefaultsListener() | |
| propertyChange | back to summary |
|---|---|
| public void propertyChange(PropertyChangeEvent evt) Implements java. Doc from java. This method gets called when a bound property is changed.
| |
Derives its font value based on a parent font and a set of offsets and attributes. This class is an ActiveValue, meaning that it will recompute its value each time it is requested from UIDefaults. It is therefore recommended to read this value once and cache it in the UI delegate class until asked to reinitialize.
To use this class, create an instance with the key of the font in the UI defaults table from which to derive this font, along with a size offset (if any), and whether it is to be bold, italic, or left in its default form.
| Modifier and Type | Field and Description |
|---|---|
| private Boolean | |
| private Boolean | |
| private String | |
| private float |
| Access | Constructor and Description |
|---|---|
| public | DerivedFont(String
The UIDefault key associated with this derived font's
parent or source. If this key leads to a null value, or a
value that is not a font, then null will be returned as
the derived font. The key must not be null. key, float The size offset, as a percentage, to use. For
example, if the source font was a 12pt font and the
sizeOffset were specified as .9, then the new font
will be 90% of what the source font was, or, 10.8
pts which is rounded to 11pts. This fractional
based offset allows for proper font scaling in high
DPI or large system font scenarios. sizeOffset, Boolean Whether the new font should be bold. If null, then this
new font will inherit the bold setting of the source
font. bold, Boolean Whether the new font should be italicized. If null,
then this new font will inherit the italic setting of
the source font. italic)Create a new DerivedFont. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | createValue(UIDefaults defaults)
Implements javax. Creates the value retrieved from the |
| bold | back to summary |
|---|---|
| private Boolean bold | |
| italic | back to summary |
|---|---|
| private Boolean italic | |
| parentKey | back to summary |
|---|---|
| private String parentKey | |
| sizeOffset | back to summary |
|---|---|
| private float sizeOffset | |
| DerivedFont | back to summary |
|---|---|
| public DerivedFont(String key, float sizeOffset, Boolean bold, Boolean italic) Create a new DerivedFont.
| |
| createValue | back to summary |
|---|---|
| public Object createValue(UIDefaults defaults) Implements javax. Doc from javax. Creates the value retrieved from the
| |
LazyPainter is a LazyValue class. It will create the AbstractRegionPainter lazily, when asked. It uses reflection to load the proper class and invoke its constructor.
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private AbstractRegionPainter. | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv | LazyPainter(String className, int which, Insets insets, Dimension canvasSize, boolean inverted, AbstractRegionPainter.
|
| Modifier and Type | Method and Description |
|---|---|
| public Object | createValue(UIDefaults table)
Implements javax. Creates the actual value retrieved from the |
| className | back to summary |
|---|---|
| private String className | |
| ctx | back to summary |
|---|---|
| private AbstractRegionPainter. | |
| which | back to summary |
|---|---|
| private int which | |
| LazyPainter | back to summary |
|---|---|
| pack-priv LazyPainter(String className, int which, Insets insets, Dimension canvasSize, boolean inverted) | |
| LazyPainter | back to summary |
|---|---|
| pack-priv LazyPainter(String className, int which, Insets insets, Dimension canvasSize, boolean inverted, AbstractRegionPainter. | |
| createValue | back to summary |
|---|---|
| public Object createValue(UIDefaults table) Implements javax. Doc from javax. Creates the actual value retrieved from the
| |
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private NimbusDefaults. | parts
The various parts, or sections, of the prefix. |
| private String | prefix
The prefix this LazyStyle was registered with. |
| private boolean | simple
Whether or not this LazyStyle represents an unnamed component |
| private NimbusStyle | style
Cached shared style. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv SynthStyle | |
| pack-priv boolean | matches(JComponent c)
This LazyStyle is a match for the given component if, and only if, for each part of the prefix the component hierarchy matches exactly. |
| private boolean | |
| private List |
| parts | back to summary |
|---|---|
| private NimbusDefaults. The various parts, or sections, of the prefix. For example, the prefix: ComboBox:"ComboBox.arrowButton" will be broken into two parts, ComboBox and "ComboBox.arrowButton" | |
| prefix | back to summary |
|---|---|
| private String prefix The prefix this LazyStyle was registered with. Something like Button or ComboBox:"ComboBox.arrowButton" | |
| simple | back to summary |
|---|---|
| private boolean simple Whether or not this LazyStyle represents an unnamed component | |
| style | back to summary |
|---|---|
| private NimbusStyle style Cached shared style. | |
| LazyStyle | back to summary |
|---|---|
| private LazyStyle(String prefix) Create a new LazyStyle.
| |
| getStyle | back to summary |
|---|---|
| pack-priv SynthStyle getStyle(JComponent c, Region r) Gets the style. Creates it if necessary.
| |
| matches | back to summary |
|---|---|
| pack-priv boolean matches(JComponent c) This LazyStyle is a match for the given component if, and only if, for each part of the prefix the component hierarchy matches exactly. That is, if given "a":something:"b", then: c.getName() must equals "b" c.getParent() can be anything c.getParent().getParent().getName() must equal "a". | |
| matches | back to summary |
|---|---|
| private boolean matches(Component c, int partIndex) | |
| split | back to summary |
|---|---|
| private List Given some dot separated prefix, split on the colons that are not within quotes, and not within brackets. | |
| Modifier and Type | Field and Description |
|---|---|
| private Class | |
| private boolean | |
| private String |
| c | back to summary |
|---|---|
| private Class<?> c | |
| named | back to summary |
|---|---|
| private boolean named | |
| s | back to summary |
|---|---|
| private String s | |
| Part | back to summary |
|---|---|
| pack-priv Part(String s) | |
| Modifier and Type | Field and Description |
|---|---|
| private Insets | |
| private Painter | |
| private String |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Insets | getBorderInsets(Component c)
Implements javax. Returns the insets of the border. |
| public boolean | isBorderOpaque()
Implements javax. Returns whether or not the border is opaque. |
| public void | paintBorder(Component c, Graphics g, int x, int y, int w, int h)
Implements javax. Paints the border for the specified component with the specified position and size. |
| insets | back to summary |
|---|---|
| private Insets insets | |
| painter | back to summary |
|---|---|
| private Painter<Component> painter | |
| painterKey | back to summary |
|---|---|
| private String painterKey | |
| PainterBorder | back to summary |
|---|---|
| pack-priv PainterBorder(String painterKey, Insets insets) | |
| getBorderInsets | back to summary |
|---|---|
| public Insets getBorderInsets(Component c) Implements javax. Doc from javax. Returns the insets of the border.
| |
| isBorderOpaque | back to summary |
|---|---|
| public boolean isBorderOpaque() Implements javax. Doc from javax. Returns whether or not the border is opaque. If the border is opaque, it is responsible for filling in it's own background when painting.
| |
| paintBorder | back to summary |
|---|---|
| public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) Implements javax. Doc from javax. Paints the border for the specified component with the specified position and size.
| |