- Overview -

SourceForge.net Logo
..:: Concept ::..

UIHierarchy is a library that facilitates creation of user interfaces. The main idea is to enforce the mental picture of the containment hierarchy of GUI components by writing the code in the same logical way. Code gets much easier to understand, much shorter, and easy to maintain. Additionaly, UIHierarchy can manipulate resulting components hierarchies in a powerful way.

For a quick jump to the manual to see a short example, please click here.

I love Swing, but I must admit that when it becomes complex, code tends to be less readable and harder to evolve. But pieces of software are meant to evolve, so it goes against that rule.

After some investigation on existing libraries and tools, I found the interesting Pnuts Layout and its relative the hierarchical layout. After playing with it, I quickly noticed some limitations and flaws. So I dicided to make my own library using the main principles, but without those limitations.
UIHierarchy is the implementation of my researches on the subject. It took some time to obtain a nice implementation, but now the code and the functionalities are really stable and mature.

..:: Features ::..

First, this library works with Java 1.1 and later. It makes use of existing facilities without hiding them.

It greatly simplifies the use of layout managers and exposes the containment hierarchy in the code as a hierarchy.

Due to the hierarchical nature of UIHierarchy, the library provides ways to manipulate the levels of the resulting hierarchies, like adding/removing new levels or enabling/disabling many components at once.
It also adds capabilities like the use of units (centimeters, dlus, etc.) in addition to traditional pixel handling.

The license terms are LGPL 2.1.

..:: News ::..

March 6, 2005: UIHierarchy 1.2.5 is out!
Units are now supported. You can now use centimeters, dlus, and so on on existing layouts. This release also fixes some bugs.

The distribution package is changed. There is now a single distribution, which contains the library, documentation (javadoc, manual) and the demo program, as well as the sources.

February 28, 2004: The release 1.2.4 is out!
This release adds some functionalities to accessors such as automatic support for multiple enabling/disabling conditions (really great!). It also fixes some bugs.

Some commercial projects are using UIHierarchy with great success! Their GUI code is smaller, cleaner, and easier to understand and maintain. It is good news that other people than just me find the library to be useful.

January 25, 2004: The release 1.2.3 is out!
This release adds support for the JRE 1.1, and brings facilities to easily use the ExplicitLayout (http://www.zookitec.com).
Additionaly, UIHierarchy provides more debugging facilities.

This release is cut into different jar files: one that contains everything, and some smaller subsets. Nevertheless, the full library remains really small! License terms are changed from Sun Public License to LGPL 2.1.

January 5, 2004: The release 1.2.1 is out!
It is a major release, and may be incompatible with some programs made with the earlier release. It removes UIHierarchy and XmlUIHierarchy, replaced by UIH and XmlUIH.
Now configuration is centralized, and levels of the hierarchy have some accessors to manipulate it.

I also updated this website and changed the documentation. It contains a demo that you can download, some nice explanations and a manual.
So, check it out!

December 1, 2003: The release 1.1.2 is out! Internally there was a bit of change to allow more flexibility for constraint handlers. Thanks to this refactoring, the gridBagLayout constraint handler is now able to use some constraint inheritance.

I also removed some deprecated API. I considered it was adding clutter and did not harm much to remove it.

November 10, 2003: The release 1.1.1 is out! It is a complete refactoring. A new class appears: UIH. This class is now the central class, and UIHierarchy is using it. This new class provides more enforcement, and should become the preferred way.

I changed some of the API naming, so some methods are now deprecated (but still working). I also added plenty of small features to allow extensions to current behaviour, and more layout handling.

October 21, 2003: The release 1.1.0 is out! It changes some of the API, but adds many interesting features. It supports the SpringLayout for JDK 1.4 users for example.

I also made a (big) screenshot that compares two implementations: one traditional and one using the UIHierarchy library. I think it shows quite well how useful the library can be.

October 14, 2003: The release page, containing already a short documentation, now also contains an example with different possible implementations.

October 12, 2003: I added more features. Now getting the container when the hierarchy is completed will return the root container. It is also possible to print the hierarchy when it is completed, or ask for the component that was last added.
I changed the XML hierarchy so that it uses NanoXML instead of Xerces, as it is much smaller (6K only)

October 08, 2003: More work on the documentation side. It is short but hopefully gives the direction to follow when using the library.

October 07, 2003: I have started writing some documentation. You can start reading it, but it is not yet complete.

October 06, 2003: This is now the page for a new project: UIHierarchy. welcome!
I will provide some documentation explaining how to use this library soon. Just be patient...

Web site designed by Christopher Deckers
Any questions, suggestions, job offers at