<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Kaptain on ... stuff &#187; Swing</title>
	<atom:link href="http://www.kellyrob99.com/blog/tag/swing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kellyrob99.com/blog</link>
	<description>Tales of development, life and the folly that goes along with both</description>
	<lastBuildDate>Sun, 04 Dec 2011 21:51:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>A One Day Griffon Application/Presentation</title>
		<link>http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-one-day-griffon-applicationpresentation</link>
		<comments>http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 05:15:57 +0000</pubDate>
		<dc:creator>TheKaptain</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[Collections]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Griffon]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[kellyrob99]]></category>
		<category><![CDATA[plugin architecture]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[slideware]]></category>
		<category><![CDATA[Source code]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[TestNG]]></category>
		<category><![CDATA[theKaptain]]></category>
		<category><![CDATA[Transitions2D]]></category>

		<guid isPermaLink="false">http://www.kellyrob99.com/blog/?p=1072</guid>
		<description><![CDATA[I took the opportunity this past weekend to test drive the latest beta version of Griffon and along with it the as-of-yet unreleased slideware plugin. If you&#8217;re not already aware, Griffon is a Grails inspired framework for creating Java Swing applications. The project lead, Andres Almiray, has given several presentations using this plugin and it [...]
Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/' rel='bookmark' title='VIJUG Griffon/Groovy Presentation'>VIJUG Griffon/Groovy Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2010/05/15/achieving-groovy-like-fluency-in-java-with-google-collections/' rel='bookmark' title='Achieving Groovy-like Fluency in Java with Google Collections'>Achieving Groovy-like Fluency in Java with Google Collections</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/03/15/fun-day-playing-with-new-stuff/' rel='bookmark' title='Fun day playing with new Stuff'>Fun day playing with new Stuff</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I took the opportunity this past weekend to test drive the latest beta version of <a href="http://griffon.codehaus.org/">Griffon</a> and along with it the as-of-yet unreleased slideware plugin. If you&#8217;re not already aware, Griffon is a Grails inspired framework for creating <a class="zem_slink" href="http://en.wikipedia.org/wiki/Swing_%28Java%29" title="Swing (Java)" rel="wikipedia">Java Swing</a> applications. The project lead, Andres Almiray, has given several presentations using this plugin and it provides an excellent platform for showcasing both the power of Swing and the capabilities of Griffon to make it all look so easy.</p>
<p>The slideware plugin provides a framework for creating presentations with a little twist &#8211; you can execute code live from the presentation software.  If you&#8217;ve ever given a presentation about programming you probably are fully aware of the transition from presentation software to your preferred environment for demonstrating code samples. Well, now you can stay entirely within the same application, editing and running code live.</p>
<p>The plugin itself isn&#8217;t available from the Griffon repository but source code and a built 0.2 version can be <a href="http://github.com/aalmiray/Presentations">found on github</a>.  Considering both the youth of the plugin and the beta status of the framework, it worked impressively well AND had a rich feature set.  All of the expected &#8220;powerpoint&#8221; features are there: themes, layout control, styling, slide transitions and export are all pretty easy to incorporate and configure. The code editor view also works very well. A great variety of additional plugins are harnessed to put all the pieces together and as a result building one of these applications is a great way to tour the platform.</p>
<p></p>
<h2>Theming</h2>
<p>Applying a theme to the presentation is simply selecting a Java Look and Feel to apply in Initialize.groovy. The Substance jar is included with the plugin so I test drove a few of the nice setups in there and finally settled on the SubstanceMagmaLookAndFeel. There is definitely a wide variety of L&amp;F&#8217;s to choose from in that bundle alone and, although I haven&#8217;t done it myself, they seem pretty tweakable as well. Plus any old L&amp;F should plug in nicely, I would imagine. </p>
<pre class="brush: groovy; title: ; notranslate">
//Initialize.groovy
SwingBuilder.lookAndFeel('org.jvnet.substance.skin.SubstanceMagmaLookAndFeel',
       'mac', 'nimbus', 'gtk', ['metal', [boldFonts: false]])
</pre>
<p></p>
<h2>Layout</h2>
<p>Controlling the page composition is a standard Swing Layout or, in the case of the default slide you get with the included &#8220;create-slide&#8221; script, a MigLayout. Framing the standard variety of slides is very simple. Bulleted pages, title slides, code slides and custom layouts are very easy to accomplish. I don&#8217;t have a lot of experience using this particular layout but the presentations Andres has made available on github have a good diversity of examples of how they look in practice.</p>
<pre class="brush: groovy; title: ; notranslate">
//the default create-slide generated template
import net.miginfocom.swing.MigLayout

slide(id: &quot;slide0&quot;, layout: new MigLayout(&quot;fill&quot;,&quot;[center]&quot;,&quot;[center]&quot;)) {
    label(&quot;Insert your text here&quot;)
}
</pre>
<p></p>
<h2>Styling</h2>
<p>Styling is supplied by the css plugin, on which slideware has a dependency. The default style.css file sets out just some reasonable defaults for the fonts used in different parts of the app, and I didn&#8217;t see any real need to fiddle with it. Especially happy to see the nice monospace code font. On a totally related note I recently installed the <a href="http://www.levien.com/type/myfonts/inconsolata.html">Inconsolata</a> monospace font to try for development and I&#8217;ve been very happy seeing it in my editor, but it&#8217;s still nice to see this kind of polish applied to the presentation. The code editor view even includes syntax highlighting! More on that coming right up&#8230;</p>
<p></p>
<h2>Slide Transitions</h2>
<p>Moving between slides with style is the responsibility of the <a href="http://griffon.codehaus.org/Transitions+Plugin">transitions plugin</a>. You can see see all of the animations this plugin enables over here at <a href="http://javagraphics.blogspot.com/2007/04/slideshows-transitions-swf.html">this page describing Transitions and Transition2Ds</a>. Pretty slick stuff and defined as simply as a parameter to each &#8220;slide&#8221; node in a script.</p>
<pre class="brush: groovy; title: ; notranslate">
slide(id: &quot;slide3&quot;, layout: new MigLayout(&quot;fill&quot;,&quot;3%[center]3%&quot;,&quot;3%[center]3%&quot;),
        title: &quot;Junit3&quot;,
        transition: new FlurryTransition2D(Transition2D.OUT)) {
    scrollPane(constraints: &quot;grow&quot;) {
        widget(createEditor(text: script))
    }
}
</pre>
<p></p>
<h2>Code Editor</h2>
<p>Code slides embed an editable widget and allow for composing and executing Groovy scripts or classes of arbitrary complexity. You can execute the code with a keyboard shortcut and a window will open displaying the console output. The code itself is executed through a GroovyShell, enabling pretty much anything you might want to do. If you have an internet connection and the required repositories configured, Grapes simplifies packaging the dependencies for the application as your code samples can directly Grab the jars they need. Basically, the first time you execute a code slide you&#8217;ll have to put up with a small pause while Ivy downloads to your local repository, unless of course the required dependencies are already there.  In my case I changed strategies from including jars in the application lib directory to a Grapes approach and I think it&#8217;s a better way to go.</p>
<p>I was surprised to find that the editor even included undo functionality. It&#8217;s definitely not close to a full blown IDE, and there&#8217;s absolutely no reason that it should be. For the task of demoing simple code examples it&#8217;s more than up to the task, even to the point of maintaining your edits between slide transitions, allowing you to move back and forth through the slide deck without any state problems.<br />

<a href="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/screen-shot-2010-02-11-at-7-47-04-pm.png" title="Code slide with JUnit4 and Hamcrest matcher example" class="shutterset_singlepic38" >
	<img class="ngg-singlepic" src="http://www.kellyrob99.com/blog/wp-content/gallery/cache/38__x_screen-shot-2010-02-11-at-7-47-04-pm.png" alt="Code slide with JUnit4 and Hamcrest matcher example" title="Code slide with JUnit4 and Hamcrest matcher example" />
</a>
</p>
<p></p>
<h2>Export</h2>
<p>The application includes a &#8220;Print&#8221; feature which iterates through the entire slide deck and renders it to a pdf. Distribution of one of these presentations is really very easy, including the ability to create installers for all major platforms simply by adding the packaging plugin.</p>
<p></p>
<h2>Test Application</h2>
<p>The test app I built while looking into this is pretty simple. It&#8217;s got a title slide, a bullet slide and 4 code slides. The code simply demonstrates how you can create test classes and make assertions for Junit 3(with GroovyTestCase), Junit 4 and TestNG. GroovyShell recognizes all 3 of these test files by interface or annotation and executes them appropriately. In each case the console output of the test framework is the result, including the new Spock inspired ascii art assert failure renderings. The Test result files are also written to disk, and that TestNG html output is what I&#8217;m used to looking at anyhow. Show me the Green!</p>
<p>The last code slide is just a slightly updated version of an example script on the Grapes page, using the current version of Google Collections and intentionally introducing a failure- mostly just to show off that new assert rendering I mentioned a moment ago. VERY helpful at highlighting the exact nature of a failure. It also encourages me to pay more attention to how I name variables, something I&#8217;m sure every developer that has ever worked with me will cheer at. Man, I suck at naming things.</p>
<p>I also developed a brute force test that loads each slide and executes scripts if finds embedded there. Failures are hard to detect since the direct output is simply a text block, but some fairly simple regex&#8217;s applied to the output make me at least moderately confident that the code won&#8217;t fail at show time.</p>
<p></p>
<h2>Overall Impression</h2>
<p>It took a couple of afternoons(six hours or so total) to download the source code from github, explore it, create a simple presentation and document the experience. I won&#8217;t begin to suggest that I&#8217;m fully aware of all the details happening behind the scenes, but the end user experience is pretty fluid: create a slide, tailor the layout, add content and then repeat. The included examples were more than enough documentation on how to hit the ground running. The plugin code itself is a great example of the MVC nature of Griffon, not a whole lot of code, but a great deal of power and expressability. There were a couple of glitches happening in the background, mostly just logging to the console with no visible effect to the application, but overall it functioned as well as (not) advertised. For publicly unreleased software it was an absolute pleasure to work with and I plan on continuing with the development of this particular presentation.</p>
<p>Everything you need to build and run this stuff yourself is publicly available. In my case, Griffon generally has a recent Macport available for both the released(griffon @0.2.1) and development versions(griffon-devel @0.3-BETA-2). Switching versions is relatively painless and, for applications this simple, testing out upgrades is basically just going through the presentation once in a functional test. Versions for other platforms can be downloaded from the <a href="http://griffon.codehaus.org/Download">Griffon download page</a>.</p>
<p></p>
<h2>Deliverables</h2>
<p>Source code for the sample application is <a href="http://github.com/kellyrob99/Groovy-Testing-Presentation">available on github here</a>. Please just leave a comment on this page if you have any problems running it.</p>
<p>Here&#8217;s the pdf produced by the application &#8216;Print&#8217; feature: <a class="downloadlink" href="http://www.kellyrob99.com/blog/wp-content/plugins/download-monitor/download.php?id=2" title="Version0.1 downloaded 252 times" >Groovy Testing Presentation (252)</a></p>
<p>And if you don&#8217;t feel like downloading anything, here&#8217;s how it all looks in pretty pictures.<br />

<div class="ngg-galleryoverview" id="ngg-gallery-9-1072">

	<!-- Slideshow link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/?show=slide">
			[Show as slideshow]		</a>
	</div>

	<!-- Piclense link -->
	<div class="piclenselink">
		<a class="piclenselink" href="javascript:PicLensLite.start({feedUrl:'http://www.kellyrob99.com/blog/wp-content/plugins/nextgen-gallery/xml/media-rss.php?gid=9&amp;mode=gallery'});">
			[View with PicLens]		</a>
	</div>
	
	<!-- Thumbnails -->
		
	<div id="ngg-image-35" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/screen-shot-2010-02-11-at-7-46-46-pm.png" title="Title slide" class="shutterset_set_9" >
								<img title="Title slide" alt="Title slide" src="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/thumbs/thumbs_screen-shot-2010-02-11-at-7-46-46-pm.png" width="99" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-36" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/screen-shot-2010-02-11-at-7-46-50-pm.png" title="Bullet slide" class="shutterset_set_9" >
								<img title="Bullet slide" alt="Bullet slide" src="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/thumbs/thumbs_screen-shot-2010-02-11-at-7-46-50-pm.png" width="99" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-37" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/screen-shot-2010-02-11-at-7-47-00-pm.png" title="Code slide with JUnit 3 example" class="shutterset_set_9" >
								<img title="Code slide with JUnit 3 example" alt="Code slide with JUnit 3 example" src="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/thumbs/thumbs_screen-shot-2010-02-11-at-7-47-00-pm.png" width="99" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-38" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/screen-shot-2010-02-11-at-7-47-04-pm.png" title="Code slide with JUnit4 and Hamcrest matcher example" class="shutterset_set_9" >
								<img title="Code slide with JUnit4 and Hamcrest matcher example" alt="Code slide with JUnit4 and Hamcrest matcher example" src="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/thumbs/thumbs_screen-shot-2010-02-11-at-7-47-04-pm.png" width="99" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-39" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/screen-shot-2010-02-11-at-7-47-08-pm.png" title="Code slide with TestNG example" class="shutterset_set_9" >
								<img title="Code slide with TestNG example" alt="Code slide with TestNG example" src="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/thumbs/thumbs_screen-shot-2010-02-11-at-7-47-08-pm.png" width="99" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-40" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/screen-shot-2010-02-11-at-7-47-13-pm.png" title="Code slide with Google Collections example" class="shutterset_set_9" >
								<img title="Code slide with Google Collections example" alt="Code slide with Google Collections example" src="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/thumbs/thumbs_screen-shot-2010-02-11-at-7-47-13-pm.png" width="99" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-41" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/screen-shot-2010-02-08-at-8-53-43-pm.png" title="Help screen showing keyboard shortcuts" class="shutterset_set_9" >
								<img title="Help screen showing keyboard shortcuts" alt="Help screen showing keyboard shortcuts" src="http://www.kellyrob99.com/blog/wp-content/gallery/groovy-testing-presentation-with-griffon/thumbs/thumbs_screen-shot-2010-02-08-at-8-53-43-pm.png" width="99" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>

</p>
<div class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/a9a507d7-67b9-4178-bf0f-e90f2cc1d0a6/" title="Reblog this post [with Zemanta]"><img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_c.png?x-id=a9a507d7-67b9-4178-bf0f-e90f2cc1d0a6" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
<!-- AdSense Now! V1.95 -->
<!-- Post[count: 2] -->
<div class="adsense adsense-leadout" style="float:right;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "pub-6955914197200080";
/* 728x90, created 8/3/09 */
google_ad_slot = "4051815125";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/' rel='bookmark' title='VIJUG Griffon/Groovy Presentation'>VIJUG Griffon/Groovy Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2010/05/15/achieving-groovy-like-fluency-in-java-with-google-collections/' rel='bookmark' title='Achieving Groovy-like Fluency in Java with Google Collections'>Achieving Groovy-like Fluency in Java with Google Collections</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/03/15/fun-day-playing-with-new-stuff/' rel='bookmark' title='Fun day playing with new Stuff'>Fun day playing with new Stuff</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>VIJUG Griffon/Groovy Presentation</title>
		<link>http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vijug-griffongroovy-presentation</link>
		<comments>http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 07:36:12 +0000</pubDate>
		<dc:creator>TheKaptain</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Griffon]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Keynote]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[SwingWorker]]></category>
		<category><![CDATA[Vancouver Island]]></category>
		<category><![CDATA[VIJUG]]></category>

		<guid isPermaLink="false">http://www.kellyrob99.com/blog/?p=658</guid>
		<description><![CDATA[I had a great time tonite geeking out with Griffon in front of an audience. My thanks to everyone that attended, and especially to Manfred Moser and VIJUG for the chance to show off some Groovy and Griffon Swing code! The venue was great &#8211; very nice that the Vancouver Island Tech Park is kind [...]
Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/' rel='bookmark' title='A One Day Griffon Application/Presentation'>A One Day Griffon Application/Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/' rel='bookmark' title='Griffon SwingX Fest testing'>Griffon SwingX Fest testing</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/07/16/presenting-a-groovygriffon-talk/' rel='bookmark' title='Presenting a Groovy/Griffon talk'>Presenting a Groovy/Griffon talk</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I had a great time tonite geeking out with <a class="zem_slink" title="Griffon (framework)" rel="homepage" href="http://griffon.codehaus.org">Griffon</a> in front of an audience. My thanks to everyone that attended, and especially to Manfred Moser and VIJUG for the chance to show off some Groovy and Griffon Swing code!</p>
<p>The venue was great &#8211; very nice that the <a href="http://www.vitp.ca/">Vancouver Island Tech Park</a> is kind enough to host meetings. Next time I&#8217;ll have to come early enough to figure out how to make the projector do better than 800X600 resolution, however. Hard to show much other than a slide deck presentation with that little space. Then again I may be a little spoiled when my usual is 1920X1200.</p>
<p>I love using <a class="zem_slink" title="Keynote (presentation software)" rel="homepage" href="http://www.apple.com/iwork/keynote/">Keynote</a> for presentations with the <a class="zem_slink" title="Apple" rel="homepage" href="http://www.apple.com">Apple</a> infrared remote. Between the presenter view with notes to guide what I wanted to say(and to remind me when to step out and demo some code) and the timer to keep me on track, it went really pretty smooth. That&#8217;s my story, and I&#8217;m sticking to it. The software, both Griffon and Keynote, worked flawlessly so if things weren&#8217;t perfect, there&#8217;s only me to blame.</p>
<p>SwingPad seemed to make quite an impression, which is not hard to understand considering how little effort it takes to start showing results on the screen. Put that together with the recent CSSBuilder integration and the rich samples for other builders and I think more than a couple of <a class="zem_slink" title="Java (software platform)" rel="homepage" href="http://java.sun.com">Java</a> developers will be installing it soon.</p>
<p>The question came up enough that I want to directly reference this blog post <a href="http://www.jroller.com/aalmiray/entry/griffon_gsql_mini_howto">from Andres Almiray regarding GSQL in Griffon</a>. Apparently people like to have databases handy at all times</p>
<p> <img src='http://www.kellyrob99.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And a big thanks to Andres for sharing two free copies of the upcoming Griffon In Action that he is co-authoring for raffle prizes tonite. Through the magic of <a class="zem_slink" title="Twitter" rel="homepage" href="http://twitter.com">Twitter</a> he was very supportive about 20 seconds after the original announcement went out. Now if only they can kill all those nasty spam-bots, etc that are messing with my Twittiness!</p>
<p>I&#8217;ve uploaded the <a href="http://github.com/kellyrob99/GriffonDemo/tree/master">demonstration application at github</a>. It shows a simple Griffon app with three tabs. The first is a minor port of Andres&#8217; <a href="http://www.jroller.com/aalmiray/entry/griffon_making_animations_with_gfx">Trident/GfxBuilder example</a> to show animation. The second is a simple demo of the @Bindable <a class="zem_slink" title="Abstract syntax tree" rel="wikipedia" href="http://en.wikipedia.org/wiki/Abstract_syntax_tree">AST</a> transformation along with the SwingBuilder syntax for accesing SwingUtilities; it comes along with an accompanying <a href="http://code.google.com/p/fest/">Fest</a> test. The third requires an internet connection as it parses out the DZone rss feed and delivers it into a <a href="http://www.publicobject.com/glazedlists/">GlazedList</a>, demonstrating usage of <a class="zem_slink" title="SwingWorker" rel="wikipedia" href="http://en.wikipedia.org/wiki/SwingWorker">SwingWorker</a> courtesy of the <a href="http://groovy.codehaus.org/SwingXBuilder">SwingXBuilder</a>.  I showed those samples along with <a href="http://docs.codehaus.org/display/GRIFFON/Installer+Plugin">installer plugin</a> built versions of some of the included Griffon sample applications. WeatherWidget is a one fine looking translucent UI example!</p>
<p>Please ping me if you have any problems running this Griffon app, as I did trim out a bunch of the extraneous project files and test reports right before uploading. This was my first time &#8216;really&#8217; using <a class="zem_slink" title="Git (software)" rel="homepage" href="http://git-scm.com/">Git</a> for source control so it&#8217;s bound to be a bit messy &#8211; nevertheless the Git experience has been great so far. I also tried to get the slides up on SlideShare, but that appears to&#8230; not be happening(been uploading now for over 20 minutes this time- about to kill it, again). So <a href="http://www.kellyrob99.com/blog/wp-content/uploads/2009/08/GriffonPresentation.pdf">here&#8217;s the pdf</a>.<br />
<span style="font-size: large;"><a title="Source down for the demo hosted at github" href="http://github.com/kellyrob99/GriffonDemo/tree/master">Source code download here.</a></span></p>
<p><span style="font-size: large;"><a title="A pdf of the Keynote presentation." href="http://www.kellyrob99.com/blog/wp-content/uploads/2009/08/GriffonPresentation.pdf">Slidedeck download here.</a></span></p>
<div style="width:425px;text-align:left" id="__ss_1921982"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/buttita/griffon-presentation-1921982" title="Griffon Presentation">Griffon Presentation</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=griffonpresentation-090828194024-phpapp01&#038;stripped_title=griffon-presentation-1921982" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=griffonpresentation-090828194024-phpapp01&#038;stripped_title=griffon-presentation-1921982" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/buttita">The Kaptain</a>.</div>
</div>
<div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/cc92f489-148d-4e3c-b156-a7dcf8688412/"><img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_c.png?x-id=cc92f489-148d-4e3c-b156-a7dcf8688412" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p>Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/' rel='bookmark' title='A One Day Griffon Application/Presentation'>A One Day Griffon Application/Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/' rel='bookmark' title='Griffon SwingX Fest testing'>Griffon SwingX Fest testing</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/07/16/presenting-a-groovygriffon-talk/' rel='bookmark' title='Presenting a Groovy/Griffon talk'>Presenting a Groovy/Griffon talk</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Groovy and Glazed Lists with Grape</title>
		<link>http://www.kellyrob99.com/blog/2009/04/19/groovy-and-glazed-lists-with-grape/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=groovy-and-glazed-lists-with-grape</link>
		<comments>http://www.kellyrob99.com/blog/2009/04/19/groovy-and-glazed-lists-with-grape/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 02:16:01 +0000</pubDate>
		<dc:creator>TheKaptain</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[*nix]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[GlazedList]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[google-collections]]></category>
		<category><![CDATA[Grape]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaPosse]]></category>
		<category><![CDATA[MultiMap]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Swing]]></category>

		<guid isPermaLink="false">http://www.kellyrob99.com/blog/?p=338</guid>
		<description><![CDATA[So today while I was cleaning out the garage, I finally got a chance to the listen to the Java Posse podcast on Google Collections and GlazedLists. Google Collections has come in handy a few times, the MultiMap extension most notably. It solves essentially the same kind of problem that I described way back in [...]
Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2010/05/15/achieving-groovy-like-fluency-in-java-with-google-collections/' rel='bookmark' title='Achieving Groovy-like Fluency in Java with Google Collections'>Achieving Groovy-like Fluency in Java with Google Collections</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/' rel='bookmark' title='VIJUG Griffon/Groovy Presentation'>VIJUG Griffon/Groovy Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/' rel='bookmark' title='A One Day Griffon Application/Presentation'>A One Day Griffon Application/Presentation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So today while I was cleaning out the garage, I finally got a chance to the listen to the <a href="http://javaposse.com/">Java Posse</a> podcast on <a href="http://javaposse.com/index.php?post_id=451742">Google Collections and GlazedLists</a>. Google Collections has come in handy a few times, the MultiMap extension most notably. It solves essentially the same kind of problem that I described way back in <a href="http://www.kellyrob99.com/blog/2009/02/08/my-favorite-new-groovy-trick/">this little Groovy post</a>.</p>
<p>And recently I had read an article about GlazedLists over on <a href="http://www.jroller.com/aalmiray/entry/glazedlists_groovy_not_your_regular">Andres&#8217; blog</a>, so it was great to get some more context around them, especially on how they can greatly simplify development of responsive and scalable Swing tables.  It inspired me enough to visit their <a href="http://publicobject.com/glazedlistsdeveloper/">developer tutorials page</a> and spend an hour watching screencasts. The examples are clear and concise, and the developer, James Lemieux, does a fantastic job of explaining how the different pieces in the GlazedList architecture fit together. If you have a spare hour, well worth watching.</p>
<p>So in the spirit of <a href="http://www.kellyrob99.com/blog/2009/04/14/groovy-and-bash-can-scripting-get-much-easier/">my last post</a>, it occurred to me how to put this to use on the command line as an example.  I chose to do a quick and dirty script for sorting a subset of the results from an &#8216;svn st&#8217; command run in the current directory.  Not terribly useful in its present form, but I think it shows that with a little more effort, you can add some handy utility methods when consuming command line output &#8211; namely sorting.</p>
<p>Essentially this is a demonstration of creating a table binding dynamically and baking automatic sorting across multiple columns right into the model. Grape is used to incorporate the GlazedLists functionality, but otherwise all of the dependencies required are available in Groovy 1.6.1. So you can run this directly on the command line of a *nix machine(execute permissions required of course) with very little additional setup. I did have an initial problem with Grape being unable to resolve the GlazedList dependency, but through the magic of Google I found <a href="http://www.nabble.com/Unable-to-@Grab-http-builder-td22837819.html">this article</a> which explains how to configure repositories using a grapeConfig.xml file and the problem went away. With no further ado, here&#8217;s the entire code.</p>
<pre class="brush: groovy; smart-tabs: true; title: ; notranslate">
#!/usr/bin/env groovy
import ca.odell.glazedlists.*
import ca.odell.glazedlists.gui.*
import ca.odell.glazedlists.swing.*
import groovy.swing.*
import javax.swing.*

@Grab (group = 'net.java.dev.glazedlists', module = 'glazedlists_java15', version = '1.8.0')
public class SVNGlazedListExample
{
	public static void main(args)
	{
		def columnNames = ['Code', 'Revision', 'Filename']
		def sortedRevisions

		//execute on the command line and populate buffers with the output
		def sout = new StringBuffer()
		def serr = new StringBuffer()
		def Process process = &quot;svn stat -u&quot;.execute([], new File('.'))
		process.consumeProcessOutput(sout, serr)
		process.waitFor()

		SwingBuilder builder = new SwingBuilder();

		/**
		 * closure returns a JComponent showing the buffered output
		 */
		def getTableModel = {out, err -&gt;
			if (err)      //Groovy truth FTW
			{
				//create error output table
				return builder.textPane(size: [500, 500], text: err)
			}
			else
			{
				//create three column table
				def lines = out.toString().split('\n')
				def data = []
				lines.each() {
					def tokens = it.tokenize()  //Groovy add which abstract away spaces vs tabs
					//a hack to be sure, but let's just get trebles for now
					if (tokens.size() == 3)
					{
						//rows in the data are just a map
						data &lt;&lt; 1, revision: tokens[1], filename: tokens[2]]
					}
				}
				//passing in null gives us default String comparator
				sortedRevisions = new SortedList(new BasicEventList(data),null)

				//this little trick courtesy of Andres Almiray - Thanks!
				final EventTableModel model = new EventTableModel(sortedRevisions, [
						getColumnCount: {columnNames.size()},
						getColumnName: {index -&gt; columnNames[index]},
						getColumnValue: {object, index -&gt;
							object.&quot;${columnNames[index].toLowerCase()}&quot;
						}] as TableFormat)

				return builder.table(id: 'revisions', model: model)
			}
		}

		//the 'show it' code
		builder.frame(title: 'SVN Change List', size: [500, 500], pack: true, show: true,
				defaultCloseOperation: WindowConstants.DISPOSE_ON_CLOSE) {
			scrollPane {
				def component = getTableModel(sout, serr)
				//I'm sure this could be more elegant
				if(component instanceof JTable){
					def tableSorter = new TableComparatorChooser(revisions,
						sortedRevisions, AbstractTableComparatorChooser.MULTIPLE_COLUMN_MOUSE)
				}
			}
		}
	}
}
</pre>
<p>UPDATE: A long time coming, but here's a screenshot for you Sho.<br />
<a href="http://www.kellyrob99.com/blog/wp-content/uploads/2009/04/svnglazedlistexamplescreen.png"><img src="http://www.kellyrob99.com/blog/wp-content/uploads/2009/04/svnglazedlistexamplescreen.png" alt="svnglazedlistexamplescreen" title="svnglazedlistexamplescreen" width="534" height="522" class="alignnone size-full wp-image-368" /></a></p>
<p>Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2010/05/15/achieving-groovy-like-fluency-in-java-with-google-collections/' rel='bookmark' title='Achieving Groovy-like Fluency in Java with Google Collections'>Achieving Groovy-like Fluency in Java with Google Collections</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/' rel='bookmark' title='VIJUG Griffon/Groovy Presentation'>VIJUG Griffon/Groovy Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/' rel='bookmark' title='A One Day Griffon Application/Presentation'>A One Day Griffon Application/Presentation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.kellyrob99.com/blog/2009/04/19/groovy-and-glazed-lists-with-grape/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>More Groovy/Griffon/FEST Testing</title>
		<link>http://www.kellyrob99.com/blog/2009/04/10/more-griffonfest-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=more-griffonfest-testing</link>
		<comments>http://www.kellyrob99.com/blog/2009/04/10/more-griffonfest-testing/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 19:47:23 +0000</pubDate>
		<dc:creator>TheKaptain</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Griffon]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[JXBusyLabel]]></category>
		<category><![CDATA[JXColorSelectionButton]]></category>
		<category><![CDATA[Model–view–controller]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[SwingBuilder]]></category>
		<category><![CDATA[SwingX]]></category>
		<category><![CDATA[TestNG]]></category>

		<guid isPermaLink="false">http://www.kellyrob99.com/blog/?p=261</guid>
		<description><![CDATA[In my continuing exploration of FEST testing using Groovy and the Griffon framework, I&#8217;ve added some tests for the ability to change the JXBusyLabel coloration on the fly. Since FEST allows you to alter the properties of the widgets directly, I didn&#8217;t have to do anything special to trigger actions on the JXColorSelectionButton. At first [...]
Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/' rel='bookmark' title='Griffon SwingX Fest testing'>Griffon SwingX Fest testing</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/05/swingx-busy-label-demo-in-griffon/' rel='bookmark' title='SwingX busy label demo in Griffon and Groovy'>SwingX busy label demo in Griffon and Groovy</a></li>
<li><a href='http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/' rel='bookmark' title='A One Day Griffon Application/Presentation'>A One Day Griffon Application/Presentation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In my continuing exploration of FEST testing using Groovy and the Griffon framework, I&#8217;ve added some tests for the ability to change the JXBusyLabel coloration on the fly.</p>
<p>Since FEST allows you to alter the properties of the widgets directly, I didn&#8217;t have to do anything special to trigger actions on the JXColorSelectionButton. At first look, I thought that specifying mouse click point locations would be necessary, but after digging a(very little) bit I discoveregroovyd that FEST exposes the underlying Component its&#8217; Fixture classes wrap as an internal &#8216;target&#8217;. Simply grabbing that Component and settings the background color directly was sufficient.<br />
Here is the new definition of the JXBusyLabel and the 3 buttons which controls its color changes. You can see that two of the three color changes happen automagically due to Groovy binding &#8211; setting the background color of the label didn&#8217;t appear to work for some reason that I have yet to puzzle out, so it gets a PropertyChangeListener &#8216;old school style&#8217;.</p>
<pre class="brush: groovy; smart-tabs: true; title: ; notranslate">
baseColBtn = colorButton(name: 'baseColBtn', background: model.baseColor)
highColBtn = colorButton(name: 'highColBtn', background: model.busyColor)
backColBtn = colorButton(name: 'backColBtn', background: PaintUtils.BLUE_EXPERIENCE.getColor1())
backColBtn.addPropertyChangeListener(&quot;background&quot;, {PropertyChangeEvent evt -&gt;
      label.setBackground((Color) evt.getNewValue())
      label.setOpaque(true)
} as PropertyChangeListener)

label = jxbusyLabel(name: 'busyLabel',
      preferredSize: new Dimension(model.W / 2 as int, model.H / 2 as int),
      busyPainter: busyPainter(
      highlightColor: bind { highColBtn.background }, baseColor: bind {baseColBtn.background},
      points: bind {slider.value}, trailLength: bind {tSlider.value}),
      opaque: false,
      horizontalAlignment: JLabel.CENTER,
      delay: bind {speedSlider.value},
      background: bind{backColBtn.background})
</pre>
<p>The three associated tests are essentially using the same recipe, so here&#8217;s just one of them to give you the idea.</p>
<pre class="brush: groovy; smart-tabs: true; title: ; notranslate">
 /**
 * Test that changing the 'baseColBtn' background color simultaneously
 * changes the busy label's base color.
 */
 @Test void testBaseColorChange() {
       startAnimation()
       def button = window.button('baseColBtn')
       def busyLabel = findBusyLabel()
       Color start = button.target.background
       Color busyStart = busyLabel.busyPainter.baseColor
       Assert.assertEquals(busyStart, start)

       button.target.background = Color.RED

       Assert.assertFalse(button.target.background == start)
       Assert.assertFalse(busyLabel.busyPainter.baseColor == busyStart)
       Assert.assertEquals(busyLabel.busyPainter.baseColor, Color.RED)
 }
</pre>
<p>Running the test suite takes less than a minute, and most of that time is spend dragging sliders. Those tests are presently going through the entire range of the slider, which is reassuring when actually watching the tests run, but probably overkill in terms of testing.  Considering that, running the test suite is pretty painless and quick(the new tests execute in &lt; 1s for instance). And of course the test results are available in the standard, pleasing, and hopefully all green, TestNG output. Which has, by the way, just <a href="http://beust.com/weblog/archives/000511.html">announced another release</a> thanks very much to its creator Cedric Beust.</p>
<p>I am still having some difficulties in responding to change events on the other sliders in the demo, but I think that I just need to decompose the parts into the MVC structure a little more coherently. In particular, when some sliders are moved, it should trigger some calculations and a repaint of the busy label to reflect the changes(not simple properties that can utilize binding directly).  While the original code declares the method inline, I&#8217;ve moved it to the controller class and run into some circular dependency problems between the components referenced therein &#8211; Component A needs Component B but it hasn&#8217;t been instantiated yet in the view, etc. It looks like what is happening is that the change listener is being triggered once when it is assigned to the component, which might be a problem anywhere in Swing/Groovy/Griffon/my implementation. My money is on my own impl, mostly based on the common sense that when you&#8217;re writing code in an unfamiliar area you&#8217;re bound to meet problems that don&#8217;t immediately suggest a solution.</p>
<p>We&#8217;ll just have to keep digging and see. <img src='http://www.kellyrob99.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="ngg-galleryoverview" id="ngg-gallery-2-261">

	<!-- Slideshow link -->
	<div class="slideshowlink">
		<a class="slideshowlink" href="http://www.kellyrob99.com/blog/2009/04/10/more-griffonfest-testing/?show=slide">
			[Show as slideshow]		</a>
	</div>

	<!-- Piclense link -->
	<div class="piclenselink">
		<a class="piclenselink" href="javascript:PicLensLite.start({feedUrl:'http://www.kellyrob99.com/blog/wp-content/plugins/nextgen-gallery/xml/media-rss.php?gid=2&amp;mode=gallery'});">
			[View with PicLens]		</a>
	</div>
	
	<!-- Thumbnails -->
		
	<div id="ngg-image-11" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.kellyrob99.com/blog/wp-content/gallery/griffonswingset/griffonswingset_jxcolorselectionbutton.png" title=" " class="shutterset_set_2" >
								<img title="griffonswingset_jxcolorselectionbutton.png" alt="griffonswingset_jxcolorselectionbutton.png" src="http://www.kellyrob99.com/blog/wp-content/gallery/griffonswingset/thumbs/thumbs_griffonswingset_jxcolorselectionbutton.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 		
	<div id="ngg-image-12" class="ngg-gallery-thumbnail-box"  >
		<div class="ngg-gallery-thumbnail" >
			<a href="http://www.kellyrob99.com/blog/wp-content/gallery/griffonswingset/griffonswingset_testng.png" title=" " class="shutterset_set_2" >
								<img title="griffonswingset_testng.png" alt="griffonswingset_testng.png" src="http://www.kellyrob99.com/blog/wp-content/gallery/griffonswingset/thumbs/thumbs_griffonswingset_testng.png" width="100" height="75" />
							</a>
		</div>
	</div>
	
		
 	 	
	<!-- Pagination -->
 	<div class='ngg-clear'></div>
 	
</div>


<p>Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/' rel='bookmark' title='Griffon SwingX Fest testing'>Griffon SwingX Fest testing</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/05/swingx-busy-label-demo-in-griffon/' rel='bookmark' title='SwingX busy label demo in Griffon and Groovy'>SwingX busy label demo in Griffon and Groovy</a></li>
<li><a href='http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/' rel='bookmark' title='A One Day Griffon Application/Presentation'>A One Day Griffon Application/Presentation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.kellyrob99.com/blog/2009/04/10/more-griffonfest-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Griffon SwingX Fest testing</title>
		<link>http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=griffon-swingx-fest-testing</link>
		<comments>http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 06:33:38 +0000</pubDate>
		<dc:creator>TheKaptain</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[fest]]></category>
		<category><![CDATA[Graphical user interface]]></category>
		<category><![CDATA[Griffon]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[SwingX]]></category>

		<guid isPermaLink="false">http://www.kellyrob99.com/blog/?p=236</guid>
		<description><![CDATA[This is the third installment of my Griffon SwingSet experiment. If you&#8217;re coming late to the party (and would like to know just what the heck I&#8217;m talking about) you can catch up by reading this and this. So the SwingX demo has 3 sliders that affect integer values on the JXBusyLabel. Using the Groovy [...]
Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/04/10/more-griffonfest-testing/' rel='bookmark' title='More Groovy/Griffon/FEST Testing'>More Groovy/Griffon/FEST Testing</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/05/swingx-busy-label-demo-in-griffon/' rel='bookmark' title='SwingX busy label demo in Griffon and Groovy'>SwingX busy label demo in Griffon and Groovy</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/' rel='bookmark' title='SwingSet on Griffon'>SwingSet on Griffon</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is the third installment of my Griffon SwingSet experiment. If you&#8217;re coming late to the party (and would like to know just what the heck I&#8217;m talking about) you can catch up by reading <a href="http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/">this</a> and <a href="http://www.kellyrob99.com/blog/2009/04/05/swingx-busy-la…emo-in-griffon/">this</a>.</p>
<p>So the SwingX demo has 3 sliders that affect integer values on the JXBusyLabel. Using the Groovy &#8216;bind&#8217; syntax, responding to changes in these events is simple to say the least.</p>
<p>And as promised in the last post, I&#8217;ve written some FEST tests to validate that everything is working as expected. Stay tuned to the end of the post to see a video of the running tests <img src='http://www.kellyrob99.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>FEST provides some convenience wrappers for UI elements that allows easy access to common operations. Looking up a JSlider in the UI for instance, returns a JSliderFixture object with a nice little &#8216;slideTo&#8217; method.<br />
First off, here are the UI components under test. Yes, this is the entire code, including all necessary wiring to trigger updates automagically as the sliders are changed.</p>
<pre class="brush: groovy; smart-tabs: true; title: ; notranslate">
speedSlider = slider(
        name: 'speedSlider',
        sliderModel: boundedRangeModel(
                min: 1, max: model.SPEED_MAX - 1, value: model.SPEED_MAX - 1, extent: 0),
        opaque: true)

slider = slider(
        name: 'slider',
        sliderModel: boundedRangeModel(
                min: 1, max: 50, value: 8, extent: 0), opaque: true)

tSlider = slider(
        name: 'tSlider',
        sliderModel: boundedRangeModel(
                min: 1, max: 20, value: 4, extent: 0), opaque: true)

label = jxbusyLabel(name: 'busyLabel',
        preferredSize: new Dimension(model.W / 2 as int, model.H / 2 as int),
        busyPainter: busyPainter(
                highlightColor: bind { model.busyColor }, baseColor: bind {model.baseColor},
                points: bind{slider.value}, trailLength: bind{tSlider.value}),
        opaque: false,
        horizontalAlignment: JLabel.CENTER,
        delay: bind{speedSlider.value})
........
buttons.addLine(button(name: model.START_NAME, action:startAction))
</pre>
<p>And then the tests run against them. Each test moves a slider sequentially from the minimum to the maximum values and checks at each change to ensure that the same change is reflected on the bound JXBusyLabel property. Because the JXBusyLabel does not have a ready corresponding FEST built in fixture class, we just look it up as a Component by inspecting the UI for the appropriate named Component. The Groovy dynamic type system makes accessing its internal properties trivial after that.</p>
<pre class="brush: groovy; smart-tabs: true; title: ; notranslate">
/**
   * Start the animation and then ensure that changing the speed slider changes the delay.
   */
   @Test void testSpeedSlider() {
     def button = window.button(JXBusyLabelDemoModel.START_NAME)
     button.click()
     def JSliderFixture slider = window.slider('speedSlider')
     ComponentFinder finder = BasicComponentFinder.finderWithCurrentAwtHierarchy();
     def busyLabel = finder.findByName(app.appFrames[0], 'busyLabel')
     Assert.assertNotNull(slider)
     Assert.assertNotNull(busyLabel)
     (1..JXBusyLabelDemoModel.SPEED_MAX - 1).each { speed -&gt;
       slider.slideTo(speed)
       Assert.assertEquals(busyLabel.delay, speed)
     }
   }

  /**
   * Start the animation and then ensure that changing the points slider changes the
   * number of points.
   */
   @Test void testPointsSlider() {
     def button = window.button(JXBusyLabelDemoModel.START_NAME)
     button.click()
     def JSliderFixture slider = window.slider('slider')
     ComponentFinder finder = BasicComponentFinder.finderWithCurrentAwtHierarchy();
     def busyLabel = finder.findByName(app.appFrames[0], 'busyLabel')
     Assert.assertNotNull(slider)
     Assert.assertNotNull(busyLabel)
     (1..50).each { points -&gt;
       slider.slideTo(points)
       Assert.assertEquals(busyLabel.busyPainter.points, points)
     }
   }

  /**
   * Start the animation and then ensure that changing the trail slider changes
   * the trailLength.
   */
   @Test void testTrailSlider() {
     def button = window.button(JXBusyLabelDemoModel.START_NAME)
     button.click()
     def JSliderFixture slider = window.slider('tSlider')
     ComponentFinder finder = BasicComponentFinder.finderWithCurrentAwtHierarchy();
     def busyLabel = finder.findByName(app.appFrames[0], 'busyLabel')
     Assert.assertNotNull(slider)
     Assert.assertNotNull(busyLabel)
     (1..20).each { trailLength -&gt;
       slider.slideTo(trailLength)
       Assert.assertEquals(busyLabel.busyPainter.trailLength, trailLength)
     }
   }
</pre>
<p>It&#8217;s particular amusing to note that the test code is more verbose than the Swing component setup. Man, after all of the Swing code I&#8217;ve written, WHY WAS NONE OF IT EVER THIS EASY!<br />
Sorry for the shouting, but it&#8217;s late and updating this code to use binding instead of change listeners AND writing the tests AND writing this blog post took all of about 45 minutes. So you&#8217;ll have to forgive me for getting excited and all.</p>
<p>Here is the promised video <a href="http://www.kellyrob99.com/blog/wp-content/uploads/2009/04/griffonswingxfesttesting.swf">showing the FEST test suite being run.</a>. Give it a second as the first round of tests(not shown in the code above) do a bunch of assertions to make sure that all of the expected Components can be found. Not terribly interesting to watch, but a great win for Java GUI testing!</p>
<p>Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/04/10/more-griffonfest-testing/' rel='bookmark' title='More Groovy/Griffon/FEST Testing'>More Groovy/Griffon/FEST Testing</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/05/swingx-busy-label-demo-in-griffon/' rel='bookmark' title='SwingX busy label demo in Griffon and Groovy'>SwingX busy label demo in Griffon and Groovy</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/' rel='bookmark' title='SwingSet on Griffon'>SwingSet on Griffon</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SwingSet on Griffon</title>
		<link>http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=swingset-on-griffon</link>
		<comments>http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 03:57:47 +0000</pubDate>
		<dc:creator>TheKaptain</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[cobertura]]></category>
		<category><![CDATA[fest]]></category>
		<category><![CDATA[Griffon]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Model-view-controller]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[SwingSet]]></category>

		<guid isPermaLink="false">http://www.kellyrob99.com/blog/?p=103</guid>
		<description><![CDATA[So as&#160; as learning experience, I&#8217;ve decided to try cutting the&#160; SwingSet demo application over to Groovy and Griffon. To make it a little more interesting, I&#8217;m going to base it off of the SwingX version. The SwingX widgets have been a pleasure to work with in the past, and with the swingX plugin, it [...]
Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/' rel='bookmark' title='Griffon SwingX Fest testing'>Griffon SwingX Fest testing</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/03/15/fun-day-playing-with-new-stuff/' rel='bookmark' title='Fun day playing with new Stuff'>Fun day playing with new Stuff</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/' rel='bookmark' title='VIJUG Griffon/Groovy Presentation'>VIJUG Griffon/Groovy Presentation</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So as&nbsp; as learning experience, I&#8217;ve decided to try cutting the&nbsp; <a href="https://swingset3.dev.java.net/">SwingSet demo application</a> over to Groovy and <a class="zem_slink" href="http://groovy.codehaus.org/Griffon" title="Griffon (framework)" rel="homepage">Griffon</a>. To make it a little more interesting, I&#8217;m going to base it off of the <a href="http://swinglabs.org/demos.jsp">SwingX version</a>.</p>
<p>The SwingX widgets have been a pleasure to work with in the past, and with the <a href="http://griffon.codehaus.org/SwingxBuilder+Plugin">swingX plugin</a>, it takes not a single line of extra code in order to use them.&nbsp; The underlying <a href="http://groovy.codehaus.org/SwingXBuilder">SwingXBuilder</a> provides factories which override the standard <a href="http://groovy.codehaus.org/Swing+Builder">SwingBuilder</a> syntax to replace the standard widget set with the SwingX equivalents. Simply add the prefix &#8216;jx&#8217; to the standard SwingBuilder node calls and you&#8217;re in business.</p>
<p>Along the way I&#8217;m going to incorporate the <a href="http://griffon.codehaus.org/Fest+Plugin">fest</a> and <a href="http://griffon.codehaus.org/CodeCoverage+Plugin">cobertura</a> plugins to test out the UI. I&#8217;ve never used fest before but it seems that the only real requirement is to remember to give your components a uniquely identifiable id. There are additional ways of looking up components with fest, for sure, but unique ids should cover this application&#8217;s needs quite nicely. Using both together is a simple exercise on the command line.</p>
<pre class="brush: groovy; title: ; notranslate">griffon run-fest -cobertura</pre>
<p>Under the hood, Griffon uses <a href="http://testng.org/doc/index.html">TestNG</a>, so the test class can also take advantage of some nice familiar annotations to assist configuration. Code coverage and testing results are provided by default in an html format, which anyone who likes their test coverage will be infinitely familiar with.&nbsp; All in all, the experience of setup and execution of the testing framework is pretty painless.</p>
<p>The SwingSet demo is actually laid out pretty nicely for testing in the first place. There&#8217; s a top level MainWindow class, which accepts a DemoPanel parameter. The full demo launches with a SwingXDemo subclass of DemoPanel that aggregates other subclasses of the same into a tabbed pane. Tests are free to call the MainWindow class with any of the individual panels as a parameter, so testing them on their own using fest looks like it would be a cinch.&nbsp; In Griffon terms this roughly translates to a root MVC group that composes another MVC group that is specified by id. Easier to show than to explain, with an example of a call that would go in the controller:</p>
<pre class="brush: groovy; title: ; notranslate">
createMVCGroup(mvcGroupIDParam, uid,   [... param map ...] )
</pre>
<p>The first thing created in the SwingSet UI is the menu, so that&#8217;s what I created first as well. In the view class:</p>
<pre class="brush: groovy; smart-tabs: true; title: ; notranslate">
 actions {
    action(id: &quot;quitAction&quot;,
            name: model.QUIT_NAME,
            mnemonic: &quot;Q&quot;,
            accelerator: shortcut(&quot;Q&quot;),
            closure: controller.quit)
  }

  menuBar {
    menu(model.MENU_NAME) {
      menuItem(name: model.QUIT_NAME, action:quitAction)
    }
  }
</pre>
<p>The component names are defined in the model class so that they can easily be extracted later for testing purposes.<br />
Including the fest plugin with Griffon adds a target which is used to create a new test, which will prompt you for a test name.</p>
<pre class="brush: groovy; title: ; notranslate">create-fest-test</pre>
<p>The new test class is created with all of the necessary code to let fest launch the base application frame. This first test is very simple, just making sure that our single menu item is present in the GUI.</p>
<pre class="brush: groovy; smart-tabs: true; title: ; notranslate">
  @Test
  void testQuitMenuItemPresent()
  {
    Assert.assertNotNull( window.menuItem(GriffonSwingSet3Model.QUIT_NAME) )
  }
</pre>
<p>That&#8217;s really all it takes to launch a new application using the test harness and verify UI component state. Man, can I think of a couple of times in the past where that might have come in handy <img src='http://www.kellyrob99.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Next, step is cutting over the first SwingSet DemoPanel, a demonstration of JXBusyLabel &#8211; 635 lines of the usual Swing inner classes and boilerplate GridBagLayout constraints code. Really looking forward to seeing how it looks in Groovy.</p>
<div class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/16488263-27eb-48d8-a2e7-387ff800c515/" title="Zemified by Zemanta"><img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_c.png?x-id=16488263-27eb-48d8-a2e7-387ff800c515" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
<p>Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/' rel='bookmark' title='Griffon SwingX Fest testing'>Griffon SwingX Fest testing</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/03/15/fun-day-playing-with-new-stuff/' rel='bookmark' title='Fun day playing with new Stuff'>Fun day playing with new Stuff</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/' rel='bookmark' title='VIJUG Griffon/Groovy Presentation'>VIJUG Griffon/Groovy Presentation</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The first two chapters of Griffon In Action</title>
		<link>http://www.kellyrob99.com/blog/2009/04/01/the-first-two-chapters-of-griffon-in-action/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-first-two-chapters-of-griffon-in-action</link>
		<comments>http://www.kellyrob99.com/blog/2009/04/01/the-first-two-chapters-of-griffon-in-action/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 06:32:52 +0000</pubDate>
		<dc:creator>TheKaptain</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Model-view-controller]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[SwingWorker]]></category>

		<guid isPermaLink="false">http://www.kellyrob99.com/blog/?p=84</guid>
		<description><![CDATA[Documentation up until now has been sparse to be sure, but judging by the first two chapters of the MEAP for Griffon in Action, this book is going to be worth every penny. I&#8217;ve experimented a bit with Griffon a bit lately, but still being somewhat of a Groovy noob, I don&#8217;t think that the [...]
Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/' rel='bookmark' title='VIJUG Griffon/Groovy Presentation'>VIJUG Griffon/Groovy Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/' rel='bookmark' title='SwingSet on Griffon'>SwingSet on Griffon</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/' rel='bookmark' title='Griffon SwingX Fest testing'>Griffon SwingX Fest testing</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Documentation up until now has been sparse to be sure, but judging by the first two chapters of the <a href="http://www.manning.com/about/meap.html">MEAP</a> for <a href="http://www.manning.com/almiray/">Griffon in Action</a>, this book is going to be worth every penny.</p>
<p>I&#8217;ve experimented a bit with <a class="zem_slink" title="Griffon (framework)" rel="homepage" href="http://groovy.codehaus.org/Griffon">Griffon</a> a bit lately, but still being somewhat of a <a href="http://groovy.codehaus.org/">Groovy</a> noob, I don&#8217;t think that the full impact hit me until I started reading the book. Maybe part of the problem is not that it&#8217;s hard to understand, but that it&#8217;s hard to believe that it&#8217;s so easy.</p>
<p>A very clearly defined way of separating the classic <a class="zem_slink" title="Model-view-controller" rel="wikipedia" href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a>. Injection of views, models, controllers &#8211; all available by convention not by annotation, xml configuration or even having to a refer to a component by name. The transparent access to a variety of builder actions through plugins makes a large toolset available with little or no cost. Clear architectural boundaries exist that guide you to where your code should be developed. The Griffon framework, created with gracious acknowledgement to its forerunner <a class="zem_slink" title="Grails (framework)" rel="homepage" href="http://grails.org">Grails</a> strives to do one thing above all &#8211; make Swing easy.</p>
<p>The power and versatility of Swing has always been obvious to me. The &#8216;magic sauce&#8217; that makes large scale Java Swing applications behave in any sane way has been a little more hazy. The advent of SwingWorker and other enhancements to the Swing toolset and the availability of better documentation have certainly made the landscape a lot more tolerable, but at the end of the day, it&#8217;s still hard to even find good examples of large Swing apps to use as a guideline(well at least it has been for me.) On the other side of the spectrum, I&#8217;m not sure there IS such a thing as a small Swing app. The amount of boilerplate code required is cumbersame, to say the least, and between anonymous inner classes for actions/listeners and correct handling of business logic and the <a class="zem_slink" title="Event dispatching thread" rel="wikipedia" href="http://en.wikipedia.org/wiki/Event_dispatching_thread">EDT</a> by the time you&#8217;ve finished doing anything moderately significant you&#8217;re already a couple 1000 lines in.</p>
<p>Griffon takes all that and hides it behind a curtain. Expanding on the already powerful SwingBuilder capabilities, it provides a quick and easy way to develop complex Swing applications. Utilizing @Binding to provide easy view/model interaction and baking the Observer pattern right into the framework make it beyond simple to deal with <a class="zem_slink" title="Graphical user interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Graphical_user_interface">GUI</a> events. And the pattern for dealing with EDT issues couldn&#8217;t be much more straightforward.</p>
<pre class="brush: groovy; title: ; notranslate">

doOutside {
.... do whatever you need to do off of the EDT
doLater { ... come back to the EDT when you're done to update widgets }
}
</pre>
<p>I&#8217;m pretty sure that&#8217;s an easy enough pattern that I will never again forget the cost of doing&#8230; well pretty much anything that takes +1 second while blocking the EDT.</p>
<p>Personally, I&#8217;ve run into a couple of unexpected results when trying to utilize the webstart version of the application, but other than that everything has worked exactly as advertised. And at the end of the day I&#8217;m willing to chalk that up to my misuse of the system. I&#8217;ll tell you for sure when I get to that chapter of the book. Which will probably be about 2 days after the authors publish it.</p>
<p> <img src='http://www.kellyrob99.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So far my impression of the pre-release chapters of the book are pretty good &#8211; well written, clear and above all &#8211; the code samples work. Kudos to the authors <a href="http://www.jroller.com/aalmiray/">Andres Almiray</a>,<a href="http://shemnon.com/speling/"> Danno Ferrin</a> and <a href="http://blogs.sun.com/geertjan/">Geertjan Wielenga</a>.&nbsp; Look forward to the rest of the book boys, and to writing some new Swing apps with Griffon!</p>
<div class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/07d75949-b8da-4090-a057-6c9c6b02b056/" title="Reblog this post [with Zemanta]"><img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_c.png?x-id=07d75949-b8da-4090-a057-6c9c6b02b056" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
<p>Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2009/08/27/vijug-griffongroovy-presentation/' rel='bookmark' title='VIJUG Griffon/Groovy Presentation'>VIJUG Griffon/Groovy Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/' rel='bookmark' title='SwingSet on Griffon'>SwingSet on Griffon</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/08/griffon-swingx-fest-testing/' rel='bookmark' title='Griffon SwingX Fest testing'>Griffon SwingX Fest testing</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.kellyrob99.com/blog/2009/04/01/the-first-two-chapters-of-griffon-in-action/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fun day playing with new Stuff</title>
		<link>http://www.kellyrob99.com/blog/2009/03/15/fun-day-playing-with-new-stuff/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fun-day-playing-with-new-stuff</link>
		<comments>http://www.kellyrob99.com/blog/2009/03/15/fun-day-playing-with-new-stuff/#comments</comments>
		<pubDate>Sun, 15 Mar 2009 19:56:46 +0000</pubDate>
		<dc:creator>TheKaptain</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Griffon]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Model-view-controller]]></category>
		<category><![CDATA[Swing]]></category>

		<guid isPermaLink="false">http://www.kellyrob99.com/blog/?p=50</guid>
		<description><![CDATA[Today was a pretty great day, I must say. I got a chance to work with the brand new Griffon framework and must say &#8211; the combination of clear MVC architecture, Grails style convention over configuration and already powerful plugin selection make it pretty sexy. The early support for cobertura code coverage and fest GUI [...]
Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/' rel='bookmark' title='A One Day Griffon Application/Presentation'>A One Day Griffon Application/Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/03/07/playing-with-the-new-grails/' rel='bookmark' title='Playing with the new Grails :)'>Playing with the new Grails :)</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/' rel='bookmark' title='SwingSet on Griffon'>SwingSet on Griffon</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today was a pretty great day, I must say.</p>
<p>I got a chance to work with the brand new <a class="zem_slink" title="Griffon (framework)" rel="homepage" href="http://groovy.codehaus.org/Griffon">Griffon</a> framework and must say &#8211; the combination of clear <a class="zem_slink" title="Model-view-controller" rel="wikipedia" href="http://en.wikipedia.org/wiki/Model-view-controller">MVC</a> architecture, <a class="zem_slink" title="Grails (framework)" rel="homepage" href="http://grails.org">Grails</a> style convention over configuration and already powerful plugin selection make it pretty sexy.</p>
<p>The early support for cobertura <a class="zem_slink" title="Code coverage" rel="wikipedia" href="http://en.wikipedia.org/wiki/Code_coverage">code coverage</a> and fest <a class="zem_slink" title="GUI software testing" rel="wikipedia" href="http://en.wikipedia.org/wiki/GUI_software_testing">GUI testing</a> are both appealing to any developer that appreciates the need for testing your application.  I&#8217;m still undecided on the Grails-like adoption of storing project information in a &#8220;.griffon&#8221; folder in the user directory and completely outside of the actual project directory structure. With luck, future versions will allow for incorporating maven to handle dependency management and get me past my FUD on that one, something that the latest Grails supports. I haven&#8217;t yet tried that new feature out in Grails out so I&#8217;m not entirely sure how well it works, but the docs say that there is a provided archetype and that all of the familiar Grails targets are <a href="http://www.grails.org/Maven+Integration">mirrored in the maven goals</a>.</p>
<p>Being able to add additional Groovy style builders as plugins is about as transparent as it gets &#8211; install the plugin and you can immediately incorporate that builder anywhere in the application.  The only builder component set that I have had a chance to work with previously is <a href="https://swingx.dev.java.net/">SwingX</a>, but anyone who&#8217;s had the opportunity to use a JXTable in place of the vanilla JTable can immediately see the advantage! And the JDirectoryChooser from <a href="http://www.l2fprod.com/">l2fprod</a> is a powerful alternative to the <a class="zem_slink" title="Swing (Java)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Swing_%28Java%29">Swing</a> built-in JFileChooser.</p>
<p>The crown jewel so far however seems to be  the <a href="http://griffon.codehaus.org/Wizard+Plugin">wizard plugin</a>. This addresses what is  a very common scenario in any process related application:</p>
<ul>
<li> collect User input in a series of steps</li>
<li>validate the input at each step</li>
<li>allow the User  to go back and review or change any inputs</li>
<li>apply all of the input to an underlying business process</li>
<li>provide feedback as to the result</li>
</ul>
<p>The <a href="https://wizard.dev.java.net/">wizard framework</a> worked pretty much as advertised right out of the box and, although the project seems to have stalled (couldn&#8217;t seem to  find any updates since mid-2008) , when integrated so well with Griffon it seems a very good candidate for building lightweight applications &#8211; installers in particular jump to mind.</p>
<p>Any way you look at it &#8211; for a project as newly arrived as Griffon, it&#8217;s already promising to be a very powerful enabler. Thanks to <a href="http://www.jroller.com/aalmiray/">Andres Almiray</a> and everyone else involved in the project. I look forward to using Griffon more in the future.</p>
<div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/a8105dd0-7c00-4551-8e80-5731041a87c6/"><img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_c.png?x-id=a8105dd0-7c00-4551-8e80-5731041a87c6" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<p>Related posts:<ol>
<li><a href='http://www.kellyrob99.com/blog/2010/02/11/a-one-day-griffon-applicationpresentation/' rel='bookmark' title='A One Day Griffon Application/Presentation'>A One Day Griffon Application/Presentation</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/03/07/playing-with-the-new-grails/' rel='bookmark' title='Playing with the new Grails :)'>Playing with the new Grails :)</a></li>
<li><a href='http://www.kellyrob99.com/blog/2009/04/03/swingset-on-griffon/' rel='bookmark' title='SwingSet on Griffon'>SwingSet on Griffon</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.kellyrob99.com/blog/2009/03/15/fun-day-playing-with-new-stuff/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

