Skip to content

Commit

Permalink
A few additional skin apply methods for StyleManager
Browse files Browse the repository at this point in the history
README.md updated
Version updated to v1.28
  • Loading branch information
mgarin committed Apr 3, 2014
1 parent abcc18f commit 7c433b9
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 10 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ WebLaF
**WebLaf** is a Java Swing Look and Feel and extended components library for cross-platform applications.<br>
![Preview](http://s5.hostingkartinok.com/uploads/images/2013/10/92f65b6b3262493a5f386dc6808efbba.png)


Important
----------
With [v1.27](https://github.com/mgarin/weblaf/releases/tag/v1.27) update core StyleManager functionality was added and implemented in a few WebLaF components so the way they act might differ from what you got used to. You might want to [read here](https://github.com/mgarin/weblaf/wiki/How-to-use-StyleManager) about features that Style manager brings.

I will also be adding more articles into GitHub WIKI from now on, so you can find information about various WebLaF features there.


Advantages
----------

Expand All @@ -24,12 +32,12 @@ https://github.com/mgarin/weblaf/releases

Here are the direct links for the latest release:

1. [**weblaf-1.26.jar**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-1.26.jar) - library jar
2. [**weblaf-simple-1.26.jar**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-simple-1.26.jar) - library jar without dependencies
3. [**weblaf-src-1.26.zip**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-src-1.26.zip) - project sources zip
4. [**weblaf-demo-1.26.jar**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-demo-1.26.jar) - executable demo jar
5. [**weblaf-javadoc-1.26.zip**](https://github.com/mgarin/weblaf/releases/download/v1.26/weblaf-javadoc-1.26.zip) - JavaDoc zip
6. [**ninepatch-editor-1.26.jar**](https://github.com/mgarin/weblaf/releases/download/v1.26/ninepatch-editor-1.26.jar) - executable 9-patch editor jar
1. [**weblaf-1.27.jar**](https://github.com/mgarin/weblaf/releases/download/v1.27/weblaf-1.27.jar) - library jar
2. [**weblaf-simple-1.27.jar**](https://github.com/mgarin/weblaf/releases/download/v1.27/weblaf-simple-1.27.jar) - library jar without dependencies
3. [**weblaf-src-1.27.zip**](https://github.com/mgarin/weblaf/releases/download/v1.27/weblaf-src-1.27.zip) - project sources zip
4. [**weblaf-demo-1.27.jar**](https://github.com/mgarin/weblaf/releases/download/v1.27/weblaf-demo-1.27.jar) - executable demo jar
5. [**weblaf-javadoc-1.27.zip**](https://github.com/mgarin/weblaf/releases/download/v1.27/weblaf-javadoc-1.27.zip) - JavaDoc zip
6. [**ninepatch-editor-1.27.jar**](https://github.com/mgarin/weblaf/releases/download/v1.27/ninepatch-editor-1.27.jar) - executable 9-patch editor jar


Roadmap
Expand Down
4 changes: 2 additions & 2 deletions build/version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Sun Feb 23 12:35:23 CET 2014
build.number=27
#Thu Apr 03 15:47:18 MSK 2014
build.number=28
version.number=1
2 changes: 1 addition & 1 deletion src/com/alee/laf/resources/version.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<VersionInfo name="WebLaF" version="1" build="27" type="beta" date="23.02.2014" />
<VersionInfo name="WebLaF" version="1" build="28" type="beta" date="03.04.2014" />
37 changes: 36 additions & 1 deletion src/com/alee/managers/style/StyleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,18 @@ public static WebLafSkin setDefaultSkin ( final String skinClassName )
*/
public static WebLafSkin setDefaultSkin ( final Class skinClass )
{
return setDefaultSkin ( ( WebLafSkin ) ReflectUtils.createInstanceSafely ( skinClass ) );
return setDefaultSkin ( createSkin ( skinClass ) );
}

/**
* Returns newly created skin class instance.
*
* @param skinClass skin class
* @return newly created skin class instance
*/
public static WebLafSkin createSkin ( final Class skinClass )
{
return ( WebLafSkin ) ReflectUtils.createInstanceSafely ( skinClass );
}

/**
Expand Down Expand Up @@ -242,6 +253,30 @@ public static WebLafSkin getCurrentSkin ()
return currentSkin != null ? currentSkin : getDefaultSkin ();
}

/**
* Applies specified skin to all existing skinnable components.
* This skin will also be applied to all skinnable components created afterwards.
*
* @param skinClassName class name of the skin to be applied
* @return previously applied skin
*/
public static WebLafSkin applySkin ( final String skinClassName )
{
return applySkin ( ReflectUtils.getClassSafely ( skinClassName ) );
}

/**
* Applies specified skin to all existing skinnable components.
* This skin will also be applied to all skinnable components created afterwards.
*
* @param skinClass class of the skin to be applied
* @return previously applied skin
*/
public static WebLafSkin applySkin ( final Class skinClass )
{
return applySkin ( createSkin ( skinClass ) );
}

/**
* Applies specified skin to all existing skinnable components.
* This skin will also be applied to all skinnable components created afterwards.
Expand Down

0 comments on commit 7c433b9

Please sign in to comment.