|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.util.swing.plaf.AbstractComponentAddon
public abstract class AbstractComponentAddon
Ease the work of creating an addon for a component.
Constructor Summary | |
---|---|
protected |
AbstractComponentAddon(String name)
|
Method Summary | |
---|---|
protected void |
add(IconManager iconManager,
String prefix,
int effectFlags)
Add all icons provided by the given icon manager the the UI resources. |
protected void |
add(String key,
Border... borders)
Add a set of nested borders. |
protected void |
add(String key,
Color color,
int alpha)
Add a color with a transparency value. |
protected void |
add(String key,
Object value)
Add a simple UI property. |
protected void |
addInputMap(int focusState,
String parentMapName,
String... map)
Add an input map comprised of the given map entries. |
protected void |
addResource(String bundleName)
Adds the all keys/values from the given named resource bundle to the defaults |
protected Color |
getColor(String key)
|
protected Color |
getColor(String key,
Color defaultColor)
|
protected Font |
getFont(String key)
|
protected Font |
getFont(String key,
Font defaultFont)
|
String |
getName()
|
protected void |
initBasicDefaults(LookAndFeelAddons addon)
Adds default key/value pairs to the given list. |
void |
initialize(LookAndFeelAddons addon)
Initializes this addon (i.e register UI classes, colors, fonts, borders, any UIResource used by the component class). |
protected void |
initMacDefaults(LookAndFeelAddons addon)
Default implementation calls initBasicDefaults(LookAndFeelAddons) |
protected void |
initMetalDefaults(LookAndFeelAddons addon)
Default implementation calls initBasicDefaults(LookAndFeelAddons) |
protected void |
initMotifDefaults(LookAndFeelAddons addon)
Default implementation calls initBasicDefaults(LookAndFeelAddons) |
protected void |
initWindowsDefaults(LookAndFeelAddons addon)
Default implementation calls initBasicDefaults(LookAndFeelAddons) |
protected boolean |
isMac(LookAndFeelAddons addon)
|
protected boolean |
isMetal(LookAndFeelAddons addon)
|
protected boolean |
isMotif(LookAndFeelAddons addon)
|
protected boolean |
isPlastic()
|
protected boolean |
isSynth()
|
protected boolean |
isWindows(LookAndFeelAddons addon)
|
protected Color |
lookupColor(Color fallback,
String... keys)
Look up a Color from the UIManager using a list of keys to try. |
void |
uninitialize(LookAndFeelAddons addon)
Uninitializes this addon. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractComponentAddon(String name)
Method Detail |
---|
public final String getName()
getName
in interface ComponentAddon
public void initialize(LookAndFeelAddons addon)
ComponentAddon
initialize
in interface ComponentAddon
addon
- the current addonpublic void uninitialize(LookAndFeelAddons addon)
ComponentAddon
uninitialize
in interface ComponentAddon
protected void initBasicDefaults(LookAndFeelAddons addon)
addon
- protected void initMacDefaults(LookAndFeelAddons addon)
initBasicDefaults(LookAndFeelAddons)
addon
- protected void initMetalDefaults(LookAndFeelAddons addon)
initBasicDefaults(LookAndFeelAddons)
addon
- protected void initMotifDefaults(LookAndFeelAddons addon)
initBasicDefaults(LookAndFeelAddons)
addon
- protected void initWindowsDefaults(LookAndFeelAddons addon)
initBasicDefaults(LookAndFeelAddons)
addon
- protected void add(String key, Object value)
key
- the property keyvalue
- the property valueprotected void add(String key, Color color, int alpha)
key
- the property key. For details see add(String, Object)
.color
- the (opaque) coloralpha
- the alpha valueprotected void addResource(String bundleName)
protected void add(String key, Border... borders)
key
- the property key. For details see add(String, Object)
.borders
- the valueprotected boolean isWindows(LookAndFeelAddons addon)
protected boolean isMetal(LookAndFeelAddons addon)
protected boolean isMac(LookAndFeelAddons addon)
protected boolean isMotif(LookAndFeelAddons addon)
protected boolean isPlastic()
protected boolean isSynth()
protected Font getFont(String key)
protected Font getFont(String key, Font defaultFont)
protected Color getColor(String key)
protected Color getColor(String key, Color defaultColor)
protected void addInputMap(int focusState, String parentMapName, String... map)
add(String, Object)
still
applies):
focusState
- the focus state to which this map pertainsparentMapName
- UI resource name of the parent map or null
, if this map
should not use a parent mapmap
- the map's key/value pairsprotected void add(IconManager iconManager, String prefix, int effectFlags)
iconManager
- the IconManager
instance.prefix
- the prefix to apply to the icon names. May be null
. If non-null, a
dot is automatically inserted between the prefix and the key.effectFlags
- the effect flags for which to retrieve the icons.protected Color lookupColor(Color fallback, String... keys)
Color
from the UIManager
using a list of keys to try. The keys are
tried in order, until a value is found. If no value is found for any of the keys, the given
fallback color is returned.
fallback
- keys
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |