Ph: 20080204

[image] About me

Java.net profile

View Andres Almiray's profile on LinkedIn

ohloh profile

View aalmiray's profile on slideshare

Twitter Feed FriendFeed

Currently reading:

Programming Groovy - V.Subramaniam Beginning Java SE 6 Platform - J.Friesen The Story of the Irish Race - S.MacManus NFJS Anthology 2007 - N.Ford et al Groovy Recipes - S.Davis

[image] Recent Entries

[image] Tags

[image] Subscribe

Subscribe in Rojo

Add to Netvibes
Add to Google

[image] Projects

[image] I Recommend

GetJava Download Button

No Fluff Just Stuff

[image] Blogs I read

[image] Search

[image] Categories

[image] Monthly

« September 2008
Sun Mon Tue Wed Thu Fri Sat
 
1
2
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
       
             

[image] Badges

[image]
[image]
[image]
[image]
[image]
Add to Technorati Favorites

 

Locations of visitors to this page
changelog,download]

I haven't given a full review to this release yet (hot from the oven a couple of hours ago!) but skimming through the release notes I noticed this gem
support for easy custom uis/layouts using abeille form designer (this replaces previous autolayout mechanism based on abeille; it didn't work very well; docs and examples to follow)

I have to try that! Abeille Forms Designer is a GUI builder for Java applications, that leverages the power of JGoodie's FormLayout.

Congratulations to Eitan for his continued efforts in pushing the limits with JMatter, also to all contributors (there are two user submitted patches in this release!) and other JMatter users that have provided feedback. Keep those messages coming!

announcement java jmatter release
JMatter 20080627 has been released [
changelog,download]. This release includes many new features and enhancements, particularly to the calendaring/scheduling behavior of the framework. But there is also another exciting feature, standalone services.

JMatter follows the NakedObjects design pattern, meaning that every domain object should be responsible for its behavior and be behavior complete. But what happens if some requirement can't be tied to a particular domain object? you will require then the well-known service layer, which is exactly what this feature provides. Now you are able to extend your application with "domainless" commands, as shown in the next picture, where the "Say Hi" button is a command exposed by a ServiceObject class (it may have any name you want)

[image]

I'm hoping that the UI can be tweaked further into toolbars. Design pattern purists may consider this a step backwards, but actually it is a very useful feature, so useful that the Relevance guys decided to add something similar to Rails (SimpleServices plugin), inspired by Grail's service facilities.

announcement java jmatter release
JMatter 20080409 was released yesterday [
I've been so busy lately customizing my Linux machines that I missed the fact that Eitan posted the latest JMatter release 5 days ago, you can see the changelog here. Among other things you will find a new feature based on AnimatingCardLayout (as described by JavaJeff in this article). The following pictures don't do justice to the runtime behavior, but you can clearly see before, in between and after states once you click on Edit, if you click on Save/Cancel you'll get the reverse animation.

Before
[image]

Clicked on Edit
[image]

After
[image]

And here is the Map feature I talked about in a previous release, the Address domain class exposes a "View on Map" command, which will popup a new window using JXMapKit (from swingx) to render the map. Notice that Eitan has taken care of properly setting an overlay painter that draws a balloon with the address' info.

[image]

[image]

java jmatter release
Eitan just posted a new release of JMatter (release notes). There are a couple of new features like autologin (nice one) but the most exciting one has to be the Application Browser, which will let you launch any JMatter-enabled application with the click of a button.

java jmatter release
Eitan made the announcement a couple of hours ago, the latest version of the JMatter framework is available, ready to be downloaded! Here is the link to the changelog.

There are many interesting features, the most notable ones (IMHO) are
Quicksilver-like interface to invoke commands and navigate around your application, it just feels natural!. Per command icons, which are a great tie-in with the quicksilver interface Initial map support thanks to swingx components, here is a preview from a couple of months ago. Support for legacy database schemas, no need to reinvent your existing db in order to use JMatter. A pair of builders (1 Java, 1 Groovy) to facilitate creating wizards (previewed here). Last but not least, initial support for an Application Browser, which in short is an application launcher capable of keeping up-to-date the downloaded apps (think webstart without the hassle).

Thanks to everybody that contributed pacthes/ideas!

If you haven't seen JMatter in action please take a look at the webstart demo or this screencast.

announcement java jmatter release
No I'm not talking about Harry Potter and their ilk but one of JMatter's many features, that's right, wizards that let you configure your domain classes in an easy way. If you're into Java desktop programming you owe to yourself to take a look at what the framework has to offer (hint: check the latest article by Eitan). Alright on with the topic, before the feature I'm about to introduce, the way to code wizards was pretty straight forward but as your domain class grew so did your wizard code, and it lend itself to repetition, as we are against DRY, DomainWizard was born.

This little guy will let you build a wizard in a breeze and at the same time opens the door for customization without changing a line of code. All of the labels and descriptions are pulled from the domain class metadata and a resource file, simple, easy, agile!. Let's see an example with a before/after approach, this is what a normal wizard used to look:

Direct to the point but notice that each composite attribute requires similar setup, surely we can do better than that, let's see DomainWizard (the after way)

Notice it only takes 6 lines in average to do the same (albeit some lines in a properties file too). Notice also that the keys in the properties file follow a naming convention, which will help you configure properties with the same name belonging to different classes.

JMatter's wizards are a little bit more sophisticated that what we have seen so far, DomainWizard is only useful for building domain classes following the same recipe. But what if you require a different set of steps or perhaps conditional steps? JMatter provides those steps already but Groovy can help make the job easier don't you think? thanks to the power of builders we now have WizardBuilder. Let's see how the previous code looks with WizardBuilder in place

Just to show how conditional steps are declared let's pretend that the first two steps should belong to a group and if those steps are fulfilled then we can proceed to the last:

There are more ways to configure steps, specially the commit one, but that info belongs in the JMatter manual (note to self, get back to writing that stuff ASAP). You will find these and other exciting features at current SVN head, Eitan has been busy the last weeks but expect a new release in the following weeks (hopefully days ;-)). Oh and by the way, there is a really sweet surprise that Eitan managed to squeeze in, let's just say for now that it will surely put JMatter "on the map" ;-)

groovy java jmatter swing
OnJava.com has published a new article on JMatter. Eitan used a tantalizing example this time, a JavaOne conference manager. It includes code listings and a step by step guide on the features used by each listing, but the best is yet to come, it includes a long (amazing) screencast running the manager application. It shows off many features available just by following the conventions of the framework. Go check it out, you won't regret it ;-)

article jmatter
I went back to the Guessing Game example but this time I went with SwingBuilder. The idea of this experiment is to compare both versions and discover any improvements for WingSBuilder. First let me show you the resulting images, the first one belongs to wingS on FF, the second one is swing on WinXP
Guessing Game (wingS)
Guessing Game (Swing)
So how do the code looks? again first the wingS version then the swing one
WingS version:

Swing version: Let's see, besides the builder initialization, border and font (which still look very similar to me, kudos to the wingS team for that!) the code that does the building only has one difference (not bad, right?): the top node added to the frame. In the swing version a panel is used, but in the wingS version a form is needed. So what can be done to have two identical building closures? I think that WingSBuilder can be smart enough to insert a form at the top of the hierarchy if there is none declared in the structure, this automatic form should be the first child of the frame; thus allowing the wingS version to have a panel instead of form making it an exact copy of the swing version.

But why would it be important to make the two building closures identical? imagine for a moment that you have a successful swing application and then comes a requirement for making a web version of it... what do you do? if your swing application is built with SwingBuilder, then it would be a simple matter of switching builders, locate all fonts, icons and resources and switch them to the wingS system (or write an abstraction layer for accessing and cache them for both view systems) and finally add a webapp configuration. Amazing right? in fact this is one of the goals of JMatter (which I will inspect further). If using SwingBuilder for making custom JMatter views is possible, then the same could be (and I hope it to be) said about WingSBuilder, eventually making the code easier to understand and lowering maintenance on two separate views.

Keep on Groovyng!

groovy jmatter swing swingbuilder wings wingsbuilder
A couple of days ago I discovered ZoneLayout from Attic Labs LLC, which is a simple, intuitive, powerful, source-code-based system for designing Graphical User Interfaces, currently with an implementation available for Java Swing.

One of the goals of ZoneLayout is that as developer you can have a glimpse of how is the UI going to look just by observing the pattern of the layout rules, for example the following image taken from Using SwingBuilder in JMatter's views
jmatter+Groovy
JGoodies FormLayout was used to create the Address panel, the coordinates were already calculated by Eitan when he created the demo-app, the code looks like this

Unless you have expended a lot of time coding coordinates with FormLayout its hard to imagine how the UI is going to look, now for the ZoneLayout version

Granted, the coordinates in ZoneLayout look like an alien language at first, but after you read the manual and play with it for a while you start to see the order amidst the chaos of characters. So what do we have here...
lines 1 & 2 define a template which has one zone each: zone l and zone t. Each zone will expand to its horizontal limits. A template is a zone or groups of zones that can be reused as many times as you want in the same layout. Because Line1 and Line2 have the same view structure it makes sense that we use templates. line 3 defines zones z, s & z for the "City", "State" and "Zip" labels, also marked as a template (boxes). Each label will be left aligned and a gap of 12 pixels (preset 3) will be inserted between labels. The boxes template will be reused to insert the actual editors tied to each label.

Templates are taken out of the equation when you start laying out your components, so you must insert them explicitly. Notice how each templated row is inserted before adding components, and that the constraints property now has the name of each zone.

The project site has a comparison of FormLayout vs ZoneLayout and I must say that it raises some valid points when working with a typical Form based UI design. So if you like to do your layouts by hand and sometimes get tired of calculating number coordinates with FormLayout, give ZoneLayout a try, its easy to learn and it has a small memory footprint.

Keep on Groovying!

groovy jmatter layout swing swingbuilder
On July 18th Eitan released a new version of JMatter, which includes many improvements and support for forms created with Abeille Form Designer (more on that later), but there is also another feature currently in svn that will give you more freedom in the regard of what a command may return. JMatter commands may return 3 values, handled by the framework as
String - will display a short message (like Growl in MacOS X) DomainClass - will display the view that belongs to that class View - will display the view as is
But now we have a fourth option: JComponent, when one is returned the framework will automatically wrap it in a generic View, relieving the developer of creating such a view. There is already demo-app bundled with JMatter (Self) which has a command that will display a JPanel with animations, so I thought that it may be great to test the fourth option and what better way to do it by embedding Google Maps support into the app, don't you think?

JMatter comes with another demo-app called Sympster, which is a Symposium Manager, modeled after the format of the NoFluffJustStuff Symposiums; each Symposium has a Venue, a venue may be a Hotel, a Conference Center or a Campus. As it currently stands a Venue only has a name and a list of rooms, we're going to add an address so that we can map it. We're going to use Groovy for the view because it is so simple to create custom UIs by hand with it (see previous post) and also because configuring JXMapViewer with it is pretty straightforward, as Guillaume Alleon and Guillaume Laforge show here and here.
Download a copy of JMatter from svn (http://svn.jmatter.org) Copy the Address class from demo-app/CustomUI to demo-app/Symspter
We could have used a built-in type (USAddress) but we'll stick with this one for the time being
Modify Venue, adding an Address field, some metadata and the command that will launch the Map

You'll find more info on the framework's metadata here.
Modify Address, adding a custom toString method which will be very helpful when translating the address into geo coordinates
Let's create the view, because any JComponent will be wrapped into a generic view we can extend from JPanel or JXMapViewer directly. Looking for more information on how JXMapViewer could be customized I found JXMapKit which will also display Waypoints (this little red & blue markers you can see on Google Maps when searching for an address), so I went with it
Before compiling the app, we have to do a little hack. JMatter bundles two different versions of swingx (2007_02_15 & 2007_06_17), unfortunately for us, the SwingX team has made some changes in the api that make those versions binary incompatible. Exchange swingx_2007_02_15 with swingx_2007_06_17.jar on modules/ds-swing/lib, compile it and make adjustments. It turns out that com.u2d.ui.desktop.MsgPnl$MsgPanelPainter should now implement doPaint instead of paintBackground, so its just a matter of wrapping one over the another, recompile and copy the new ds-swing.jar into jmatter/lib/runtime Don't forget to add the required libraries into Symspter/lib/runtime, download the 2007_06_07 version of swing-ws (includes JXMapViewer), put the swingx-ws.jar, and all co-bundled jars (except json.jar, it's already included by JMatter) Because we're using a custom view with Groovy, and the domain class references it but its coded in Java we'll need to enabled the joint compilation, which is explained here, substitute the javac call on the compile target with
We're ready to compile and test the app, type 'ant schema-export run' and if everything is ok and after a bit of JMatter magic... you should see a login screen, type in admin/admin as user/password and we're in!
Create a new Venue, right-click on the Venue icon and select 'New' on the menu Select a venue type, I went with 'Hotel' Fill up the venue data, notice that there are two tabs, the second one being the address of the venue. I configured the Hotel with the addres from the G2One meeting that took place this year. Save it and notice that a new command 'Show in Map' has appeared, click it and you should be able to see the address mapped into Google Maps
JMatter+GoogleMaps

Because it is a generic view, it doesn't have a title nor a custom icon. There may be an option in the future to do just that, perhaps with clientProperties or with a properties file. The point is that we concentrated our efforts on modifying the Model and provided a custom view without having to merge the view with the framework itself. These type of views may come in handy when doing quick app prototyping and then when the design has been approved you can get fancy with icons, colors and custom names & labels.

Keep on Grooving! and don't forget to stop by JMatter if you're into form-based business applications on the desktop :-)

groovy howto jmatter swing
It's been a while since I played with JMatter and Groovy, now that a new beta (1.1.-BETA-2) is out I knew it was time to give it another look. Some of the stuff shown here is only possible thanks to the new features available in Groovy.

The point of this post is showing how to create a custom JMatter view using SwingBuilder, which in theory, ought to help us expose the UI structure in a more human-readable fashion and eventually get rid of duplicated and redundant code. The first step is getting the latest JMatter version from the download page (I used the February release so I need to upgrade) and unzip the distribution in a working directory. Next step is creating a sample project, change to the JMatter distribution dir and type 'ant new-project-ui', this target will build all the jars you need to run JMatter and eventually popup a new window where you can specify the project's settings, I selected the 'standalone' option and clicked OK, all files and dirs were generated and we're good to go.

On a closer inspection in the generated project dir you can see a rather surprising file 'build.gant' which means that Eitan has been busy looking at Gant, great news! ahem... let's continue shall we? I'm going to cheat a little and copy the source and resources of the demo app 'CustomUI' that comes with the JMatter distro into my project and proceed to create a GroovyCustomAddressView like so:
This view is basically the same as the original but it uses SwingBuilder to layout the components, you may also notice that semicolons and casts are gone, as well as the 5 variables referencing the Adress's dependant views defined in the original View, because now those are going to be retrieved via SwingBuilder's variable mechanism. Note that the view itself is a JPanel and that the builder takes a reference to view as its value, this is one of the new features available to SwingBuilder in 1-1-beta-2. One last thing before finishing the code is modify the Address class to return a GroovyCustomAddressView instead of CustomAddressView and we're all set.

Here comes the tricky part, because Address (coded in Java) references GroovyCustomAddressView (coded in Groovy) which in turn references Address we need to enable the joint compilation of Groovy & Java as described at Jochen's blog, open the Ant build file and substitute the javac call at the compile target with
The last step is adding the required libraries to the classpath
in lib/runtime
groovy-all-1.1-beta-2.jar
in lib/tools
ant-1.7.0.jar ant-launcher-1.7.0.jar commons-cli-1.0.jar
Everything is ready to test our new Groovyfied view, invoking 'ant compile schema-export run' should do the trick. I found that you have to specify 'schema-export' the first time the app is run. Login with admin/admin and create a new Contact, this domain object has a property of type Address, click on the 'Address' tab and you should see the new custom view, very similar to the next screenshot
jmatter+Groovy

Keep on Groovying!

groovy jmatter swing swingbuilder
JavaOne 2007 is over and I realize its been a year since I started blogging here. I decided to gather a list of the most popular posts, some of which bring back a lot of memories. The statistics where taken from Google Analytics, I started to use that service since JRoller stopped giving daily hits, about November 2006, the list was exported as a csv file and processed with Groovy, following GINA's example on word frequency.
28/Dec/2006 DbUnit 2.2 is out!
Following the announcement made by Felipe Leme on the user list, this post mentions the official inclusion of IDatabaseTester.
29/Jan/2007 Brico: a framework for building swing apps
I was totally surprised by the amount of pageviews this entry generated, it reflects the fact that Swing developers are very interested on such a framework. Unfortunately, Brico has fell into a dormant state, but the good news is that we have JMatter and (recently) Clarity
04/Jan/2007 Flex2 vs Prototype benchmark
This entry outlines a simple test I did between Flex2 and Prototype, no optimizations, Flex2 seemed to have a little advantage over Prototype.
22/Mar/2007 Swing frameworks: why JMatter matters
In here I expose my thoughts on JMatter after seeing a very compelling presentation by Eitan. JMatter's ease of use and potential are the reasons why Brico has gone dormant for the time being.
14/Jan/2007 Another surprise from Log4J
Two things about the source distribution of Log4j: it doesn't include tests, it has switched to maven.
15/Dec/2005 Nice source code syntax highlighter
This entry gives some links on Alex Gorbatchev's syntax highlighter and includes a Groovy style made by yours truly.
26/Dec/2006 Spring Remoting: where is my webapp ?
Want to export services with hessian/burlap but don't want to create a webapp? read on to find an answer.
21/Apr/2007 More on Groovy applets
An update on my Groovy applet experiment, this time it can read Groovy code from the web page if included in <script> tags.
08/Dec/2006 Json-lib's new tricks
An update on the latest features available in Json-lib-1.0b1, making it easy to work with generic types (not Java5 generics).
03/Apr/2007 Groovy and JSON
Quick example of how to use Json-lib with Groovy, the latest dev snapshot does not require you to write the '[metaClass] as String[]' thing.
02/Apr/2007 GPath in action (not a book)
Quick example of using GPath to your advantage, compared to the amount of code that would be needed with 'standard Java' to accomplish the same. Based on a sample in the Grails book.
14/Nov/2006 Code coverage on Eclipse: EclEmma
Pointers for the EclEmma project and other test-friendly plugins for Eclipse.
And the 3 runner ups:
06/Apr/2007 Running Groovy on an Applet
The first entry on a series that shows how to run Groovy on an Applet and have access to DOM objects.
07/Apr/2007 CSS on Swing
This is a follow up of Eitan's announcement on the JMatter lists, which had a good reaction.
20/Dec/2006 DbUnit: using the IDatabaseTester
A quick guide on using the IDatabaseTester and its 4 basic implementations.


