| Constructor and Description |
|---|
StyleManager() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addStyleListener(javax.swing.JComponent component,
StyleListener listener)
Adds skin change listener.
|
static Painter |
getCustomPainter(javax.swing.JComponent component)
Returns custom base painter for the specified component.
|
static Painter |
getCustomPainter(javax.swing.JComponent component,
java.lang.String id)
Returns custom painter for the specified component.
|
static java.util.Map<java.lang.String,Painter> |
getCustomPainters(javax.swing.JComponent component)
Returns all custom painters for the specified component.
|
static java.lang.Class<? extends Skin> |
getDefaultSkin()
Returns default skin.
|
static Skin |
getSkin()
Returns currently applied skin.
|
static Skin |
getSkin(javax.swing.JComponent component)
Returns skin currently applied to the specified component.
|
static StyleId |
getStyleId(javax.swing.JComponent component)
Returns component style ID.
|
static void |
initialize()
Initializes StyleManager settings.
|
static Skin |
installSkin(javax.swing.JComponent component)
Applies current skin to the skinnable component.
|
static boolean |
isStrictStyleChecks()
Returns whether strict style checks are enabled or not.
|
static void |
removeStyleListener(javax.swing.JComponent component,
StyleListener listener)
Removes skin change listener.
|
static boolean |
restoreDefaultPainters(javax.swing.JComponent component)
Restores default painters for the specified component.
|
static Skin |
restoreSkin(javax.swing.JComponent component)
Restores global skin for the skinnable component and all of its children linked via
StyleId. |
static StyleId |
restoreStyleId(javax.swing.JComponent component)
Restores component default style ID.
|
static <T extends Painter> |
setCustomPainter(javax.swing.JComponent component,
java.lang.String id,
T painter)
Sets custom painter for the specified component under the specified painter ID.
|
static <T extends Painter> |
setCustomPainter(javax.swing.JComponent component,
T painter)
Sets custom base painter for the specified component.
|
static java.lang.Class<? extends Skin> |
setDefaultSkin(java.lang.Class<? extends Skin> skinClass)
Sets default skin.
|
static java.lang.Class<? extends Skin> |
setDefaultSkin(java.lang.String skinClassName)
Sets default skin.
|
static Skin |
setSkin(java.lang.Class skinClass)
Applies specified skin to all existing skinnable components.
|
static Skin |
setSkin(javax.swing.JComponent component,
Skin skin)
Applies specified skin to the skinnable component and all of its children linked via
StyleId. |
static Skin |
setSkin(javax.swing.JComponent component,
Skin skin,
boolean recursively)
Applies specified skin to the skinnable component and all of its children linked via
StyleId. |
static Skin |
setSkin(Skin skin)
Applies specified skin to all existing skinnable components.
|
static Skin |
setSkin(java.lang.String skinClassName)
Applies specified skin to all existing skinnable components.
|
static void |
setStrictStyleChecks(boolean strict)
Sets whether strict style checks are enabled or not.
|
static StyleId |
setStyleId(javax.swing.JComponent component,
StyleId id)
Sets new component style ID.
|
static Skin |
uninstallSkin(javax.swing.JComponent component)
Removes skin applied to the specified component and returns it.
|
static void |
updateSkin(javax.swing.JComponent component)
Updates current skin in the skinnable component.
|
public static void initialize()
public static boolean isStrictStyleChecks()
public static void setStrictStyleChecks(boolean strict)
strict - whether strict style checks are enabled or notpublic static java.lang.Class<? extends Skin> getDefaultSkin()
public static java.lang.Class<? extends Skin> setDefaultSkin(java.lang.String skinClassName)
skinClassName - default skin class namepublic static java.lang.Class<? extends Skin> setDefaultSkin(java.lang.Class<? extends Skin> skinClass)
skinClass - default skin classpublic static Skin getSkin()
public static Skin setSkin(java.lang.String skinClassName)
skinClassName - class name of the skin to be appliedpublic static Skin setSkin(java.lang.Class skinClass)
skinClass - class of the skin to be appliedpublic static Skin setSkin(Skin skin)
skin - skin to be appliedpublic static StyleId getStyleId(javax.swing.JComponent component)
component - component to retrieve style ID forpublic static StyleId setStyleId(javax.swing.JComponent component, StyleId id)
component - component to set style ID forid - new style IDpublic static StyleId restoreStyleId(javax.swing.JComponent component)
component - component to restore style ID forpublic static Skin installSkin(javax.swing.JComponent component)
This method is used only to setup style data into UI on install. It is not recommended to use it outside of that install behavior.
component - component to apply skin topublic static void updateSkin(javax.swing.JComponent component)
This method is used only to properly update skin on various changes. It is not recommended to use it outside of style manager behavior.
component - component to update skin forpublic static Skin uninstallSkin(javax.swing.JComponent component)
This method is used only to cleanup style data from UI on uninstall. It is not recommended to use it outside of that uninstall behavior.
component - component to remove skin frompublic static Skin getSkin(javax.swing.JComponent component)
component - component to retrieve applied skin frompublic static Skin setSkin(javax.swing.JComponent component, Skin skin)
StyleId.
Actual linked children information is stored within StyleData data objects.
Custom skin provided using this method will not be replaced if application skin changes.component - component to apply skin toskin - skin to be appliedpublic static Skin setSkin(javax.swing.JComponent component, Skin skin, boolean recursively)
StyleId.
Actual linked children information is stored within StyleData data objects.
Custom skin provided using this method will not be replaced if application skin changes.component - component to apply skin toskin - skin to be appliedrecursively - whether or not should apply skin to child componentspublic static Skin restoreSkin(javax.swing.JComponent component)
StyleId.
Actual linked children information is stored within StyleData data objects.
Restoring component skin will also include it back into the skin update cycle in case global skin will be changed.component - component to restore global skin forpublic static void addStyleListener(javax.swing.JComponent component,
StyleListener listener)
component - component to listen skin changes onlistener - skin change listener to addpublic static void removeStyleListener(javax.swing.JComponent component,
StyleListener listener)
component - component to listen skin changes onlistener - skin change listener to removepublic static java.util.Map<java.lang.String,Painter> getCustomPainters(javax.swing.JComponent component)
component - component to retrieve custom painters forpublic static Painter getCustomPainter(javax.swing.JComponent component)
component - component to retrieve custom base painter forpublic static Painter getCustomPainter(javax.swing.JComponent component, java.lang.String id)
component - component to retrieve custom painter forid - 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 boolean restoreDefaultPainters(javax.swing.JComponent component)
component - component to restore default painters for