<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2" -->
<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/"
	>

<channel>
	<title>Caffeine Induced Ramblings - Jasper Potts's Blog</title>
	<link>http://www.jasperpotts.com/blog</link>
	<description>Jasper Potts's Blog on Java and Life</description>
	<pubDate>Tue, 06 Jan 2009 18:19:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2</generator>
	<language>en</language>
			<item>
		<title>Presenting on JavaFX at IJTC 2008 - Irish Java Technologies Conference 2008</title>
		<link>http://www.jasperpotts.com/blog/2009/01/presenting-on-javafx-at-ijtc-2008-irish-java-technologies-conference-2008/</link>
		<comments>http://www.jasperpotts.com/blog/2009/01/presenting-on-javafx-at-ijtc-2008-irish-java-technologies-conference-2008/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 18:18:00 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[JavaFX]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2009/01/presenting-on-javafx-at-ijtc-2008-irish-java-technologies-conference-2008/</guid>
		<description><![CDATA[Sorry for the very late notice but if you are attending IJTC on January 7th then I am giving a presentation on JavaFX at 3:30pm so hope to see you all there. I will be posting the slides and demos from this talk and the Devoxx ones later this week so keep an eye out. 

]]></description>
			<content:encoded><![CDATA[<p>Sorry for the very late notice but if you are attending IJTC on January 7th then I am giving a presentation on JavaFX at 3:30pm so hope to see you all there. I will be posting the slides and demos from this talk and the Devoxx ones later this week so keep an eye out. </p>
<p><a href="http://ijtc.firstport.ie/"><img src="http://ijtc.firstport.ie/site_media/images/buttons/ijtc2008-speaker.jpg" alt="Speaker IJTC 2008" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2009/01/presenting-on-javafx-at-ijtc-2008-irish-java-technologies-conference-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Panorama Book</title>
		<link>http://www.jasperpotts.com/blog/2008/12/panorama-book/</link>
		<comments>http://www.jasperpotts.com/blog/2008/12/panorama-book/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 15:48:56 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2008/12/panorama-book/</guid>
		<description><![CDATA[I am proud to have one of my photographs published in a book of panoramas &#8220;Kolor PANOBOOK 2009&#8243; ISBN: 978-2-9533296-0-5. The photo was taken in August 2008 from the top of Coit Tower San Francisco and was 3 images taken though a tiny dirty window that were stitched together in AutoPano Pro. 
 
   
 
Click to see larger 
 
]]></description>
			<content:encoded><![CDATA[<p>I am proud to have one of my photographs published in a book of panoramas <a href="http://www.kolor.com/buy/book?id=4&amp;___store=eng&amp;___from_store=default" title="Buy Book">&#8220;Kolor PANOBOOK 2009&#8243;</a> ISBN: 978-2-9533296-0-5. The photo was taken in August 2008 from the top of Coit Tower San Francisco and was 3 images taken though a tiny dirty window that were stitched together in <a href="http://www.autopano.net/" title="Autopano Pro" target="_blank">AutoPano Pro</a>. 
<p style="text-align: center"> <img src="http://www.jasperpotts.com/blog/wp-content/uploads/2008/12/panorama-book-600px.png" alt="Panorama Book" /></p>
<p><a href="http://farm2.static.flickr.com/1218/1154189274_0bab41b32a_b.jpg" target="_blank"> </a><a href="http://farm2.static.flickr.com/1218/1154189274_0bab41b32a_b.jpg" target="_blank"></a><a href="http://farm2.static.flickr.com/1218/1154189274_0bab41b32a_b.jpg" target="_blank"> </a><a href="http://farm2.static.flickr.com/1218/1154189274_0bab41b32a_b.jpg" target="_blank"> </a><a href="http://farm2.static.flickr.com/1218/1154189274_0bab41b32a_b.jpg" target="_blank">
<p style="text-align: center"><img src="http://farm2.static.flickr.com/1218/1154189274_0bab41b32a.jpg?v=0" height="215" width="500" alt="San Francisco City" /> </p>
<p style="text-align: center; font-size: 10px">Click to see larger </p>
<p></a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2008/12/panorama-book/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Learning the JavaFX Language</title>
		<link>http://www.jasperpotts.com/blog/2008/12/learning-the-javafx-language/</link>
		<comments>http://www.jasperpotts.com/blog/2008/12/learning-the-javafx-language/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 14:13:45 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[JavaFX]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2008/12/learning-the-javafx-language/</guid>
		<description><![CDATA[I had the pain of learning JavaFX by example code, following the compiler mailing list, asking people and if all else fails digging in the source. Finnaly there is a great article that has every thing you need to know to get you started with the language in one easy to read page:
Experiments With JavaFX [...]]]></description>
			<content:encoded><![CDATA[<p>I had the pain of learning JavaFX by example code, following the compiler mailing list, asking people and if all else fails digging in the source. Finnaly there is a great article that has every thing you need to know to get you started with the language in one easy to read page:
<p align="center"><span style="font-size: 32px; font-weight: bold" class="Apple-style-span"><a href="http://www.ociweb.com/jnb/jnbDec2008.html" target="_blank"><span style="font-size: 32px; font-weight: bold">Experiments With JavaFX Script</span><br />
<br /><span style="font-size: 16px; font-weight: normal">by Weiqi Gao, Principal Software Engineer</span></a></span></p>
<p>Its highly recommended reading and I wish it was around when I was learning JavaFX. Its in by bookmarks bar for quick reference every time I can&#8217;t remember a bit of syntax. Hope it helps you to.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2008/12/learning-the-javafx-language/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Devoxx 2008</title>
		<link>http://www.jasperpotts.com/blog/2008/12/devoxx-2008/</link>
		<comments>http://www.jasperpotts.com/blog/2008/12/devoxx-2008/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 15:26:35 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[JavaFX]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2008/12/devoxx-2008/</guid>
		<description><![CDATA[I attended Devoxx formally JavaPolis this year for the first time and had a truly brilliant experience. Probably worked the hardest I ever have in my life with about 4 hours of sleep a night for a week and non-stop between, but was also hugely enjoyable. It was great to have a chance to show [...]]]></description>
			<content:encoded><![CDATA[<p>I attended <a href="http://devoxx.com">Devoxx</a> formally JavaPolis this year for the first time and had a truly brilliant experience. Probably worked the hardest I ever have in my life with about 4 hours of sleep a night for a week and non-stop between, but was also hugely enjoyable. It was great to have a chance to show JavaFX and feel the excitement we were generating around it. I finally got a chance to step back from the nitty details and try using it as a developer and see all the good points rather than the amount of work I still need to do to make everything perfect. Oh the pain of being a perfectionist <img src='http://www.jasperpotts.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . As well as talking in several sessions on JavaFX and demoing in the keynote I got the chance to build a couple of applications in FX during the week. It was fun to see just how fast you can put cool looking apps together in FX:</p>
<ul>
<li>Little image viewer app for our Java FX University session, I will post the source for this soon.<br />
<img src="http://www.jasperpotts.com/blog/wp-content/uploads/2008/12/imageviewer.jpg" alt="FX Image Viewer" /></li>
<li>We had a demo called &#8220;Swish&#8221; which we were going to show during the JavaFX keynote at Devoxx, someone suggested would it not be cool if we could create a Devoxx themed version of it, expecting a logo somewhere or something like that. Well it gave me a chance to put the JavaFX Production Suite through its paces and see what we could do. So a few hours later we had a full Devoxx themed version. The swish demo takes a bunch of graphics created in Photoshop along with animation paths drawn in Illustrator and animates them to make a cool little visual demo. The cool thing is you can take completely new graphics files as long as they follow the same basic form and create a completely new version of the application with no code changes needed.<br />
<img src="http://www.jasperpotts.com/blog/wp-content/uploads/2008/12/devoxx.jpg" alt="Devox Swish" /></li>
<li>After showing <a href="http://www.devoxx.com/display/JV08/Stephan+Janssen+-">Stephan Janssen</a> he suggested how cool it would be if we could replace the full backdrop behind the slides on the cinema screen. So a  second minimal version of Devoxx Swish in full 1080p HD was born which was projected on the full Cinema screen while people were entering/exiting the keynote and when the Beatbox artist Roxorloops was performing.<br />
<img src="http://www.jasperpotts.com/blog/wp-content/uploads/2008/12/devoxxhd.jpg" alt="Devoxx Swish HD" /></li>
<li>Next I got asked if we could put together a little application for the Sun Booth to select prize winners from a text file of names, so a couple of hours later we had it up and running spinning and zooming random names when the mouse was clicked.<br />
<img src="http://www.jasperpotts.com/blog/wp-content/uploads/2008/12/prize-draw.jpg" alt="Prize Draw" /><br />
Seemed to draw quite a crowd, or maybe it was just the cool prizes and free beer! <img src='http://www.jasperpotts.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<img src="http://www.jasperpotts.com/blog/wp-content/uploads/2008/12/prize-draw2.jpg" alt="Prize Draw 2" /></li>
<li>When I was creating the prize draw application I needed to work out the Spline interpreter numbers to make the names thud down. I ended up using <a href="http://www.jroller.com/gfx/entry/swing_demos_animations_and_swing">Romain Guy&#8217;s Spline Editor for Swing</a> which makes it nice and easy. So thought it was about time we had a JavaFX version, and it could not be too hard. So a couple hours and a couple hundred bind statements later we have a very cool little Spline Editor that lets you edit the spline and see the effect in real time then copy the code to paste into your JavaFX application.<br />
<img src="http://www.jasperpotts.com/blog/wp-content/uploads/2008/12/splineeditor.jpg" alt="Spline Editor" /><br />
If you would like to try it for your self click here: <a href="http://jasperpotts.com/blogfiles/splineeditor/Spline_Editor.jnlp" onclick="javascript:urchinTracker ('/blogfiles/splineeditor/Spline_Editor.jnlp');" title="Launch Spline Editor" target="_blank"><img src="/blogfiles/launch.jpg" align="absmiddle" border="0" /></a> you can also download the <a href="http://jasperpotts.com/blogfiles/splineeditor/src.zip" onclick="javascript:urchinTracker ('/blogfiles/splineeditor/src.zip');" title="Spline Editor Src" target="_blank">source Netbeans project</a>.</li>
</ul>
<p>I hope all of you who attended <a href="http://devoxx.com">Devoxx</a> this year had as much fun as I did and all of you who did not attend you really missed something great and hope to see you all there next year. I will be posting all the slides to our sessions here very soon. All the sessions were recorded and will be posted on <a href="http://www.parleys.com">www.parleys.com</a> at some point next year.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2008/12/devoxx-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nimbus UIManager UIDefaults</title>
		<link>http://www.jasperpotts.com/blog/2008/08/nimbus-uimanager-uidefaults/</link>
		<comments>http://www.jasperpotts.com/blog/2008/08/nimbus-uimanager-uidefaults/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 21:09:20 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[Nimbus]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2008/08/nimbus-uimanager-uidefaults/</guid>
		<description><![CDATA[Nimbus is completely configured by properties in the UIManager defaults table. In my last blog I showed a simple example of how to skin a single component. This gave you a sneak peek into the power of these properties. Lots of people have asked for a complete list of properties that can be set, well [...]]]></description>
			<content:encoded><![CDATA[<p>Nimbus is completely configured by properties in the UIManager defaults table. In my last blog I showed a simple example of how to skin a single component. This gave you a sneak peek into the power of these properties. Lots of people have asked for a complete list of properties that can be set, well its simple just grab <code>UIManager.getLookAndFeelDefaults()</code> and iterate over the contents of the map and print the keys and values and there you go. Well I am not that cruel so I did the work for you and will include a link to a complete table of them at the end. But before I get to that let me explain how they work.</p>
<p>Nimbus properties follow some rules and you can not only use the property keys that we have added in as default but you can create your own. Nimbus Look and Feel scans the UIDefaults table when ever you add a property with <code>UIManager.put(&lt;&lt;key&gt;&gt;,&lt;&lt;value&gt;&gt;)</code> then updates its internal state. When that new property matches the current state of the component it applies to then it will be applied to that component. Properties cascade like CSS and the most specific matching one is used.<br />
Example:</p>
<ul>
<li><code>foreground = Color.BLACK</code></li>
<li><code>Label.foreground = Color.BLUE</code></li>
<li><code>Label[Disabled].foreground = Color.GRAY</code></li>
<li><code>"SomeLabel"[Disabled].foreground = Color.WHITE</code></li>
</ul>
<p>In these examples <code>foreground</code> applies to the foreground of all regions of all components, <code>Label.foreground</code> applies to only Label components, <code>Label[Disabled].foreground</code> applies to only Label components in the Disabled state. <code>"SomeLabel"[Disabled].foreground</code> applies to all components named &#8220;SomeLabel&#8221; that are in the disabled state. Hopefully that also explains the different ways you can write a rule to match a Component. The only 2 cases that are not covered here are <code>Component.Region.foreground</code> which lets you specify a sub-region of a component and <code>ComponentA:ChildComponentB.foreground</code> which lets you specify a <code>ChildComponentB contained within ComponentA</code>. You can see many examples of these in the complete table below and then play with writing your own. For example you can use the &#8220;name&#8221; property of a component in a similar way to &#8220;class&#8221; in CSS, say naming a bunch of buttons &#8220;hotButton&#8221; and then specifying new rules for them in the defaults table. I already explained in my last blog how you can override the global defaults on a single instance bases which matches the &#8220;style&#8221; attribute with HTML CSS.</p>
<p>Colors in Nimbus are derived, which means there are a core set of colors which are constants and all the other colors are calculated from those. This means you can simply change those and the 1000s of other colors that are related and used in the painters will update to reflect the new base color. These colors are shown in the &#8220;Primary Colors&#8221; section of the table. The colors in the &#8220;Secondary Colors&#8221; section are derived from those in the &#8220;Primary Colors&#8221; section but themselves are used as the base colors for other colors. You may need to change the secondary colors to tweak the results of changing the primary ones if you are not happy with the results. You can you derived colors in your own code as well so that you colors can change when the primary colors change. This will allow you to make your application color theme-able idea for white label branding etc. The method you need is on <code>NimbusLookAndFeel</code> called <code>getDerivedColor</code> :</p>
<pre>
/**
 * Get a derived color, derived colors are shared instances and is color
 * value will change when its parent UIDefault color changes.
 *
 * @param uiDefaultParentName The parent UIDefault key
 * @param hOffset             The hue offset
 * @param sOffset             The saturation offset
 * @param bOffset             The brightness offset
 * @param aOffset             The alpha offset
 * @param uiResource          True if the derived color should be
 *                            UIResource, false if it should not be
 * @return The stored derived color
 */
public Color getDerivedColor(String uiDefaultParentName,
               float hOffset, float sOffset, float bOffset, int aOffset,
               boolean uiResource)
</pre>
<p>Hopefully the rest will make sense as you read though the table and look at all the examples. After that its just a matter of try playing with some and see what you can do. I hope you see that power in this that Richard Bair and I designed and hoped would be useful. The complete defaults properties table is way to big to include in this post so I have put it on a separate page.</p>
<ul>
<li> <a href="http://jasperpotts.com/blogfiles/nimbusdefaults/nimbus.html" title="Nimbus properties">Nimbus UIDefaults Properties List</a></li>
</ul>
<p>If you would like to see how I made this list, here is the code that creates the html.</p>
<table cellspacing="10" style="text-align: center">
<tr>
<td><a href="http://jasperpotts.com/blogfiles/nimbusdefaults/NimbusBrowser.java" onclick="javascript:urchinTracker ('/blogfiles/nimbusdefaults/NimbusBrowser.java');"><img src="http://www.jasperpotts.com/blog/wp-content/uploads/2007/11/java-icon.png" alt="Java Icon" border="0" /><br />NimbusBrowser.java</a></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2008/08/nimbus-uimanager-uidefaults/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Skinning a Slider with Nimbus</title>
		<link>http://www.jasperpotts.com/blog/2008/08/skinning-a-slider-with-nimbus/</link>
		<comments>http://www.jasperpotts.com/blog/2008/08/skinning-a-slider-with-nimbus/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 11:48:45 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[Nimbus]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2008/08/skinning-a-slider-with-nimbus/</guid>
		<description><![CDATA[So time for a example of how to skin a Swing JSlider using the Nimbus Look and Feel and some simple painting code. So this is what we get with the standard Nimbus look slider on a dark grey background.

All of the Nimbus skin comes from a set of properties in the UIManager defaults table. [...]]]></description>
			<content:encoded><![CDATA[<p>So time for a example of how to skin a Swing JSlider using the Nimbus Look and Feel and some simple painting code. So this is what we get with the standard Nimbus look slider on a dark grey background.</p>
<p><img src="http://www.jasperpotts.com/blog/wp-content/uploads/2008/08/slider-default.png" alt="Slider Default Look" /></p>
<p>All of the Nimbus skin comes from a set of properties in the UIManager defaults table. The keys we will be changing for this example are:
<ul>
<li>&#8220;Slider.thumbWidth&#8221;</li>
<li>&#8220;Slider.thumbHeight&#8221;</li>
<li>&#8220;Slider:SliderThumb.backgroundPainter&#8221;</li>
<li>&#8220;Slider:SliderTrack.backgroundPainter&#8221; </li>
</ul>
<p>You can customize the look for a Component either globally for all instances of the component or locally for a single component instance.  To change all sliders globally you can set these properties using UIManager.put(key,value) but in this example I will just set them locally for a single slider. To set UI defaults localy for a single component instance you need to create a UIDefaults map, insert you properties and then set it as a client property on the component:</p>
<p>
<pre>
                JSlider slider = new JSlider(0, 100, 50);
                UIDefaults sliderDefaults = new UIDefaults();
                ....
                sliderDefaults.put(&lt;&lt;key&gt;&gt;,&lt;&lt;value&gt;&gt;)
                ....
                slider.putClientProperty("Nimbus.Overrides",sliderDefaults);
                slider.putClientProperty("Nimbus.Overrides.InheritDefaults",false);
</pre>
</p>
<p>The  &#8220;Nimbus.Overrides.InheritDefaults&#8221; key states if the values in &#8220;Nimbus.Overrides&#8221; should be merged with the defaults(false) or replace them(true). So next some examples for what properties we should set to skin the slider:</p>
<p>
<pre>
                sliderDefaults.put("Slider.thumbWidth", 20);
                sliderDefaults.put("Slider.thumbHeight", 20);
                sliderDefaults.put("Slider:SliderThumb.backgroundPainter", new Painter<JComponent>() {
                    public void paint(Graphics2D g, JComponent c, int w, int h) {
                        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                        g.setStroke(new BasicStroke(2f));
                        g.setColor(Color.RED);
                        g.fillOval(1, 1, w-3, h-3);
                        g.setColor(Color.WHITE);
                        g.drawOval(1, 1, w-3, h-3);
                    }
                });
                sliderDefaults.put(&#8221;Slider:SliderTrack.backgroundPainter&#8221;, new Painter<JComponent>() {
                    public void paint(Graphics2D g, JComponent c, int w, int h) {
                        g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                        g.setStroke(new BasicStroke(2f));
                        g.setColor(Color.GRAY);
                        g.fillRoundRect(0, 6, w-1, 8, 8, 8);
                        g.setColor(Color.WHITE);
                        g.drawRoundRect(0, 6, w-1, 8, 8, 8);
                    }
                });
</pre>
</p>
<p>The lets pop that code into a sample app and run it and see what it looks like.</p>
<p><img src='http://www.jasperpotts.com/blog/wp-content/uploads/2008/08/slider-demo.png' alt='Slider Demo' /></p>
<p>The original Nimbus slider on the bottom and the skinned one on top, both running in the same application. Here is the source so you can try it your self. Let me know if this was useful and what other examples you would like to see.</p>
<table cellspacing="10" style="text-align: center">
<tr>
<td><a href="http://jasperpotts.com/blogfiles/SliderSkinDemo.java" onclick="javascript:urchinTracker ('/blogfiles/SliderSkinDemo.java');"><img src="http://www.jasperpotts.com/blog/wp-content/uploads/2007/11/java-icon.png" alt="Java Icon" border="0" /><br />SliderSkinDemo.java</a></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2008/08/skinning-a-slider-with-nimbus/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A very late &#8220;Nimbus is Done&#8221; blog!</title>
		<link>http://www.jasperpotts.com/blog/2008/08/a-very-late-nimbus-is-done-blog/</link>
		<comments>http://www.jasperpotts.com/blog/2008/08/a-very-late-nimbus-is-done-blog/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 10:44:28 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[Nimbus]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2008/08/a-very-late-nimbus-is-done-blog/</guid>
		<description><![CDATA[Wow its been crazy, we have finally finished Nimbus for 6u10 and release candidate is out there Java 6u10 RC Download, have done Java One and I am now knee deep in Java FX. I have about 10 half completed blogs and just never seem to find the time to finish them. As well as being [...]]]></description>
			<content:encoded><![CDATA[<p>Wow its been crazy, we have finally finished Nimbus for 6u10 and release candidate is out there <a href="http://java.sun.com/javase/downloads/ea.jsp" title="Java 6u10 RC Download" target="_blank">Java 6u10 RC Download</a>, have done Java One and I am now knee deep in Java FX. I have about 10 half completed blogs and just never seem to find the time to finish them. As well as being mega busy with Nimbus and Java FX I have just moved back from California to the UK. Moving is always way too time consuming and expensive.</p>
<p>If you missed our talk and BOF at Java One this year here are the presentations:</p>
<p><a href="http://www.jasperpotts.com/blog/wp-content/uploads/2008/08/ps_ts-6096-nimbus.pdf" title="Java One 2008 Nimbus Talk PDF">Java One 2008 Nimbus Talk PDF</a></p>
<p><a href="http://www.jasperpotts.com/blog/wp-content/uploads/2008/08/nimbus-bof.pdf" title="Java One 2008 Nimbus BOF Presentation PDF">Java One 2008 Nimbus BOF Presentation PDF</a></p>
<p>A lot of you have been asking about the Nimbus Designer Tool that I demoed at Java One. I have been working at getting it opensourced but it is a slow bureaucratic process so I am sorry. In the mean time I thought I would try and do a couple blogs on how you can skin Nimbus your self with out the tool. It is very easy to do providing you are not worried about getting your hands dirty writing some Java 2D drawing code. You could always use images or a SVG library if you don&#8217;t fancy raw Java 2D. I would like to split the designer tool into 2 parts the first part the lets you create a Painter classes with Java 2D drawing code by drawing graphics. The second part would let you assign painters to components and generate the code to populate the UIManager defaults table. But both those parts are not hard to do your self if we help you get started so I will see what I can do.</p>
<p>So just a quick hello to say I am still alive, next to try and post a couple blogs on how to skin Nimbus.</p>
<p><img src="http://www.jasperpotts.com/blog/wp-content/uploads/2008/07/swingset.png" alt="SwingSet 3 with Nimbus" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2008/08/a-very-late-nimbus-is-done-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Panoramas &#038; Holidays</title>
		<link>http://www.jasperpotts.com/blog/2008/01/panoramas-holidays/</link>
		<comments>http://www.jasperpotts.com/blog/2008/01/panoramas-holidays/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 08:52:27 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[Photography]]></category>

		<category><![CDATA[Personal]]></category>

		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2008/01/panoramas-holidays/</guid>
		<description><![CDATA[A few years ago I found a great site Breaking the Gigapixel Barrier about creating Giga-Pixel photos by stitching 100s of normal SLR photos together. Some people have pushed this even further with a 13 Gigapixel photo of Harlem with over 2000 photos. So my Christmas present from my wife was a new tripod and [...]]]></description>
			<content:encoded><![CDATA[<p>A few years ago I found a great site <a href="http://www.tawbaware.com/maxlyons/gigapixel.htm" title="Braking the gigapixel barrier">Breaking the Gigapixel Barrier</a> about creating Giga-Pixel photos by stitching 100s of normal SLR photos together. Some people have pushed this even further with a <a href="http://www.harlem-13-gigapixels.com/" title="13 Gigapixel">13 Gigapixel photo of Harlem</a> with over 2000 photos. So my Christmas present from my wife was a new tripod and indexing head so I can take photos every 5 degrees. As  my wife and I went to Las Vegas and the Grand Canyon over the holidays it was a great opportunity to try to take my first Gigapixel photo. My wife has written a blog with entertaining tales of our travels <a href="http://www.fionapotts.com/content/2007/12/29/christmas/" title="Fionas chirstmas blog">fionapotts.com</a>. Well I did not break the Giga-Pixel barrier I managed to get to 733Mpix.</p>
<p align="center"><a href="http://www.jasperpotts.com/blog/photos/?section=panos" title="Panoramas"><img src="http://www.jasperpotts.com/panos/Grand%20Canyon%20733Mpix/thumb60.jpg" title="Grand Canyon" alt="Grand Canyon" border="0" height="60" width="352" /><br />
Grand Canyon 733Mpix</a></p>
<p>Its 127 12Mpix images stitched together in 3 rows every 5 degrees using a 300mm zoom lens. After some research and experimenting with different software for joining all the photos the best I found was <a href="http://www.autopano.net/">Autopano Pro </a>which rocks at auto detecting matching points in each photo and stitching and blending all the photos together. You can check out my results and other photos from our trip on my updated <a href="http://www.jasperpotts.com/blog/photos/" title="My photos">Photos Page</a>. I took about 10 panoramas of the Grand Canyon including some HDR (High Dynamic Range) ones with 3 bracketed exposures per photo. Autopano Pro has support for stitching HDR panos but I did not have much luck as the was clear banding from photo to photo.  If any of you have any tips on how to stitch HDR panos I would love to here. Well its been a fun break, back to fixing the last pre-beta Nimbus bugs tomorrow.</p>
<p align="center"><a href="http://www.jasperpotts.com/blog/photos/?photoset=72157603565009900" title="Vegas Photos"><img src="http://farm3.static.flickr.com/2299/2144309814_620b575b4f.jpg" title="Hover Dam" alt="Hover Dam" border="0" height="228" width="500" /><br />
Hoover Dam </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2008/01/panoramas-holidays/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nimbus: Large, Small, Mini Components</title>
		<link>http://www.jasperpotts.com/blog/2007/12/nimbus-large-small-mini-components/</link>
		<comments>http://www.jasperpotts.com/blog/2007/12/nimbus-large-small-mini-components/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 18:56:23 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[Nimbus]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2007/12/nimbus-large-small-mini-components/</guid>
		<description><![CDATA[In the original design for Nimbus there were large,small and mini versions of components. Small and mini components are very useful when you are creating tool pallets or other UI where space is very tight. Apple recently added this to their new look and feel in the latest java versions see Technical Note TN2196. We are [...]]]></description>
			<content:encoded><![CDATA[<p>In the original design for Nimbus there were large,small and mini versions of components. Small and mini components are very useful when you are creating tool pallets or other UI where space is very tight. Apple recently added this to their new look and feel in the latest java versions see <a href="http://developer.apple.com/technotes/tn2007/tn2196.html#SMALL_MINI" target="_blank" title="Technical Note TN2196">Technical Note TN2196</a>. We are using the same client property key and values as Apple to be compatible but I have also added &#8220;large&#8221; as a option. Not sure &#8220;large&#8221; is as useful as &#8220;small&#8221; or &#8220;mini&#8221; but might look good in wizards or dialogs. Check out the screenshot to see how they look. <a href="http://www.jasperpotts.com/blog/wp-content/uploads/2007/12/small-mini.png"><img src="http://www.jasperpotts.com/blog/wp-content/uploads/2007/12/small-mini-600.png" border="0" alt="Nimbus Small Mini 600" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2007/12/nimbus-large-small-mini-components/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Faster Swing Lists and Tables up to 88,000x</title>
		<link>http://www.jasperpotts.com/blog/2007/11/faster-swing-lists-and-tables-upto-88000x/</link>
		<comments>http://www.jasperpotts.com/blog/2007/11/faster-swing-lists-and-tables-upto-88000x/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 02:48:09 +0000</pubDate>
		<dc:creator>Jasper Potts</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.jasperpotts.com/blog/2007/11/faster-swing-lists-and-tables-upto-88000x/</guid>
		<description><![CDATA[ Swing lists and tables use an implementation of ListSelectionModel to handle keeping track of the selection. Every time you change the selection or rows then the component sends those changes to the selection model to keep it in sync. The default implementation that you get is DefaultListSelectionModel. Its implmentation is highly optimized for certain [...]]]></description>
			<content:encoded><![CDATA[<p> Swing lists and tables use an implementation of ListSelectionModel to handle keeping track of the selection. Every time you change the selection or rows then the component sends those changes to the selection model to keep it in sync. The default implementation that you get is DefaultListSelectionModel. Its implmentation is highly optimized for certain kinds of operations but has had to make comprimizes for a some other operations.</p>
<p>Back when I was doing Imagery I created an alternative implementation of ListSelectionModel because I needed an easy way to convert the selection into a SQL where clause. After much thought I came up with the idea of representing the selection as a list of ranges of selected ids. This means that you can then convert the selection into a list of <code>"id >= rangeMin AND id <= rangeMax"</code> SQL expressions. This solution is well suited to the case where the selection is created by the user. The only way for a user to create more than one range is to &#8220;Control&#8221; click the rows. It is unlikely that the user will ever select more than a couple dozen ranges. This results in a model that is always simple however many rows there are in the List/Table. As a by product of this alternative selection model can be up to 88,000x faster than the default with large amounts of rows. I have put together a couple of JUnit tests, one does a huge amount of random operations on both a DefaultListSelectionModel and a RangeListSelectionModel and compares the results at each stage. This means that I can be very sure that my implementation is fully compatible with the default one. The second unit test does some performance tests to compare the two models. The data set is 1,000,000 rows and 20,000 operations for each test<br />
<h3>Performance Results</h3>
<p></p>
<table bgcolor="#EEEEEE" cellpadding="2">
<tr bgcolor="#DDDDDD">
<th>Test</th>
<th>Default Model</th>
<th>Ranges Model</th>
<th>Perfomance Gain</th>
</tr>
<tr>
<td>Add selection interval</td>
<td>0.017 s</td>
<td>2.533 s</td>
<td>-149x</td>
</tr>
<tr>
<td>Is selected index</td>
<td>0.009 s</td>
<td>0.011 s</td>
<td>-1.2x</td>
</tr>
<tr>
<td>Remove index interval</td>
<td>16:09 min</td>
<td>0.011 s</td>
<td style="color:#FF0000">88,053x</td>
</tr>
<tr>
<td>Set selected item</td>
<td>1:30 min</td>
<td>0.067 s</td>
<td style="color:#FF0000">1405x</td>
</tr>
<tr>
<td>20k Random Operations</td>
<td>4:25 min</td>
<td>0.055 s</td>
<td style="color:#FF0000">4810x</td>
</tr>
<tr>
<td>Average</td>
<td></td>
<td></td>
<td style="color:#FF0000;font-weight:bold">18,823x</td>
</tr>
</table>
<p>As you can see from the results that it is a large win on average. The test that it is slow at is AddSelectionInterval this is because it ends up with 17482 ranges. This should never happen in most real world applications, the only way I can see it happen is if you select all table rows that meet some search criteria which results in 1000s of random rows being selected. In all cases where the selection is user controlled then this will never happen.<br />
<h3>Conclusion</h3>
<p>I have seen bug reports coming in of hugely bad JTable performance when adding/removing rows from a huge table. After profiling I found that it was the SelectionModel causing the problems. You can see from the performance results that it can take minutes to do a large chunk of selection changes on a big table. So please try out my Ranges implementation in your application and tell me how it performs. If the responses are good I could change it to the default ListSelectionModel implementation in Java 7. To use it you just need to add the line &#8220;<code>myTable.setSelectionModel(new RangeListSelectionModel());</code>&#8220;.</p>
<h3>Code Downloads</h3>
<p>Here are the sources so you can try it out for yourself:</p>
<table style="text-align:center" cellspacing="10">
<tr>
<td><a href="http://jasperpotts.com/blogfiles/RangeListSelectionModel.java" onClick="javascript:urchinTracker ('/blogfiles/RangeListSelectionModel.java');"><img border="0" src='http://www.jasperpotts.com/blog/wp-content/uploads/2007/11/java-icon.png' alt='Java Icon' /><br />
RangeListSelectionModel.java</a></td>
<td><a href="http://jasperpotts.com/blogfiles/RangeSelectionModelPerformanceTest.java" onClick="javascript:urchinTracker ('/blogfiles/RangeSelectionModelPerformanceTest.java');"><img border="0" src='http://www.jasperpotts.com/blog/wp-content/uploads/2007/11/java-icon.png' alt='Java Icon' /><br />
RangeSelectionModelPerformanceTest.java</a></td>
<td><a href="http://jasperpotts.com/blogfiles/RangeSelectionModelTest.java" onClick="javascript:urchinTracker ('/blogfiles/RangeSelectionModelTest.java');"><img border="0" src='http://www.jasperpotts.com/blog/wp-content/uploads/2007/11/java-icon.png' alt='Java Icon' /><br />
RangeSelectionModelTest.java</a></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.jasperpotts.com/blog/2007/11/faster-swing-lists-and-tables-upto-88000x/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
