|
|
||
Kirill Grouchnikov's BlogFebruary 2006 ArchivesSubstance 2.2 official releasePosted by kirillcool on February 27, 2006 at 01:57 AM | Permalink | Comments (2)Substance look-and-feel has reached the 2.2 release, with a lot of new features and a lot of bugs fixed. The list of new features includes:
![]() ![]() ![]() Multi-colored buttonsPosted by kirillcool on February 22, 2006 at 01:41 PM | Permalink | Comments (9)With the release of version 2.2 of Substance look-and-feel scheduled for this Monday, i have started to work on the next version (2.3 code-named Firenze). One of the things i wanted to improve are color themes, and a lot of work has already been done in this area. For now, i want to introduce the concept of "mixed" themes. Substance comes with eighteen core and twenty one plugin themes. The total is thirty-nine. By the end of the article you will see how after a few hours of coding this has been increased by 630 additional themes. Here is a sample screenshot of mixed themes and how they look like on buttons: The mixed theme is composed of two base themes. When some mixed theme is used, the resulting image is composed from these two based themes. The first 30% is the first theme, the last 30% is the second theme and the middle 40% is the blending between the two. Now, Chet has mentioned the concept of color distance. In the simplest computation, it's the Euclidean distance between the color components (red, green, blue). For the human perception, it's better to use hue-saturation-value scale or assign different coefficients to red-green-blue (as when RGB is translated to gray-scale). The examples above showcase some of the best matches distance-wise. They are not too close (so the two distinct themes are visible) and not too far (so the themes are not dissonant). The entries above are:
Here is a screenshot of the same themes ordered by simple Eucledian distance (shown as the button text):
Once you drop the theme-pack plugin in the classpath, the number of mixed themes increases from 122 to 630. Here is the screenshot of all available mixed themes ordered by distance (click to see all 630) - as you can see two themes that are two close do not produce the desired multicolor effects:
This is one of the reasons i prefer Java2D over image-based drawing (such as Synth-based LAFs). You need to invest a little bit more in the programming, but the outcome is much more generic - once a new theme is added to Substance, 20+ new mixed themes are available at no cost. In addition, once a mixed theme is set as Substance current theme, it is used for all controls (buttons, checkboxes, tabs, spinners, sliders, scroll bars etc). Think about the amount of work needed to be done for each Synth-based theme... The world of ferret hunters is really thriving lately. Sort ofPosted by kirillcool on February 20, 2006 at 01:56 AM | Permalink | Comments (23)Every time i read one of Bruce Tate interviews (the latest one is right here), i can't help but think that the ferret-hunters think that everybody else is hunting ferrets. I guess that's how the world looks like when you run a consultancy shop for mom'n'dad joints that can't afford their own ferret hunters. I mean, you have a shop that sells ferret-hunting equipment and a guy walks in. Chances are, he'll ask for the latest in ferret-hunting, right? Now, you know that there are other animals out there, and you have even spent a few years on a big ranch full of them. But the "man" didn't let you hunt other animals, he just gave you this big bazooka and told you to take those ferrets down. It took you four months to read the bazooka manual, to setup the launch pad and figure out that if you aim too close the ferrets just disintegrate and if you aim too far they just get brushed. Your friend hooks you up with a ferret-trap and in four days you have more ferrets than you have in your entire life. You then start writing a book. This book is full of examples. Every time you need an example from the hunting world, you randomly pick up an animal. Randomly, each time it's a ferret. After a few such picks, your readers are really intrigued - perhaps there are no other animals around? You seem to be so sure of that (at least it doesn't hurt the book sales too much). The random selection can't be wrong after all. You then present a wonderful choice of these great ferret-hunting tools and say that all the hunter enthusiasts are already using them to hunt ferrets all over the world. I guess they are, since the ferret-hunting frameworks are springing all over the place. All other animals must seem extinct by now. Somehow it is implied that these enthusiasts are hunting other animals with these tools too. Oh no, wait - there are no other animals around, haven't i said it already? A few months back Greg had took the words out of my mouth with his review of ferret-hunting beyondness. Now even Hani joins in against the ferret-hunting consultancy shops. Aligning menu items in Swing applications - welcome to the real worldPosted by kirillcool on February 18, 2006 at 12:53 PM | Permalink | Comments (8)When i have written the previous entry on aligning menu items in Swing applications, i was blissfully ignorant and thought that the life was good. Thankfully, one of the users of Substance has opened this defect with the following summary - "Menu texts are invisible in RTL orientation". Why, say you. What's that RTL has to do with my application? Turns out that there are four locales that define the right-to-left orientation (who should know better than me...), Arabic (ar), Hebrew (iw), Persian (fa) and Urdu (ur). Under these locales, the users expect their applications to be layed-out correspondingly. Swing core look-and-feels provide quite a good support for this: These two screenshots of Metal in Tiger and Metal in Mustang (you can see that Mustang properly aligns the texts, but fails quite miserably at aligning the accelerators):
The same problem with the accelerator alignment on RTL menus under Mustang is with the Windows LAF:
And what happens with the third-party LAFs you ask? Well, it depends. Here's a short chart of nine third-party open-source and commercial LAFs sorted by the degree of current RTL support in the menus (both under Tiger and Mustang):
Teach a man how to fish and you'll sell him your fishing equipment for the next five yearsPosted by kirillcool on February 15, 2006 at 12:24 AM | Permalink | Comments (6)Yesterday BEA has announced that the recently purchased SolarMetric's Kodo persistence engine will be open-source and available under Apache license. Hurray, you think, especially in view of statements such as "Right now, the focus is on supporting the JDO 2 specification and the EJB 3 Persistence specification and offering customers interoperability between the two specs. Both of these specifications are very close to being submitted to the JCP for final approval, and we would very much like to be right on the heels of the approvals with GA versions of Kodo and Open JPA." The one sentence shouldn't escape you, though - "We are not open sourcing the code related to JDO and JDO 2 as this will continue to be available for purchase from BEA Systems." (the bold is by me). And that has been the recent trend lately (I talked about Eclipse being the milk cow for board members about half a year ago) - give something basic for free (like JRockit VM) and charge for the tools. In BEA's marketing lingo it's called "blended" development (part open-source, part "give your top dollar to us now") - i wonder what happened to "liquid" (it hasn't been a year since it was announced at JavaOne 2005). And it's not only the big companies such as BEA or IBM. You can go from JBoss to JGraph and from JGoodies to Synthetica. Don't get me wrong - everybody has to eat, and everybody wants to make an extra on top of that. It's just that the marketing shows you only one side of the deal before you get hooked too deep. Karl Marx once said - "Sell a man a fish, he eats for a day, teach a man how to fish, you ruin a wonderful business opportunity". I guess we are seeing an emergence of a new business model in IT world - "Try to sell a man a fish, he goes Googling for free fish, teach a man how to fish, you'll sell him your fishing equipment for the next five years". The NetBeans look-and-feel competition winners are...Posted by kirillcool on February 14, 2006 at 12:06 PM | Permalink | Comments (6)Winners of NetBeans look-and-feel competition have been announced. Needless to say that I have been pleasantly surprised to see that 31 out of 33 winners have used the Substance module for NetBeans to create their entries (I really liked the entry of Cicero Zandona that used the same watermark as the desktop): All of these have used image-based watermark despite the fact that quite a few other watermarks are available. This makes me wonder - was it only for the competition, or do people really use image-based watermark in day-to-day work? Thanks to all that have used the Substance module - now i know it works under Linux, Mac and Vista :) Now it's time to give back - help test the release candidate of Substance LAF and all its plugins (including the NetBeans module). In addition, it would be nice to get additional translations for Substance. An unorthodox approach to logging in application serverPosted by kirillcool on February 09, 2006 at 02:52 PM | Permalink | Comments (3)A colleague of mine entered our room a couple of days ago and asked me this: can he open a Swing frame from the application server in order to view the request that he got (a pretty big XML string)? Sounds strange, right? So many reasons not do this:
After thinking half a minute about this, me and our GUI expert have started to think - perhaps the application server is not allowed to open Swing frames? But why not - it runs on the local machine, it has full access to the file system, it has full access to the DB. Most certainly you need much less permissions to open a frame. Surely if you leave this code in production it will open a few thousand frames (one per each request) and let the machine die happily, but that's not the point. The point is that this technique was suited very well to the particular problem, but it was so unorthodox that it took us quite a few minutes to agree that it should be possible to do. Eventually it turned out that there was no problem in opening a JFrame from inside an EJB implementation class. A little something to think about... Perhaps a look-and-feel for the EJB 3.0 :) Breadcrumb bar - from closed source to open sourcePosted by kirillcool on February 08, 2006 at 12:43 PM | Permalink | Comments (6)As mentioned in my previous blog entry, one of the reasons i have started the Flamingo project (release candidate February 13, release February 27, version 1.0 code-named Aoife) was the rather unexpected contribution from the commercial vendor (Rick Jeliffe of Topologi). On one hand, he paid money to his developers to make this component happen (back in 2003, way before Windows Vista integrated this component into Windows Explorer), on the other hand maintaining the code base and coping with look-and-feel issues must have been seen as an additional and unwelcome burden. By deciding to "offshore" it to the open-source community he not only serves his own interests (code maintenance, proper documentation, support for third-party look-and-feels, community coming up with ideas), but also allows the Swing developers to take this ready-to-use component and play with it in their own applications. So, without further ado, you are welcome to :
The BreadcrumbBar in the org.jvnet.flamingo.bcb is a Swing component that provides the breadcrumb bar functionality. The breadcrumb bar is a path of components. Each component has a selector with a popup menu. The breadcrumb bar allows easy navigation in tree-like structures (file system, XML stream) in a limited screen space. The following screenshot illustrates a sample application built with the breadcrumb bar. The application is a Windows Vista-like file explorer.
Breadcrumb Bar parts and functionality overviewThe above screenshots illustrates the following parts of the breadcrumb bar:
In addition, the breadcrumb bar allows easy backwards navigation in the path - use the mouse or the keyboard to select some particle. The path will be updated (the rest of the path is disposed of). A particle can have an associated icon that is shown in both the bar and the popup menu. The breadcrumb bar provides memory functionality, allowing adding the current path to the memory, going back and forth through the memory paths (the selection is updated automatically), saving the memory to a stream using XML-based format, loading the memory from XML-based stream and clearing the memory. The breadcrumb bar uses application-supplied callback to retrieve a list of root particles and child particles. In addition, it allows registering a listener on the following events:
| ||
|
|