blog dbunit groovy jmatter json-lib swing
Eitan Suez has posted an update on the upcoming support for CSS on Swing in JMatter, which I think is a Good Thing.

For the past 3 years I've been working on web and desktop applications, many team members had a decent webapp development experience but when faced with building a Swing app they were totally lost. Where's my controller? how do I setup a template? you're telling me I have to build a UIDelegate whenever I want to change how a ui component is displayed? and other questions that showed that the team was looking for a Struts-on-Swing framework. That's why I see the need that kind of Swing application development framework, a framework that leverages the knowledge that developers have on building webapps. JMatter does that in its own way, it feels a lot like Grails, and with CSS it will be very easy to beautify your app in no time.

This is not the first approach to get CSS on Swing, Chet mentioned the JAXX Framework a couple of times during Desktop Matters. JAXX enables you to write swing applications in a declarative way with XML, much in the same vein as Swixml (also demoed at DM by Wolf Paulus) and it includes CSS support as well.

If you can't wait to play with JMatter's CSS support, please take a look at the current documentation and download the code from the svn trunk, the JMatter team will appreciate all feedback!

css jmatter swing
I've finished reading the Jmatter book and I've been itching to talk about it. I've said before that one of the reasons that I wanted to Desktop Matters was to reconnect with Swing development and learn from the desktop experts tips and techniques that may be useful in web land (because it so happens that I now work for one). Earlier this year I also said that what was lacking on the Swing development front was a framework that leads the revolution much like Struts did seven years ago with web development (a couple of days later Hans posted info on an early implementation of JSR296, the Swing Application Framework, go figure).

