Jun 28 2014
News and v1.28 release
About news and site updates
As you might have noticed – it was a really long time since last post here, I were still releasing new library versions in background but I didn’t post here due to time constraints and since I didn’t actually find anything specific worth noticing. I have taken all that time to think about structuring information on the site better and improving the library itself. So today’s post will bring a few important news and v1.28 release notes.
If you were tracking GitHub updates you might have already seen some of this post parts in the README file on the home WebLaF page on GitHub, but this post contains some extended comments and notes, so make sure you don’t miss anything!
Let’s now continue to the interesting part…
Release notes v1.28
Unfortunately this release didn’t include some of features I was planning to do like WebInternalFrameUI revamp, WebDockablePane component, full styling support for buttons, scrollpanes, trees, progressbars and probably some others due to massive amount of changes which were already added into current version. All those planned features and improvements will be coming in v1.29 update in about a month from now on. So don’t be upset, I also need them badly for a few different projects so they will surely be there.
You can find the complete refactored list of the v1.28 update changes on GitHub, but I will point out the most important and exciting things in this post.
Project sources split into three modules
Its not just a cosmetic change as it might appear at the first glance – the whole library code and dependencies are now separated into three different modules:
- core – contains general managers and utilities which might be used separately
core is a standalone module - ui – contains WebLaF itself, all extended components and UI-related managers and utilities
ui module is based on core module - demo – contains WebLaF demo application
demo module is based on both core and ui modules
Apart from making the code more convenient and clean this structure allows using core features separately without dragging any UI-related stuff with it. It is actually very important in some cases since core contains language, settings, plugin and proxy managers which have proven to be very useful in our own server-side application which doesn’t have any UI and including the UI library there is a pretty bad thing to do. Hopefully this will be useful not only for our projects but for all WebLaF users as well.
In one of the future updates I will be also separating extended module from the ui module – it will contain all custom Swing components and some features that aren’t necessary for the basic L&F. This change will be made approximately in v1.30 or v1.31 update.
New artifacts and build
Since sources were split I have also revamped ANT build for the library. You might need to re-check which of the new artifacts you want to use since `weblaf-x.xx.jar` doesn’t contain dependencies anymore – `weblaf-complete-x.xx.jar` do instead.
I also wanted to make the whole project more transparent, clean and convenient, so I have made a few additional improvements.
First of all – two new artifacts available – weblaf-core-x.xx.jar and weblaf-ui-x.xx.jar:
- weblaf-core-x.xx.jar one contains some core WebLaF managers and utilities you might want to use separately from WebLaF UI
- weblaf-ui-x.xx.jar contains all L&F classes, extended components and all features tied to them
As I have described before – standalone core jar might be useful in case you have some server-side application and you want to use some features like `LanguageManager` or `ReflectUtils` but don’t want to drag a full UI library into your server or whatever else that doesn’t need/use Swing UI.
I have also modified the structure of weblaf-javadoc-x.xx.jar, which now reflects the sources structure and properly read by modern IDEs.
And last but not least – I have added weblaf-src-x.xx.jar which also has the same structure as weblaf-x.xx.jar but contains only source code.
WebLaF dependencies links are now available on home GitHub page and you can find their short description there which tells why and where it is used within WebLaF. According to that information you might want to exclude some of those dependencies in case they aren’t useful to you. I will add some more information later on if someone actually needs or requests it.
New ANT build description can also be found there, on home GitHub page.
WebDocumentPane
New custom component WebDocumentPane was added with this update. There is already a complete how-to-use wiki article about it so I will just add that this component is somewhat a complex replacement for simple JTabbedPane with various additional options and features you will not find anywhere else.
You try out this component in WebLaF demo application:
DragManager
If you already checked out the WebDocumentPane demo you might have noticed that dragged tab is painted above the interface when dragged:
This is the new awesome feature DragManager offers.
To put it simple – DragManager allows you to provide dragged data visual representation near the curson inside of your application windows bounds. To provide such representation you only need to implement DragViewHandler interface which should return DataFlavor of dragged data that should be represented by the view handler, BufferedImage as the visual representation and image (x,y) location relative to cursor.
There is a complete how-to-use wiki article with a few examples on GitHub – check it out if you want to see some working examples.
WebHeavyWeightPopup
After a long time I have finally found a good way to make use of Swing PopupManager potential without having to write loads of code every time – I am introducing the WebHeavyWeightPopup, Swing heavyweight popup shell class. It basically uses heavyweight Swing popup to create a tricky JWindow that has fixes a few issues simple JWindow has.
I am sure that some of you have noticed that in components which use popup windows like WebDateField a strange parent window flickering appears sometimes when popup is shown. That happens due to minor flaws in the Swing windowing system which causes temporary focus loss on the parent window. Unfortunately I didn’t find a way to fix that, but I have noticed that JPopupMenu and other component popups which use Swing PopupManager to generate popups do not have this issue due to some specific JWindow settings. So from now on I am going to improve all old components which use popups and fix that old annoying issue.
WebHeavyWeightPopup will also be a good base for various popups for some new components and features I am planning to add.
WebDynamicMenu
I am sure almost everyone saw such menus at least once, but I doubt anyone used or even saw them in Swing applications so far.
Let me show some examples right away:
This is just a few possible animation examples with the same menu items added but I am sure that some may find these menus attractive or even really useful for some situations.
You can also find a configurable example in WebLaF demo application:
And there is also a complete how-to-use wiki article on GitHub.
PluginManager
A new manager also appeared in v1.28 update – PluginManager. As its title says that manager main purpose is to load various application plugins, generally from separate JARs but they can also be added programmatically or even added from some other sources.
Although PluginManager is a WebLaF manager but it is totally different. It is an abstract class you have to override to create your own working PluginManager that will handle plugins initialization. It operates with Plugins which is also an abstract class which your specific plugins should extend. You can use PluginManager in any way you like – you may handle all your different plugins with single manager or create separate managers for different plugin types. You can load plugins directly or scan directories. You can also provide additional plugin filtering conditions, initialization checks and lots of other stuff.
There are also a lot of small features and options PluginManager has (and more coming with next updates) so feel free to try it out and implement plugin support in your own application with ease! 🙂
You will be able to find a complete PluginManager how-to-use wiki article soon on GitHub.
PluginManager is a core WebLaF feature and including weblaf-core-x.xx.jar is enough to have it working in your application.
Log
WebLaF and some other projects I am working with always suffered from garbage logger declarations here and there or simply missing logging where it was really needed. Before now there were almost no log in WebLaF – just a few separate places writing to System.out.
Since WebLaF itself is just a library and should be able to integrate well with other applications which might be already using some logging tool I have decided to use SLF4J API for WebLaF logging which is really flexible and can redirect the log into other popular logging tools with just a small amount of effort.
You can find the how-to-use wiki article on GitHub about WebLaF Log tool.
PopupMenuGenerator
And the last major feature introduced in v1.28 I will talk about is PopupMenuGenerator – it is exactly what its title says it is. It helps you to create standard Swing menus with minimum amount of code required.
I came up with its concept while I was working on a separate project that had loads of different menus for various trees, lists and tables. It actually reduces the amount of code required to create a menu by three or four times (or even more if you are using lambda expressions from JDK8) and makes the menu code clean and easily readable.
There is a complete how-to-use wiki article on GitHub you can read to know how to use it properly with ready-to-go examples.
Moving forward
Now I would like to make an important announcement – starting with v2.00 all WebLaF code will be refactored to make use of JDK 8 (or even JDK 9) language features.
Wait wait wait, don’t jump to hasty conclusions, read this announcement and see if all your questions and objections are answered or not.
At that point (when WebLaF 2.00 released) I won’t be implementing new features into older v1.xx version anymore due to time constraints I have. So all new features will be implemented only into the v2.xx versions, but v1.xx versions will still be supported for those who cannot upgrade for the certain reasons (unable to update their project to newer JDK, unable to force their clients to update to newer JDK or something else). So basically v1.xx will still be updated with critical bugfixes and probably some minor improvements which can be merged from v2.xx.
There are a few reasons why I have decided to move forward from currently supported JDK 1.6.0_30+:
- There are some bugs in older JDKs for which I have to make some dirty workarounds – I really want to get rid of those
- Older JDKs doesn’t have a proper support for newer OS versions which is critical for some features, components and projects
- I really want to make WebLaF code clean and readable and I want improve some parts of it with the new features newer JDKs offer
- I might be looking into JavaFX later on as a second option to the WebLaF UI part, but that will be much later
A lot of other projects I am working on are already using JDK8 and I can see the big difference. It is still a long way to go from current WebLaF state, but I wanted to make that announcement beforehand so everyone can consider it. Approximately WebLaF will be moved to v2.xx versions and will be updated to newer language level in the end of this year.
In any case – don’t worry, all the features announced for the v1.xx like complete StyleManager and WebDockablePane will be completed and available in later v1.xx versions. I am not going to abandon v1.xx and move them to v2.xx versions just because I want to.
Demo application
A lot of people have contacted me saying thanks for the library and specifically for “awesome demo application” I have made to present library styling, components and features.
It is true that demo is pretty nice and useful for those who are not familiar with WebLaF, but its actually a bit outdated and lacking flexibility. So I am going to replace it with a new and fully configurable demo application I am already working on for some time. It will be much more helpful for those who are not yet introduced to WebLaF and will also provide more options for “pro” users to discover all existing WebLaF features. I can now say for sure that it will be included into v1.30 version.
I don’t want to spoil what it will be like and what features exactly it will bring yet – and thats actually a topic for a large separate article I will be writing as soon as it is released. But be sure that it will be better, faster, prettier and will help you a lot to discover and bring all features offered by WebLaF into your application 😉
News and articles
As mentioned before – I had some time to think how should I structure and provide various information about WebLaF and I am have decided to try keep up with one scheme that seems to be the best of all.
Since each of these posts takes almost a day to complete and since I want to make these posts more meaningful and useful – I will be posting them here (on the site) after each WebLaF release with description of all important new features and changes (just like this post) made to the library with the update. I will also try to do my best and describe most important WebLaF features on GitHub wiki – feel free to contact me and ask for some specific detailed articles, I will surely add them!
I might also post some articles between the releases with interesting Swing “tips & tricks” I came up with while developing various WebLaF parts. These might be useful for those who really like Swing and want to know more about it. I will add a few such articles next week so stay tuned!
I guess thats all for today, hope you liked the update! 🙂
And once more – don’t forget to update to newer WebLaF v1.28 version!
Patric
Sep 01, 2014 @ 15:09:21
Will you add support for hdpi displays or selectable dpis some time?
Mikle
Sep 01, 2014 @ 16:35:58
I doubt it will be added anytime soon (and probably not even in 2.x versions).
It would require a lot of work and a lot of core modifications to implement.
So unfortunately it is not an option for now.
Jonathan
Aug 18, 2014 @ 08:28:46
Hello, i’ve got a problem with the languageUpdater this only happens in the version 1.28, if i switch to 1.27 everything is ok. But i need some components from the version 1.28:c
Can u please help me
Jonathan
Aug 18, 2014 @ 08:34:59
Well i resolve it, i haven’t installed weblaf as laf, but what was behind this solution?
Mikle
Aug 18, 2014 @ 14:46:24
It seems that you are doing something wrong, though I don’t have any ideas. I need a short and complete code example where it can be reproduced (at least on your configuration) so I can find out the source of this issue.
Mikle
Aug 18, 2014 @ 14:43:57
What code exactly causes this issue?
Since I cannot reproduce it anywhere actually.
Short and complete code example will be really appreciated.
Jona
Aug 18, 2014 @ 07:43:38
Hello, i’ve got a problem with the language updater of components , here’s a part of the error code:
This problem has ocurred me when using WebFileChoosers and WebDateField.
Mikle
Aug 18, 2014 @ 14:44:36
What code exactly causes this issue?
Since I cannot reproduce it anywhere actually.
Short and complete code example will be really appreciated.
Chris
Jul 04, 2014 @ 18:35:15
Hello,
Great stuff, I’ve been using JGoodies LaF now, but it looks better.
I have a couple questions before buying:
– is there some kind of decorated internal frame component with title (like “general project data” frame in http://www.jgoodies.com/wp-content/uploads/2012/04/Skeleton-Pro.png)?
– is there any wizard component?
– will be special prices for version 2.x for the buyers of 1.x?
Best, Chris
Mikle
Jul 04, 2014 @ 21:10:54
Good day!
Probably WebTitledPanel which will get upgraded in v1.29, but not sure what functionality you are looking for – just some pretty titled panel? or titled internal frame? or something like a titled dockable frame? There are a lot of options.
No wizards yet, unfortunately. I didn’t approach wizards as it seems to be a really broad topic – there are tons of possible wizards with different layouts and base components. I will be introducing them with later updates for sure, but so far it is only on the TODO list.
All users of 1.x commercial version will still get the 2.x commercial version for free (under the same license as they have for 1.x). So basically you won’t have to pay twice if you don’t wait until 2.x and purchase the 1.x library version now.
Chris
Jul 04, 2014 @ 21:46:48
Thanks for your answer.
I’m thinking about title, but with possible toolbar docked (I use it with tables and trees).
Maybe this screen will help: http://s8.postimg.org/8s99hgu85/screen.png
Great news about price of 2.x version.
Mikle
Jul 05, 2014 @ 13:17:10
Yep, screens always help a lot 🙂
WebTitledPanel with a custom toolbar on the right side of the title might do just the same stuff which shown on the screenshot. WebDockableFrame seems to be an overkill for this case if you don’t need to change titled panels placement and want to keep them at fixed spots.
Though if you ask me – I wouldn’t put a toolbar into the title in the first place, probably only 1-2 general buttons. And the toolbar would then go inside the panel – yes, that would take some more vertical space, but it will get the toolbar closer to the table/tree. Basically – saving up space not always a good idea as it might make the UI inconvenient which is much worse than wasting additional 20 px. But thats just some of my general thoughs on the UI composition – I might not know some important stuff about your UI and give a misleading advice in that case, so feel free to ignore it 🙂
hckr
Jul 02, 2014 @ 16:21:10
The icons in demo looks really cool. Is it yours? If so, are you planning to share that icon set. If not, could you please write where can I download this set?
Great job by the way.
Mikle
Jul 02, 2014 @ 16:35:29
WebLaF is based on Fugue Icons Set.
You can find it available here: http://p.yusukekamiyamane.com/
I will add the proper information about it in WebLaF with next update, good that you have reminded about it 🙂
And thanks for the feedback!
Jonathan
Jul 02, 2014 @ 08:36:34
Hello, i had a trouble, i can’t add any component from the library, there’s a problem with de Dynamic menu , help please
Mikle
Jul 02, 2014 @ 15:34:19
What exactly are you trying to do?
Some short code example that doesn’t work for you would save a lot of time.