public final class StyleManager
extends java.lang.Object
WebLafSkin,
SkinInfo| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_PAINTER_ID
Default painter ID.
|
| Constructor and Description |
|---|
StyleManager() |
| Modifier and Type | Method and Description |
|---|---|
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 <T extends Painter> |
getPainter(javax.swing.JComponent component)
Returns painter for the specified component.
|
static <T extends Painter> |
getPainter(javax.swing.JComponent component,
java.lang.String painterId)
Returns painter for the specified component and painter ID.
|
static <T> T |
getPainterPropertyValue(javax.swing.JComponent component,
java.lang.String key)
Returns painter property value from the specified component.
|
static <T> T |
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 <T extends Painter> |
setCustomPainter(javax.swing.JComponent component,
java.lang.String id,
T painter)
Sets custom painter for the specified component.
|
static <T extends Painter> |
setCustomPainter(javax.swing.JComponent component,
T painter)
Sets custom default painter for the specified component.
|
static <T> T |
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 <T> T |
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.
|
public static final java.lang.String DEFAULT_PAINTER_ID
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 namepublic static WebLafSkin setDefaultSkin(java.lang.Class skinClass)
skinClass - default skin classpublic static WebLafSkin createSkin(java.lang.Class skinClass)
skinClass - skin classpublic static WebLafSkin setDefaultSkin(WebLafSkin skin)
skin - default skinpublic static WebLafSkin applyDefaultSkin()
public static WebLafSkin getCurrentSkin()
public static WebLafSkin applySkin(java.lang.String skinClassName)
skinClassName - class name of the skin to be appliedpublic static WebLafSkin applySkin(java.lang.Class skinClass)
skinClass - class of the skin to be appliedpublic static WebLafSkin applySkin(WebLafSkin skin)
skin - skin to be appliedpublic static WebLafSkin applySkin(javax.swing.JComponent component)
component - component to apply skin topublic static WebLafSkin applySkin(javax.swing.JComponent component, WebLafSkin skin)
component - component to apply skin toskin - skin to be appliedpublic static WebLafSkin removeSkin(javax.swing.JComponent component)
component - component to remove skin frompublic 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 keypublic 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 keypublic 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 valuepublic 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 valuepublic 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 forpublic 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 frompublic static <T extends Painter> T getPainter(javax.swing.JComponent component, java.lang.String painterId)
T - painter typecomponent - component to retrieve painter frompainterId - painter IDpublic static <T extends Painter> T setCustomPainter(javax.swing.JComponent component, T painter)
T - painter typecomponent - component to set painter forpainter - painterpublic 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 - painterpublic 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 forpublic 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