Back to DM, 3 frameworks were presented (in this same order):
JS3296 Swing Application Framework: it has many interesting things like the Resource and Action Managers, support for basic views and eventually data binding with JSR295 (BeansBinding). Spring Rich Client: has the feeling of the Spring framework in it, (in term of design), bindings to common layout and widget libraries (JGoodies, Swinglabs, JIDE). JMatter: a framework that lets the developer concentrate on the domain and leaves the burden of UI and binding to its internals.

The way these 3 frameworks were introduced to the audience was very clever (good job Ben) because as presentations went you could see how each was in an upper lever of abstraction as the previous one. SAF will only focus on common tasks of Swing app development (launching, UI resource management, action binding, simple life cycle), Spring RC adds support for view management, several alternatives for view building, and tight integration with all the stuff that Spring provides and you've come to love. Finally we have JMatter which has all of many of the previous features but it increases productivity by a tenfold, because the developer is free to work on domain problems and does not have to work with the "Swing tangle".

Comparing Spring RC with JMatter is like trying to compare Struts with Grails (or AppFuse if you are a Java only dev), Struts lets you micromanage every aspect of your app but at the same time requires a lot of configuration files; Grails in the other hand, lets you do everything you do with Struts but with less configuration (because of the CoC paradigm) and adds up a stack for persisting your domain, calling services from "Actions" and other goodies.

