Showing posts with label open source. Show all posts
Showing posts with label open source. Show all posts

Friday, May 01, 2009

DesignGridLayout: where do we stand?

It's been a long time I haven't blogged on DesignGridLayout. Several events have concurred to this lack of communication:
  1. I have bought a brand new notebook (for those interested: that's a Sony VAIO Z)!
  2. It's taken me a long time to have DesignGridLayout tests run on both my old notebook (Windows XP) and my new one (Vista)
  3. I have plaid with Hudson on my old notebook to setup a continuous build for DesignGridLayout
Now that all that works (after a lot of pain for the second point, and thanks to the active help of Alex for quickly improving FEST "specially" for me), I can finally resume my work on the project.

Where do we stand?

Version 1.2, which I am currently working on, shall have the following features:
  1. alignment synchronization of multiple panels (all using DesignGridLayout): particularly useful to make smooth panels transitions in Tab panes and Wizards.
  2. optional consistent baselines spacing between consecutive rows (only for fixed height rows).
  3. addition of a new API to notify DesignGridLayout of special components behavior with regards to vertical resize.
For these features, I have already made a big refactoring of the source code.

Enhancement #2 above is already implemented in Subversion trunk, here are 2 screenshots comparing the same layout with and without consistent baseline spacing, respectively:

Note the consistent spacing between labels baselines for all rows but the second one (because it has variable height) and the last one (because it has an emptyRow() before it to visually separate that row from the previous one).

Without consistent baselines spacing, all vertical gaps conform to the values provided by the installed look & feel, but due to different heights of components and different vertical gaps, the inter-row spacing doesn't look consistent and is not very eye-friendly (this is particularly true when observing the column of labels).

Regarding synchronization of alignments between different panels (enhancement #1 above), the following screenshots help showing what works today (excerpts from DesignGridLayout automatic tests).

The example below is a dialog with a tabbed pane, embedding two different tabs. The first 2 screenshots show both tabs, built with DesignGridLayout, without synchronization.

Please note that there are no horizontal or vertical alignments between both tabs, this is particularly noticeable when running the application and changing from one tab to the other.

Now, let's add just one line of code to the layout building code, as follows:
Synchronizer.synchronize(layout1, layout2).alignGrids().alignRows();
Then the screenshots become different (note that I have put the 2nd tab both on the right side and on the bottom of the first tab so that you can easily check alignments in both directions):

You can notice the alignment of the origins of both columns of fields, and you can also check that all rows baselines from both tabs are aligned with one another.
This example is particularly interesting due to the use of Java -default- Metal look & feel, in which different kinds of components have different heights (compare the heights of JTextField and JComboBox); other look & feels may have consistent heights for all components, which would not show the difficulty of aligning each and every row from one tab to its matching row in the other tab. I am not sure other LayoutManagers can do that, I haven't checked yet though.

Back to DesignGridLayout V1.2 schedule, I still have some work with:
  • baseline synchronization
  • new API for vertical resize behavior customization (point #3 above)
  • layout calculation optimization (avoid multiple recalculation)
For DesignGridLayout 1.2, I plan to release a beta with new features and the new API so that I have time to polish it before a release candidate. Here is the expected schedule:
  • End May: 1.2 beta 1 out, beta testing will last one month
  • End June: 1.2 rc 1 out, followed by final release after 2 weeks (or 2 weeks after latest rc if bugs are reported)
What's next?

Later, for V1.3, I foresee enhancements to non-grid rows API & functionality:
  • possibility to separate 2 components with unrelated gaps
  • smart positioning of standard buttons (OK, Cancel...) based on the runtime platform
  • make component sizes consistent across several rows (currently, sizes are consistent inside individual rows only)
It's hard to predict what a release date could be, but since I don't see too much complexity in these features (but as usual, the difficulty will be in finding the right API for them), I think it should be possible to have a first release candidate less than 2 months after final release of V1.2, around September-October.

Sunday, February 15, 2009

Announce: DesignGridLayout 1.1 released!

Two weeks after the fourth release candidate of DesignGridLayout 1.1 (1.1-rc4), I have decided to release the official final 1.1 release.

Compared with previous official 1.0 release, this version brings the multiple rows span components feature, in addition to a few enhancement and bugs fixes:
  • fixed several problems with baseline alignment (only on Java 5): issues #3 and #27
  • fixed a problem with smart vertical resize of JList (issue #28)
  • fixed an exception with multi-grid feature (issue #26)
  • fixed an exception when creating a row but adding no component to it (issue #30)
  • fixed a bad look with grids having just a label but no component (issue #31)
  • optimized the size of the example jar (removed all screenshots that are used during automatic tests)
  • completely refactored the examples application
  • added an option to disable "smart vertical resize" feature (issue #34)
Now I can go back to work on next release (1.2). Future version 1.2 will have two major features:
  1. Synchronization of several layouts: with this feature it will be possible to ensure correct alignments (vertical or horizontal) across several panels using DesignGridLayout. This will be particularly useful for use inside JTabbedPanes or in Wizard dialogs.
  2. Extension API to customize policies related to components vertical resize (the current -internal- policy recognizes only vertical JSliders and JScrollPanes as variable height components, but some users have expressed the need to recognize also other specialized components)
First enhancement is on the way but will take some more time since it is a quite complex feature. I intend to release a 1.2-beta with this feature only, for users to check if it fits their needs well in synchronizing alignments. 1.2-beta is expected by mid-March if I can progress well.

If you're not afraid of using a "work-in-progress" version, you can get it from Subversion trunk, build it according to the instructions on the web site, then take a look at the new Synchronizer class.

I hope to have a first 1.2 release candidate by end of March or early April.

Thursday, February 05, 2009

Why I do open source and how I came to it

As prompted by Alex Ruiz (himself prompted by Kirill), I will explain in this post my reasons for doing open source.

But as a way to explain my motivation, I will draw a history of my involvement into open source.
I have to admit that remembering that history was not easy, thanks Google I could find quite a lot of facts I had almost forgotten about my own past;-)

Let's start with my first projects, actually never open sourced, some even never released "in the wild"!
  • ObjectBase: never completed (only reached specification stage in 1993)
  • EasyMage: released in 1994 (C++, MacOS, shareware actually, source code never disclosed). At that time I developed this application as a passionate. And as a dreamer, I also hoped making some money out of it (IIRC, I did not pass over 100 licenses sold;-))
  • SCADA (C++ & Java 1.2, around year 1997-2000): never released. But this project helped me a lot learning Java along with CORBA.
  • CORBA WhiteBoard (Java 1.4, around years 2000-2003): never released. But this project gave me more experience with Java Swing. And more impotantly, it has served as inspiration roots for my second Open Source project, HiveBoard.
All projects above have brought me a lot in terms of pure technical knowledge (C++ & Java languages, CORBA technologies, Swing GUIs). However, the whole process to implement these projects was quite awkward. Open Source has helped me getting more "professional" in the whole software lifecycle (in particular in the areas of automated testing, planning, issues management).

Now let's go further into my progressive involvement into Open Source. First of all, all projects above were developed with a spirit of "implement everything from scratch" (the DRY principle did not really exist in these times;-) and using only little third-party -open source- libraries)

My first involvement in Open Source can be traced back to 1999, it was quite limited: I have reported bugs to the omniORB library and then contributed some answers to questions in the forum. I also evangelized omniORB to my students in 1999 (I was a part-time IT professor in Vietnam at that time).

This may not look much but actually, this is very important in Open Source: contribution doesn't have to be just committing code, but also using open source code in your own projects, reporting problems, suggesting enhancements, helping other users when you can, evangelizing the products you use and like...

At that period, I have also contributed problems reports to ORBACUS/Java (which was open source at that time).

Then, much later on (mid 2004), at this time Spring started to take off seriously, I was interested in Dependency Injection but hated Spring because of its too verbose XML configuration. Then I discovered HiveMind (it was in beta at that time) and found it much more interesting than Spring. However, it was lacking all that Spring had which is not DI-related (integration with persistence libraries in particular). I found HiveMind so good a DI framework that I wanted to evangelize it, but it always failed in comparison to Spring because of the lack of 3rd-party integration. That's why I decided, late 2004, to start HiveTranse my first OSS project. Unfortunately it seems it didn't help wider adoption of HiveMind. But at least it has served me to start my second OSS project, HiveBoard, at the end of 2004.

Both projects have really absorbed my time during several years and they have helped me improving my skills in:
  • Java technical area: I started to get acquainted with Hibernate, iBatis, securityfilter... I also worked with useful products like Tomcat and Jetty.
  • Software lifecycle process: I have learned to use tools to help me build (ant, el4ant), and test (JUnit, jmock, dbunit, abbot). I also got used to managing issues. I had to perform quite a bunch of efforts in terms of documentation (good for changing a "standard" developer's bad habits;-))
  • Soft skills: when you commit into Open Source, you have to be careful about not growing too big an ego, and rather be humble towards the mistakes you make (and the remarks you get about these mistakes). You have to listen to what others tell you and accept criticism on your project. In other words, you have to "open up", this is one quality I believe I have grown during my Open Source years (although I am far from perfect to this regard;-))
More recently (mid 2008), I have joined the DesignGridLayout project. The reason why I did so was that because I found this library excellent, I had started to use it in HiveBoard, and I wanted to "give back" some of my efforts to the community, from which I had already benefited a lot (I would be very embarrassed to enumerate the exhaustive list of OSS libraries and tools I have use in the past 10 years).

What I have learned from DesignGridLayout is:
  • how to design a good API (I believe)
  • how to "market" the project (although the results don't seem compelling so far)
  • how to keep my cool (or at least, try to;-)) when facing some "attacks" from other people
I consider the third point important because, although Open Source contribution is generally very rewarding, it can also bring you some problems you would never have imagined. I consider it a positive point however: most often, attacks arise from some fear of competition, which in a way means that what I have done so far is probably not too bad;-) Anyway, I believe the only response to attacks is "go ahead, don't listen, try to do better and show it".

To sum up with the reasons I do open source:
  • learn more about new technologies (very important in our profession where technology evolves at a fast pace) without any external constraint (you can choose the latest "cool stuff" to try and integrate in your work)
  • learn more about tools to help the release management process (these tools I can later on push them in a professional environment in my daily job)
  • give back to the community what the community has given me
  • hopefully help the others by giving away something you consider useful to other people
  • get some visibility (open sourcing the projects you originally used for yourself brings some extra "cost" in terms of time, so you definitely want to have these efforts "paid back": the reward here is the kind comments on your projects, the bugs reports, the suggestions for improvements...)
  • get some "technical respect" in my daily job (engineers in my company respect me, not just because I'm older than them and I am their boss, but because they can see that I have a proven record of technical background and I am not just a stupid manager who understands nothing to software development)
To summarize further I could reduce this to just one word "Passion" of everything related to IT (not just coding but all tools and practices around software engineering).

Actually I think that's not very far from what Kirill and Alex have mentioned: such a long post to say the same as others already have! Promised, next time I blog I'll try to talk only about new stuff;-)

For those who have read until there to see who would be the next ones to be prompted for the reasons they do open source, sorry guys, you have read all my prose for nothing, I have nobody left on my list (or contrarily I have potentially too many to enumerate);-)