com.michaelbaranov.microba
Class Microba
java.lang.Object
com.michaelbaranov.microba.Microba
public class Microba
extends java.lang.Object
This class is used to initialize Microba library.
static Color | getOverridenColor(String colorConstant, MicrobaComponent component) - Returns overriden color for given component in current Look&Feel.
|
static Color | getOverridenColor(String colorConstant, MicrobaComponent component, Color defaultColor) - Returns overriden color for given component in current Look&Feel or a
default value.
|
static void | init() - Initializes the library: installs L&F properties, sets up a L&F change
listener.
|
static void | setColorOverrideMap(String lookAndFeel, Map overrides) - Sets per-Lokk&Feel map of color overrides.
|
getOverridenColor
public static Color getOverridenColor(String colorConstant,
MicrobaComponent component)
Returns overriden color for given component in current Look&Feel. The
algorithms is:
- If the component overrides the constant (per-instance override),
then it is returned.
- If the library overrides the constant (per-Look&Feel override), then
it is returned.
- Else
null
is returned.
This method is actually intended to be used by UI delegates of the
library.
colorConstant
- color constantcomponent
- component of the library
- overriden color or
null
if not overriden
getOverridenColor
public static Color getOverridenColor(String colorConstant,
MicrobaComponent component,
Color defaultColor)
Returns overriden color for given component in current Look&Feel or a
default value. The algorithms is:
- If the component overrides the constant (per-instance override),
then it is returned.
- If the library overrides the constant (per-Look&Feel override), then
it is returned.
- Else defaultColor is returned.
This method is actually intended to be used by UI delegates of the
library.
colorConstant
- color constantcomponent
- component of the librarydefaultColor
-
- overriden color or defaultColor if not overriden
init
public static void init()
Initializes the library: installs L&F properties, sets up a L&F change
listener.
No need to call this method explicitly for desktop applications. You
should only call it in
Applet.init()
. This will handle browser
refresh button correctly.
setColorOverrideMap
public static void setColorOverrideMap(String lookAndFeel,
Map overrides)
Sets per-Lokk&Feel map of color overrides.
lookAndFeel
- look&feel IDoverrides
- keys in the map are String
constants, valuse are of
type Color
or of type String
(in this case,
Color
values are obtained via
UIManager.getColor(Object)
). May be null
.