|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.managers.style.StyleManager
public final class StyleManager
This class manages WebLaF component styles. It also manages available WebLaF skins and can install/change them in runtime.
WebLafSkin
,
SkinInfo
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_PAINTER_ID
Default painter ID. |
Constructor Summary | |
---|---|
StyleManager()
|
Method Summary | ||
---|---|---|
static WebLafSkin |
applyDefaultSkin()
Applies default skin to all existing skinnable components. |
|
static WebLafSkin |
applySkin(java.lang.Class skinClass)
Applies specified skin to all existing skinnable components. |
|
static WebLafSkin |
applySkin(javax.swing.JComponent component)
Applies current skin to the skinnable component. |
|
static WebLafSkin |
applySkin(javax.swing.JComponent component,
WebLafSkin skin)
Applies specified skin to the skinnable component. |
|
static WebLafSkin |
applySkin(java.lang.String skinClassName)
Applies specified skin to all existing skinnable components. |
|
static WebLafSkin |
applySkin(WebLafSkin skin)
Applies specified skin to all existing skinnable components. |
|
static void |
clearCustomPainterProperties(javax.swing.JComponent component)
Clears all custom painter properties for the specified component. |
|
static WebLafSkin |
createSkin(java.lang.Class skinClass)
Returns newly created skin class instance. |
|
static WebLafSkin |
getCurrentSkin()
Returns currently applied skin. |
|
static java.util.Map<javax.swing.JComponent,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> |
getCustomPainterProperties()
Returns all custom painter properties. |
|
static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> |
getCustomPainterProperties(javax.swing.JComponent component)
Returns all custom painter properties for the specified component. |
|
static java.util.Map<javax.swing.JComponent,java.util.Map<java.lang.String,Painter>> |
getCustomPainters()
Returns all custom painters. |
|
static java.util.Map<java.lang.String,Painter> |
getCustomPainters(javax.swing.JComponent component)
Returns all custom painters for the specified component. |
|
static WebLafSkin |
getDefaultSkin()
Returns default skin. |
|
static
|
getPainter(javax.swing.JComponent component)
Returns painter for the specified component. |
|
static
|
getPainter(javax.swing.JComponent component,
java.lang.String painterId)
Returns painter for the specified component and painter ID. |
|
static
|
getPainterPropertyValue(javax.swing.JComponent component,
java.lang.String key)
Returns painter property value from the specified component. |
|
static
|
getPainterPropertyValue(javax.swing.JComponent component,
java.lang.String painterId,
java.lang.String key)
Returns painter property value from the specified component. |
|
static void |
initialize()
Initializes StyleManager settings. |
|
static boolean |
isStrictStyleChecks()
Returns whether strict style checks are enabled or not. |
|
static void |
removeCustomPainters(javax.swing.JComponent component)
Removes all custom painters from the specified component. |
|
static WebLafSkin |
removeSkin(javax.swing.JComponent component)
Removes skin applied to the specified component and returns it. |
|
static
|
setCustomPainter(javax.swing.JComponent component,
java.lang.String id,
T painter)
Sets custom painter for the specified component. |
|
static
|
setCustomPainter(javax.swing.JComponent component,
T painter)
Sets custom default painter for the specified component. |
|
static
|
setCustomPainterProperty(javax.swing.JComponent component,
java.lang.String painterId,
java.lang.String key,
T value)
Sets custom value for painter property for the specified component. |
|
static
|
setCustomPainterProperty(javax.swing.JComponent component,
java.lang.String key,
T value)
Sets custom value for painter property for the specified component. |
|
static WebLafSkin |
setDefaultSkin(java.lang.Class skinClass)
Sets default skin. |
|
static WebLafSkin |
setDefaultSkin(java.lang.String skinClassName)
Sets default skin. |
|
static WebLafSkin |
setDefaultSkin(WebLafSkin skin)
Sets default skin. |
|
static void |
setStrictStyleChecks(boolean strict)
Sets whether strict style checks are enabled or not. |
|
static boolean |
setStyleId(java.awt.Component component,
java.lang.String styleId)
Sets component style ID if component or its UI is instance of Styleable interface. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_PAINTER_ID
Constructor Detail |
---|
public StyleManager()
Method Detail |
---|
public static void initialize()
public static boolean isStrictStyleChecks()
public static void setStrictStyleChecks(boolean strict)
strict
- whether strict style checks are enabled or notpublic static WebLafSkin getDefaultSkin()
public static WebLafSkin setDefaultSkin(java.lang.String skinClassName)
skinClassName
- default skin class name
public static WebLafSkin setDefaultSkin(java.lang.Class skinClass)
skinClass
- default skin class
public static WebLafSkin createSkin(java.lang.Class skinClass)
skinClass
- skin class
public static WebLafSkin setDefaultSkin(WebLafSkin skin)
skin
- default skin
public static WebLafSkin applyDefaultSkin()
public static WebLafSkin getCurrentSkin()
public static WebLafSkin applySkin(java.lang.String skinClassName)
skinClassName
- class name of the skin to be applied
public static WebLafSkin applySkin(java.lang.Class skinClass)
skinClass
- class of the skin to be applied
public static WebLafSkin applySkin(WebLafSkin skin)
skin
- skin to be applied
public static WebLafSkin applySkin(javax.swing.JComponent component)
component
- component to apply skin to
public static WebLafSkin applySkin(javax.swing.JComponent component, WebLafSkin skin)
component
- component to apply skin toskin
- skin to be applied
public static WebLafSkin removeSkin(javax.swing.JComponent component)
component
- component to remove skin from
public static <T> T getPainterPropertyValue(javax.swing.JComponent component, java.lang.String key)
T
- style property value typecomponent
- component to retrieve style property fromkey
- style property key
public static <T> T getPainterPropertyValue(javax.swing.JComponent component, java.lang.String painterId, java.lang.String key)
T
- style property value typecomponent
- component to retrieve style property frompainterId
- painter IDkey
- style property key
public static <T> T setCustomPainterProperty(javax.swing.JComponent component, java.lang.String key, T value)
T
- custom style property value typecomponent
- component to apply custom style property tokey
- custom style property keyvalue
- custom style property value
public static <T> T setCustomPainterProperty(javax.swing.JComponent component, java.lang.String painterId, java.lang.String key, T value)
T
- custom style property value typecomponent
- component to apply custom style property topainterId
- painter IDkey
- custom style property keyvalue
- custom style property value
public static java.util.Map<javax.swing.JComponent,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>>> getCustomPainterProperties()
public static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> getCustomPainterProperties(javax.swing.JComponent component)
component
- component to retrieve custom properties for
public static void clearCustomPainterProperties(javax.swing.JComponent component)
component
- component to clear custom painter properties forpublic static <T extends Painter> T getPainter(javax.swing.JComponent component)
T
- painter typecomponent
- component to retrieve painter from
public static <T extends Painter> T getPainter(javax.swing.JComponent component, java.lang.String painterId)
T
- painter typecomponent
- component to retrieve painter frompainterId
- painter ID
public static <T extends Painter> T setCustomPainter(javax.swing.JComponent component, T painter)
T
- painter typecomponent
- component to set painter forpainter
- painter
public static <T extends Painter> T setCustomPainter(javax.swing.JComponent component, java.lang.String id, T painter)
T
- painter typecomponent
- component to set painter forid
- painter IDpainter
- painter
public static java.util.Map<javax.swing.JComponent,java.util.Map<java.lang.String,Painter>> getCustomPainters()
public static java.util.Map<java.lang.String,Painter> getCustomPainters(javax.swing.JComponent component)
component
- component to retrieve custom painters for
public static void removeCustomPainters(javax.swing.JComponent component)
component
- component to remove custom painters frompublic static boolean setStyleId(java.awt.Component component, java.lang.String styleId)
component
- component to apply style ID tostyleId
- style ID
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |