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:

webdocumentpane

DragManager

If you already checked out the WebDocumentPane demo you might have noticed that dragged tab is painted above the interface when dragged:

dragmanager

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:

roll-roll          shutter-shutter          star-star

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:

webdynamicmenu

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!