Spring RCP lets configure every aspect of your app too, ending in tons of xml code to be written (even if the new schema syntax sugar is added into the mix) and you'll still have to code a lot. Let's say you want a simple CRUD-like application for 3 domain classes, you'll have to come up with following (at least):
code 3 domain classes Mappings for your persistence strategy (xdoclet is very handy with Hibernate) if you follow the anemic domain strategy, at least 3 service classes Either 4 views for each domain class or a generic solution for each CRUD operation. Configure everything with xml or another mean. And the tests? surelly you'll code tests for domain classes, services and maybe some of your view helpers.
With Jmatter you have to:
code 3 domain classes Configure your database (optional) you may create tests for the domain classes but they're not really needed.
See the difference? JMatter provides you with everything you need and more! did I mention that
it includes a login mechanism it lets you query the domain classes at your leisure save, list and manage those queries query log events (everything done in your app is monitored by default)
And there is more to come in the next months.

This means that Spring RC is doomed to fall behind JMatter as Struts is now behind the other web frameworks? not really, In my opinion it will help laying out the ground for Swing frameworks, it'll teach the new generation how to design and develop Swing apps from thin air, each layer at a time, but as those developers start requiring a higher level of abstraction they'll come up with their own solution. Well there is no need for that, JMatter is here. Now. And it will become easier to use with every release.

So if you're a web developer coming from the Grails/Rails camp and suddenly have to work in the desktop, give Jmatter a look, you'll see a lot of common things; if you're a Swing developer tired of doing the same things over and over, give it a look, you'll not be disappointed. And if you see something you don't like or an opportunity for improvement or discover a bug, please drop a line to the JMatter team, they'll surely appreciate all the feedback!.

PD: the intention of this post is in no way to bash on SAF and Spring RC, kudos to Hans and his team, and to the Spring RC team too, terrific work so far.

jmatter swing
All things come to and eventually, and for Desktop Matters this is it. During dinner Eitan Suez presented JMatter which totally blew me away, it turns out JMatter is the framework (or at least the building blocks) I was waiting for when thinking in a Grails-like framework for Swing. Groovy support is on the roadmap, definitely worth to keep an eye on it.

The day ended with two non-java presentations, the first one was by Microsoft (Jaime) and its WMF format. Al thought I do not have used .Net in my whole life I respect what these guys are doing and they even have the same problems we as Java developers have, really.

The other presentation was about Adobe's Flex2 and Apollo, by Kevin, if you haven't heard it before, Apollo is Adobe's new product that will let you run flash (and flex enabled) applications on the desktop, very impressive.

Now a curious thing is that through out the whole show, Ben was busting Chet's chops by cutting jokes about the timing framework, totally hilarious, those two are excellent presenters (and hosts) and overall good guys.

As an added bonus I got one of Eitan's recently self-published books on JMatter and even have it signed by him, thanks Eitan, talk too you soon about Groovy support on JMatter.

In the end this event wouldn't be possible if it weren't by Jay's, Ben's and Dion's dedication to bringing together the community, thank you all!

desktopmatters jmatter swing