Package com.michaelbaranov.microba
Class Microba
java.lang.Object
com.michaelbaranov.microba.Microba
This class is used to initialize Microba library.
- Author:
- Michael Baranov
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorgetOverridenColor(String colorConstant, MicrobaComponent component) Returns overriden color for given component in current Lookinvalid input: '&Feel'.static ColorgetOverridenColor(String colorConstant, MicrobaComponent component, Color defaultColor) Returns overriden color for given component in current Lookinvalid input: '&Feel' or a default value.static voidinit()Initializes the library: installs Linvalid input: '&F' properties, sets up a Linvalid input: '&F' change listener.static voidsetColorOverrideMap(String lookAndFeel, Map overrides) Sets per-Lokkinvalid input: '&Feel' map of color overrides.
-
Constructor Details
-
Microba
public Microba()
-
-
Method Details
-
init
public static void init()Initializes the library: installs Linvalid input: '&F' properties, sets up a Linvalid input: '&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
Sets per-Lokkinvalid input: '&Feel' map of color overrides.- Parameters:
lookAndFeel- lookinvalid input: '&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
Returns overriden color for given component in current Lookinvalid input: '&Feel'. The algorithms is:- If the component overrides the constant (per-instance override), then it is returned.
- If the library overrides the constant (per-Lookinvalid input: '&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 Color getOverridenColor(String colorConstant, MicrobaComponent component, Color defaultColor) Returns overriden color for given component in current Lookinvalid input: '&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-Lookinvalid input: '&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
-