Package com.michaelbaranov.microba
Class Microba
- java.lang.Object
-
- com.michaelbaranov.microba.Microba
-
public class Microba extends java.lang.ObjectThis class is used to initialize Microba library.- Author:
- Michael Baranov
-
-
Constructor Summary
Constructors Constructor Description Microba()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.awt.ColorgetOverridenColor(java.lang.String colorConstant, MicrobaComponent component)Returns overriden color for given component in current Look&Feel.static java.awt.ColorgetOverridenColor(java.lang.String colorConstant, MicrobaComponent component, java.awt.Color defaultColor)Returns overriden color for given component in current Look&Feel or a default value.static voidinit()Initializes the library: installs L&F properties, sets up a L&F change listener.static voidsetColorOverrideMap(java.lang.String lookAndFeel, java.util.Map overrides)Sets per-Lokk&Feel map of color overrides.
-
-
-
Method Detail
-
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(java.lang.String lookAndFeel, java.util.Map overrides)Sets per-Lokk&Feel map of color overrides.- Parameters:
lookAndFeel- look&feel IDoverrides- keys in the map areStringconstants, valuse are of typeColoror of typeString(in this case,Colorvalues are obtained viaUIManager.getColor(Object)). May benull.
-
getOverridenColor
public static java.awt.Color getOverridenColor(java.lang.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
nullis returned.
- Parameters:
colorConstant- color constantcomponent- component of the library- Returns:
- overriden color or
nullif not overriden
-
getOverridenColor
public static java.awt.Color getOverridenColor(java.lang.String colorConstant, MicrobaComponent component, java.awt.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.
- Parameters:
colorConstant- color constantcomponent- component of the librarydefaultColor-- Returns:
- overriden color or defaultColor if not overriden
-
-