<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Synchronous Messages &#187; JavaFX</title>
	<atom:link href="http://stuartmarks.wordpress.com/category/javafx/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuartmarks.wordpress.com</link>
	<description>Stuart Marks on Java, Software Systems, and other topics</description>
	<lastBuildDate>Mon, 05 Dec 2011 02:14:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='stuartmarks.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Synchronous Messages &#187; JavaFX</title>
		<link>http://stuartmarks.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://stuartmarks.wordpress.com/osd.xml" title="Synchronous Messages" />
	<atom:link rel='hub' href='http://stuartmarks.wordpress.com/?pushpress=hub'/>
		<item>
		<title>JavaOne day 4, recap and commentary</title>
		<link>http://stuartmarks.wordpress.com/2010/09/23/javaone-day-4-recap-and-commentary/</link>
		<comments>http://stuartmarks.wordpress.com/2010/09/23/javaone-day-4-recap-and-commentary/#comments</comments>
		<pubDate>Fri, 24 Sep 2010 07:31:18 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://stuartmarks.wordpress.com/?p=314</guid>
		<description><![CDATA[JavaOne is over! But before we cover the last day, back to day 3. I&#8217;m still marveling about the Treasure Island party. Terri Nunn of Berlin said that &#8220;Oracle gives the best f*****g corporate parties!&#8221; and she&#8217;s probably right. I have never been to a corporate party on this scale, well, except for last year&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=314&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>JavaOne is over! But before we cover the last day, back to day 3.</p>
<p>I&#8217;m still marveling about the Treasure Island party. Terri Nunn of Berlin said that &#8220;Oracle gives the best f*****g corporate parties!&#8221; and she&#8217;s probably right. I have never been to a corporate party on this scale, well, except for last year&#8217;s Oracle party. In fact, I&#8217;ve never been to a party of any kind that big, ever.</p>
<p>There were almost too many bands. I would have liked to have seen the English Beat but they played early and by the time we got onto the island the set was almost over. We heard some of Berlin but we were trying to get food at the time. I caught most of Don Henley&#8217;s set, which was great. Like all of us, he&#8217;s getting older, but he seems to be taking care of his voice. He sounded pretty good. I popped over to see the Black Eyed Peas for a little bit, but I just don&#8217;t <em>get</em> them. I&#8217;m really out of touch. When people started talking about Fergie I thought &#8220;What does the Duchess of York have to do with this?&#8221;</p>
<p>* * *</p>
<p>Looks like highlights videos from the keynotes are up on the web now. Check out <a href="http://medianetwork.oracle.com" target="_blank">http://medianetwork.oracle.com</a> and click on <strong>News and Events</strong> and then choose <strong>JavaOne</strong> or <strong>Oracle OpenWorld</strong>.</p>
<p>* * *</p>
<p>We had <strong>another</strong> fabulous lunch at <a href="http://www.henryshunanrestaurant.com/" target="_blank">Henry&#8217;s Hunan</a>!</p>
<p>* * *</p>
<p>Today&#8217;s sessions included <em>Hardcore CSS</em> with Rich Bair and Jasper Potts. I knew most of this stuff since I did my share of work on it in JavaFX, and I wrote a bunch of the <a href="http://download.oracle.com/docs/cd/E17802_01/javafx/javafx/1.3/docs/api/javafx.scene/doc-files/cssref.html" target="_blank">manual</a>, but I wanted to be there and show support for the team. The power of using CSS to control region backgrounds and borders and shapes is really amazing and I give Rich and Jasper a lot of credit for thinking it up and implementing most of it.</p>
<p>I also attended <em>Rich GUI Testing Made Easy</em> given by my colleague <a href="http://alexruiz.developerblogs.com/" target="_blank">Alex Ruiz</a> and Yvonne Price. The talk was basically about using the <a href="http://fest.easytesting.org/" target="_blank">FEST</a> to test Swing GUIs. The code was a bit small to read but I picked up on a few key concepts.</p>
<p>The last session I attended was <em>Concurrency Grab Bag</em> by Sanjin Lee of eBay. This was a discussion of various concurrency issues and &#8220;gotchas&#8221; they&#8217;ve run into at eBay. I was familiar with most of the material already but it was good to see a treatment of the material rooted in practice, as compared to the somewhat more academic approach from people like Goetz and Lea. I&#8217;d have thought that the conference was winding down at that point, but the session was <strong>packed</strong> and there were lots of questions. In fact, I think this was a repeat performance of the talk. The earlier one was probably so popular that they had to schedule a repeat session. [<strong>Update</strong>: slides <a href="http://www.slideshare.net/sjlee0/concurrency-grabbag-final" target="_blank">here</a>.]</p>
<p>This session was in fact in the last session slot of the conference. The audio tech put on Scott McKenzie&#8217;s <em>San Francisco (Be Sure to Wear Flowers in Your Hair)</em> as people were leaving the room, which I thought was a nice touch.</p>
<p>* * *</p>
<p>I usually find the end of a conference a bit melancholy, as people drift away, take off early to catch their planes, leaving the final sessions sparsely attended and the conference center lonely and empty. This was a bit different. The conference hotels were as crowded as ever, buzzing with new batches of tourists, business travelers, airline staffs, etc. checking in.</p>
<p>Workers were scurrying about tearing down all the JavaOne and OpenWorld paraphernalia. A few JavaOne attendees were hanging around. It was pretty easy to spot them: developers&#8217; sense of fashion contrasted sharply with the snappy Japanese airline crew uniforms and with the trendy European tourists. Oh, the laptops helped give it away too. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I wandered around a bit longer but it was clear that there was nothing left for me to do but go home.</p>
<p>On that note it&#8217;s time for me to recap of my impressions of the conference.</p>
<p>This JavaOne was unique in many ways, not only because it was the first run by Oracle, but because it was the first not in Moscone. Sure, there were activities and events and keynotes at Moscone, but those were primarily OpenWorld events. JavaOne itself took place in two conference hotels, the Hilton Union Square and the Parc 55. (The third conference hotel, the Nikko, seemed dedicated to Oracle Develop sessions.)</p>
<p>I have to say that I didn&#8217;t like having the conference in the hotels. Even within the same hotel, the rooms were fairly spread out. Then there was the matter of getting between the hotels. It seemed like you were forever going through the back door to get in. At the Hilton, you either walked in through the garage or you used the employee entrance! (But the latter made it easy to punch your Hilton employee time card on the way to the next session.) The hallways were narrow and between sessions they were quite crowded with people trying to get from one area to another.</p>
<p>The rooms were all too small and so they filled up quickly &#8212; too quickly. As an Oracle employee I couldn&#8217;t reserve places in the session rooms. This was irritating but understandable &#8212; paid conference attendees should indeed have priority. But I also heard that even paid attendees had trouble getting in. Some popular sessions were filled even before the conference started.</p>
<p>Since the conference was spread out, there were no obvious gathering places like there were in Moscone, like the movie/game area upstairs in Moscone South or the beanbag area downstairs in Moscone North. If you hung out in one of those places for a few minutes, you&#8217;d be <strong>guaranteed</strong> to see someone you knew and hadn&#8217;t seen since last year&#8217;s conference. This kind of networking is what conferences are all about! In the hotel setup, the foot traffic all led through various rabbit warrens of corridors, so there was no central gathering place or main artery of traffic. Things just seemed all scattered and disorganized and it was really hard to find people. There were people I knew were at the conference, but I just never ran into them. That didn&#8217;t seem to happen before.</p>
<p>It&#8217;s not at all clear to me that there is any benefit of combining OpenWorld and Oracle Develop with JavaOne. (With the possible exception of JavaOne attendees getting to attend the Treasure Island event.) I don&#8217;t know if there was any cross-pollination. The only JavaOne things at Moscone were a couple keynotes; everything else there was OpenWorld stuff the suits attended. Also, as I mentioned, Oracle Develop seemed segregated in the Nikko. The only effect that combining the conferences had was to make things more crowded and expensive and to push JavaOne out of Moscone.</p>
<p>The technical program seemed a little flat as well this year. Maybe this was because there were some talks I wasn&#8217;t able to attend because they were full. It also might have been because of Google&#8217;s last-minute pullout. I heard they had 13 sesssions and 6 BOFs. But I also think it&#8217;s because of a development slowdown caused by the waning days of Sun and the transition to Oracle. It took a lot of energy to get through that, and a lot of people left before and during the transition, so that took away from developing stuff that could have been presented at the conference. A lot of plans and roadmaps were announced, and there seems to be renewed momentum around Java development at Oracle, so let&#8217;s hope this will lead to more material for next year&#8217;s program.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/314/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/314/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/314/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=314&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2010/09/23/javaone-day-4-recap-and-commentary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaOne 2010 day 3 update</title>
		<link>http://stuartmarks.wordpress.com/2010/09/23/javaone-2010-day-3-update/</link>
		<comments>http://stuartmarks.wordpress.com/2010/09/23/javaone-2010-day-3-update/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 19:41:07 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://stuartmarks.wordpress.com/?p=306</guid>
		<description><![CDATA[One thing I forgot to mention from day 2: the technical general session with Mark Reinhold and others. I was mainly interested in Reinhold&#8217;s stuff. He gave a brief overview of JDK7 and JDK8 roadmaps, including some interesting background on closures (the Lambda project) and default methods. Unfortunately this stuff won&#8217;t be in until JDK8 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=306&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>One thing I forgot to mention from day 2: the technical general session with Mark Reinhold and others. I was mainly interested in Reinhold&#8217;s stuff. He gave a brief overview of JDK7 and JDK8 roadmaps, including some interesting background on closures (the <em>Lambda</em> project) and default methods. Unfortunately this stuff won&#8217;t be in until JDK8 (2012). It&#8217;s notable how much closures have evolved from the CICE and BGGA proposals that have kicked around for a couple years, though the current Lambda proposal bears some resemblance to CICE to my eye.</p>
<p>* * *</p>
<p>I attended a Java Desktop lunch at Anzu. There were about 30 people there, including lots of FX folks, but also lots of others, including a special surprise appearance from James Gosling! James isn&#8217;t officially at the conference but is hanging around and meeting with lots of people. After his departure from Oracle he&#8217;s turned into a bit of a rabble rouser. See his <a href="http://www.eweek.com/c/a/Application-Development/Java-Creator-James-Gosling-Why-I-Quit-Oracle-813517/" target="_blank">eWeek interview</a> for example.</p>
<p>* * *</p>
<p><a href="http://steveonjava.com/" target="_blank">Stephen Chin</a> and <a href="http://pleasingsoftware.blogspot.com/" target="_blank">Dean Iverson</a> had a BOF on <a href="http://jfxtras.org/" target="_blank">JFXtras</a>. Historically the role of the JFXtras project has been to fill in the gaps and to add &#8220;extra&#8221; features that aren&#8217;t in the core JavaFX platform. With the transition of JavaFX from JavaFX Script to Java as the main API and implementation language, the role of the JFXtras project will change. Specifically, Steve announced an initiative to continue the development and evolution of the JavaFX Script language in open source, and eventually to rehost it on top of the new Java-based JavaFX APIs when they are delivered. Steve already has a grab bag of features he wants to add to the language, such as a map type and the ability to bind over a key in a map (even if it&#8217;s not yet present in the map). Steve&#8217;s provisional name for the project is &#8220;Visage.&#8221; He doesn&#8217;t have a site up yet for this effort, but keep an eye on his <a href="http://steveonjava.com/" target="_blank">blog</a>. I&#8217;ll update this post with links when they become available.</p>
<p>* * *</p>
<p>Kevin Rushforth and Jim Graham gave a talk on JavaFX Graphics. They gave an overview of the scene graph along with some information about JavaFX 3D capabilities that will be in the next release. They had some cool demos too, including a few snippets and behind-the-scenes information about the FX demo that was shown during Thomas Kurian&#8217;s JavaOne keynote. Kevin and Jim also showed some other, more pedestrian demos, some of which were based on my <a href="http://www.smarks.org/svjugfx20100414/flood.html" target="_blank">Flood Game</a> sample program. Thanks for the shout-out, Kevin!</p>
<p>* * *</p>
<p>Of course, no JavaOne day 3 update would be complete without a description of the Oracle Appreciation party (&#8220;Rockopolis&#8221;) on Treasure Island. This is really part of Oracle OpenWorld, and one of the advantages of JavaOne being combined with OpenWorld is that JavaOne attendees get to partake of the Big Event. This year the top acts included Don Henley, the Black-Eyed Peas, the English Beat, and Steve Miller.</p>
<p>Now, officially this event is for Oracle customers and partners, not employees. The employee speaker badges don&#8217;t include tickets for the event, but it turned out that there were some extra tickets available so most of my team was able to go. In addition, a lot of regular (non-employee) conference attendees didn&#8217;t actually want to go, so that made more tickets available. Finally, through some &#8230; connections &#8230; several of us were able to score VIP tickets, which promised better food, shorter lines, and special reserved areas near the stages. Fortunately, I remembered to bring earplugs!</p>
<p>There was even a black market for the tickets. I heard that they were going on Craigslist for $100. Not too surprising really, since the ticket included free food and drinks, carnival games and rides, and six A-list musical groups. (No, I didn&#8217;t participate in the black market!)</p>
<p>Really the Treasure Island event was quite a spectacle. As I described <a href="http://stuartmarks.wordpress.com/2009/10/15/oracle-openworld-2009-observations-and-impressions/" target="_blank">last year</a>, it was pretty much like an entire county fair that had been set up for one day. Truly amazing.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/306/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=306&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2010/09/23/javaone-2010-day-3-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaOne 2010 days 1 &amp; 2</title>
		<link>http://stuartmarks.wordpress.com/2010/09/21/javaone-2010-days-1-2/</link>
		<comments>http://stuartmarks.wordpress.com/2010/09/21/javaone-2010-days-1-2/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 22:37:35 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">https://stuartmarks.wordpress.com/?p=298</guid>
		<description><![CDATA[I&#8217;m currently attending JavaOne, the first JavaOne hosted and sponsored by Oracle. So far the biggest change is that technical sessions start at 8:00am. I know, was speaking at one. I had to get up at 4:45am to get into San Francisco on time. But, who am I to complain? Actually, the real big news [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=298&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently attending JavaOne, the first JavaOne hosted and sponsored by Oracle. So far the biggest change is that technical sessions start at 8:00am. I know, was speaking at one. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I had to get up at 4:45am to get into San Francisco on time. But, who am I to complain?</p>
<p>Actually, the real big news so far is the demise of JavaFX Script. The reviews from the blogosphere/twittersphere are mixed. Some people are loving it. Indeed, one of the comments I received on my JavaFX Script talk from last year&#8217;s JavaOne was &#8220;It&#8217;s beyond me why anyone would create such a language.&#8221; People such as this commenter are perhaps glad to see JavaFX Script go away.</p>
<p>On the other hand, there is also some disappointment, some criticism, some mourning, and even some denial. But this is the price &#8212; or perhaps the cost &#8212; of progress. (But see also below.)</p>
<p>There&#8217;s been some misinformation floating around the twittersphere about &#8220;JavaFX is dead&#8221; and some such. This is decidedly <strong>not</strong> the case. JavaFX Script is indeed on its way out (though existing programs will still run for a while, and you can still develop new ones, should you decide to do such a thing) but JavaFX itself is most definitely alive and will continue develop. Here&#8217;s a clarifying statement from the JavaFX Architect, Richard Bair (what Mr. Bair <strong>meant</strong> to say was&#8230;) about the changes coming in JavaFX 2.0:</p>
<p><a href="http://fxexperience.com/2010/09/javafx-2-0/" target="_blank">http://fxexperience.com/2010/09/javafx-2-0/</a></p>
<p>Also, the official JavaFX roadmap statement is here:</p>
<p><a href="http://javafx.com/roadmap" target="_blank">http://javafx.com/roadmap</a></p>
<p>* * *</p>
<p>The talk I gave this morning (along with my colleague, Paru Somashekar) was on JavaFX UI Controls. Originally we were going to present a lot more code examples, but with the move away from JavaFX Script we had to retool the talk. In the end we showed a survey of the controls and some demos of the controls in action but relatively little code. We did do a small comparison of JavaFX Script to a new, provisional Java-based API for JavaFX. Overall the talk was well attended (better than I expected for an 8am tech session!) and I thought it was a success.</p>
<p>One questioner at the session criticized the dropping of support for JavaFX Script and in particular its declarative syntax. He was very polite, apologizing for making a statement instead of a question and also for shooting the messenger. I didn&#8217;t get a chance to talk to the gentleman, but I wanted to say that I wasn&#8217;t offended by his comment. On the JavaFX team we knew that dropping JavaFX Script would be painful for some. Anyone who&#8217;s affected needs to speak out about it. I don&#8217;t think the decision will be reversed but it might be possible for those impact to get some help with migration.</p>
<p>* * *</p>
<p>We had a <strong>great</strong> lunch at Henry&#8217;s Hunan. I&#8217;m still full. Oh, well there was also that big cookie I had during the afternoon break.</p>
<p>* * *</p>
<p>It&#8217;s a bit odd not being in Moscone. Unlike I think all prior JavaOnes, this year JavaOne is in a trio of hotels: the SF Hilton, Hotel Nikko, and the Parc 55. The hotel meeting rooms are smaller, so they fill up sooner, and in general Oracle employees (such as myself) can only get in if there&#8217;s space available &#8212; which there often is not. As a result I&#8217;ve been unable to get into a few sessions that I wanted to attend. Oh well, I&#8217;ll have to pick up the presentation slides later on. But, who am I to complain?</p>
<p>* * *</p>
<p>This evening I&#8217;m attending a few BOFs: on Jigsaw, OpenJDK, and on Visual Design with CSS. After that I&#8217;ll head home, attempting not to fall asleep during the drive, and fall into bed at the end of a <strong>very</strong> long day.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=298&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2010/09/21/javaone-2010-days-1-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>
	</item>
		<item>
		<title>Missing Listeners and Local Overrides</title>
		<link>http://stuartmarks.wordpress.com/2010/07/27/missing-listeners-and-local-overrides/</link>
		<comments>http://stuartmarks.wordpress.com/2010/07/27/missing-listeners-and-local-overrides/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 04:10:12 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://stuartmarks.wordpress.com/?p=284</guid>
		<description><![CDATA[Anyone who&#8217;s used any of the JavaFX UI Controls (in javafx.scene.control) has probably noticed that most of the controls don&#8217;t have any listeners. Why is this? Without listeners, how can you detect when the user has changed the state of the control? The first, easy answer is that you can often avoid the need for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=284&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Anyone who&#8217;s used any of the JavaFX UI Controls (in javafx.scene.control) has probably noticed that most of the controls don&#8217;t have any listeners. Why is this? Without listeners, how can you detect when the user has changed the state of the control?</p>
<p>The first, easy answer is that you can often avoid the need for listeners by binding to the state of the control. Let&#8217;s consider a simple CheckBox example. Suppose you wanted to change the visibility of something based on whether the checkbox is selected. In Swing, you&#8217;d do something like adding an item listener to the checkbox, and when it got called, you&#8217;d look in the event to see which checkbox got changed and whether it was selected or deselected, and then modify the visibility of your component (or whatever) accordingly.</p>
<p>In JavaFX, you&#8217;d do something kind of the opposite. Instead of having a listener get called that &#8220;pushes&#8221; the side effect of the checkbox state change into some target object, you&#8217;d instead <strong>bind</strong> the &#8220;visible&#8221; state of the target object to the selected state of the checkbox. Here&#8217;s how:</p>
<pre style="padding-left:30px;">var cb:CheckBox;

Stage {
    scene: Scene {
        content: [
            HBox {
                spacing: 10
                padding: Insets { top: 10 right: 10 bottom: 10 left: 10 }
                content: [
                    cb = CheckBox {
                        text: "Check Me!"
                        selected: true
                    }
                    Label {
                        text: "sample label text"
                        visible: bind cb.selected
                    }
                ]
            }
        ]
    }
}</pre>
<p>The bind-expression makes sure that the Label&#8217;s &#8220;visible&#8221; variable will always track the state of the CheckBox, and so the Label will appear and disappear as you check and uncheck the CheckBox. Simple.</p>
<p>This is all well and good if your situation calls for some state to be updated when the CheckBox changes state, and the update computation is something simple enough to be written using a bind-expression. But what if you have some kind of process that you need to perform, say, one that requires having some function called. Wouldn&#8217;t you need a listener? Yes, but it&#8217;s fairly simple to construct your own.</p>
<p>Like many languages, JavaFX Script has block structure, where any code block &#8220;{&nbsp;&#8230;&nbsp;}&#8221; can declare local variables that are scoped to that block (i.e., they are not visible outside that block). It&#8217;s also legal to declare local variables within the &#8220;{&nbsp;&#8230;&nbsp;}&#8221; of an object literal, even though it&#8217;s a syntactically different construct from a code block. What&#8217;s not very well known is that it&#8217;s also possible to <em>override</em> variables of the class you&#8217;re instantiating. By itself, overriding a variable doesn&#8217;t let you do much except to override the initial value of a variable. Since this is already within an object literal, you&#8217;re providing initial values already, so what&#8217;s the point? Overriding useful because it provides a point of (re)declaration of the variable where you can supply an &#8220;on replace&#8221; trigger. This is code that gets called whenever the value is changed &#8230; just like a listener!</p>
<p>Let&#8217;s try this out. Instead of just toggling the visibility of the label, let&#8217;s toggle a timeline that rotates it:</p>
<pre style="padding-left:30px;">Stage {
    scene: Scene {
        content: [
            HBox {
                spacing: 10
                padding: Insets { top: 10 right: 10 bottom: 10 left: 10 }
                content: [
                    CheckBox {
                        text: "Check Me!"
                        override var selected on replace {
                            if (selected) tl.play() else tl.pause();
                        }
                    }
                    label = Label {
                        text: "sample label text"
                    }
                ]
            }
        ]
    }
}

var tl = Timeline {
    repeatCount: Timeline.INDEFINITE
    keyFrames: [
        at (2s) {
            label.rotate =&gt; 360
        }
    ]
}</pre>
<p>(See <a name="fnr1" href="#fn1">Footnote 1</a>.)</p>
<p>This is a little non-obvious but it works quite well.</p>
<p>Now, there&#8217;s a problem with this technique. In order to override a variable, that variable must be <strong>public</strong>. Let&#8217;s say that we wanted to create a ListView and create the equivalent of a listener that gets called whenever the selection changes. We&#8217;ll just do this, right?</p>
<pre style="padding-left:30px;">ListView {
    items: [ "One", "Two", "Three" ]
    override var selectedItem on replace {
        println("selection is now {selectedItem}"); // ERROR
    }
}</pre>
<p>Oh no, this doesn&#8217;t work! The &#8220;selectedItem&#8221; variable isn&#8217;t public, it&#8217;s public-read. (Why? See <a name="fnr2" href="#fn2">Footnote 2</a>.) This is a bit of a pain to work around. We cannot override public-read variables, but we can still bind to them. This means we can use the <a href="http://stuartmarks.wordpress.com/2009/02/12/the-foreign-trigger-idiom/">foreign trigger idiom</a> to create a new variable that tracks the value of the variable we&#8217;re interested in, and then add a trigger to our new variable. Here&#8217;s how:</p>
<pre style="padding-left:30px;">var list = ListView {
    items: [ "One", "Two", "Three" ]
    var sel = bind list.selectedItem on replace {
        println("selection is now {sel}");
    }
}
</pre>
<p>This is fairly cumbersome, since we have to create and name a new local variable and hang our &#8220;listener&#8221; code there, and we have to make sure the ListView is accessible to it via a named variable. This is probably about as much boilerplate as adding a listener using an anonymous class in Java. Still, we&#8217;re used to much more concise syntax in JavaFX Script. It&#8217;d probably be nicer to have a function variable such as &#8220;onSelectionChanged&#8221; whose value is a function that gets called when the ListView&#8217;s selection changes. Adding callback APIs like this hasn&#8217;t been a very high priority up until now, though, since it&#8217;s possible (if inconvenient) to use the controls without them using the bind or override-and-bind-with-trigger techniques. We&#8217;re definitely considering adding them, though, since it makes the API much more approachable.</p>
<p><a name="fn1"><strong>Footnote 1</strong></a>. This is a bit sloppy. Those of you who compile this code will note that the &#8220;label.rotate =&gt; 360&#8243; line gets a compiler warning to the effect that &#8220;label is not a constant but will be treated as such&#8221;. This means that, at the time the KeyFrame object of the Timeline is created, a snapshot of the current value of &#8220;label&#8221; is taken and stored within the KeyFrame. This means that &#8220;label&#8221; needs to have been initialized to the right value before the Timeline and KeyFrame are created. In fact, I first created the Timeline above the Stage/Scene/HBox hierarchy, and the animation didn&#8217;t work! Moving it below makes it work, but the compiler still issues the warning. <a href="#fnr1">↩</a></p>
<p><a name="fn2"><strong>Footnote 2</strong></a>. Why are selectedItem and selectedIndex public-read instead of public? If they were both public, the implementation would have to have triggers to handle the cases where the application wrote to them. Each trigger would have to write to the other variable, which in turn would invoke its trigger. This doesn&#8217;t cause infinite recursion, though, since the trigger won&#8217;t fire if the variable is set to a value equal to its current value. But it&#8217;s still a pain. Oh, another problem is, what if the application set selectedItem to an object that&#8217;s not a member of the ListView? The trigger would have to set the variable back to a legal value, and add a flag to avoid recursive trigger invocation as noted </a><a href="http://www.java.net/blog/opinali/archive/2010/05/25/javafx-language-investigations" target="_blank">here</a>. (Also note that Toggle.selected and ToggleGroup.selectedToggle are both public and have this problem. Trust me, dealing with this kind of situation is a real pain.) <a href="#fnr2">↩</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=284&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2010/07/27/missing-listeners-and-local-overrides/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaFX API Docs Updated; New CSS Reference</title>
		<link>http://stuartmarks.wordpress.com/2010/06/24/javafx-api-docs-updated-new-css-reference/</link>
		<comments>http://stuartmarks.wordpress.com/2010/06/24/javafx-api-docs-updated-new-css-reference/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 05:56:50 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://stuartmarks.wordpress.com/?p=277</guid>
		<description><![CDATA[We&#8217;ve just updated the JavaFX API documentation. The main documentation is here: http://java.sun.com/javafx/1.3/docs/api/ Probably the most significant change is the addition of a new CSS Reference Guide. This document is linked from the javafx.scene package docs and from the Scene and Node class docs, but it&#8217;s actually a bit hard to find. For your convenience, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=277&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve just updated the JavaFX API documentation. The main documentation is here:</p>
<p><a href="http://java.sun.com/javafx/1.3/docs/api/" target="_blank">http://java.sun.com/javafx/1.3/docs/api/</a></p>
<p>Probably the most significant change is the addition of a new <em>CSS Reference Guide</em>. This document is linked from the <strong>javafx.scene</strong> package docs and from the <strong>Scene</strong> and <strong>Node</strong> class docs, but it&#8217;s actually a bit hard to find. For your convenience, the direct link is here:</p>
<p><a href="http://java.sun.com/javafx/1.3/docs/api/javafx.scene/doc-files/cssref.html" target="_blank">http://java.sun.com/javafx/1.3/docs/api/javafx.scene/doc-files/cssref.html</a></p>
<p>You&#8217;ll probably want to bookmark it. A lot of the information is out there already, having been derived from the examples in the caspian.css file (which is included in one of the jar files in the SDK). The styles in caspian.css show a lot of what you can do with CSS in JavaFX. However, even caspian.css doesn&#8217;t show everything that you can do with CSS. The <em>CSS Reference Guide</em> is comprehensive. For instance, check out all of what you can do with a <a href="http://java.sun.com/javafx/1.3/docs/api/javafx.scene/doc-files/cssref.html#region" target="_blank">Region</a> using CSS. Or, take a look at all the properties of <a href="http://java.sun.com/javafx/1.3/docs/api/javafx.scene/doc-files/cssref.html#areachart" target="_blank">charts</a> you can customize. There&#8217;s really a lot in there.</p>
<p>I&#8217;ll post some examples later. Meanwhile, dive in and enjoy!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/277/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=277&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2010/06/24/javafx-api-docs-updated-new-css-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>
	</item>
		<item>
		<title>Applying Styles to Scenes</title>
		<link>http://stuartmarks.wordpress.com/2010/06/14/applying-styles-to-scenes/</link>
		<comments>http://stuartmarks.wordpress.com/2010/06/14/applying-styles-to-scenes/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 00:30:29 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://stuartmarks.wordpress.com/?p=222</guid>
		<description><![CDATA[There&#8217;s been some confusion about styling scenes and what it means to have a CSS rule that uses &#8220;.scene&#8221; as the selector. For example, the caspian.css file that&#8217;s included in JavaFX, the JavaFX tutorial Applying CSS to UI Controls, and Dean Iverson&#8217;s article Into the Background all include style rules that look something like this: [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=222&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been some confusion about styling scenes and what it means to have a CSS rule that uses &#8220;.scene&#8221; as the selector. For example, the caspian.css file that&#8217;s included in JavaFX, the JavaFX tutorial <a href="http://javafx.com/docs/articles/UIControls/theming.jsp" target="_blank">Applying CSS to UI Controls</a>, and Dean Iverson&#8217;s article <a href="http://pleasingsoftware.blogspot.com/2010/05/into-background.html" target="_blank">Into the Background</a> all include style rules that look something like this:</p>
<pre style="padding-left:30px;">.scene {
    -fx-background: cornflowerblue;
    /* ... */
}</pre>
<p>There have been a bunch of questions about this, for example in the forum threads <a href="http://forums.sun.com/thread.jspa?threadID=5441057" target="_blank">here</a> and <a href="http://forums.sun.com/thread.jspa?threadID=5438239" target="_blank">here</a>, and in comments at the bottom of the <a href="http://javafx.com/docs/articles/UIControls/theming.jsp" target="_blank">Applying CSS to UI Controls</a> tutorial. People are tinkering with this rule and it&#8217;s not working the way they expect. The pieces of this part of the system fit together in funny ways, so I certainly can see why there&#8217;s lots of confusion. Let&#8217;s dive in.</p>
<p>First, let&#8217;s create a simple scene:</p>
<pre style="padding-left:30px;">Stage {
    scene: Scene {
        width: 150
        height: 150
        stylesheets: "{__DIR__}styles.css"
        content: [
            Rectangle { x: 50 y: 50 width: 50 height: 50 }
        ]
    }
}</pre>
<p>Now let&#8217;s try to style the scene. The various examples use the -fx-background and -fx-fill properties. Which one is correct? Let&#8217;s try both, using different colors so that we can tell which one took effect. Place the following into the styles.css file:</p>
<pre style="padding-left:30px;">.scene {
    -fx-background: cornflowerblue;
    -fx-fill: orchid;
}</pre>
<p>What happens? Basically, nothing. We get a black rectangle on a white background, just as if we hadn&#8217;t specified any CSS at all.</p>
<p><a href="http://stuartmarks.files.wordpress.com/2010/06/img1.png"><img class="aligncenter size-full wp-image-226" title="img1" src="http://stuartmarks.files.wordpress.com/2010/06/img1.png?w=500" alt=""   /></a>Well, that sucks.</p>
<p>The main problem is that Scene objects don&#8217;t have any CSS-settable attributes. There are a couple things on Scene that seem like they ought to be settable from CSS, such as the fill and cursor variables. But they don&#8217;t work, and that&#8217;s a bug. See JIRA issue <a href="http://javafx-jira.kenai.com/browse/RT-8653" target="_blank">RT-8653</a>. If you want to set the background color of a Scene, you have to use a rectangle or ScrollView and style that instead. See Dean Iverson&#8217;s article <a href="http://pleasingsoftware.blogspot.com/2010/05/into-background.html" target="_blank">Into the Background</a> which covers this pretty well.</p>
<p>If a style rule for &#8220;.scene&#8221; doesn&#8217;t apply any properties to the Scene, what does it do? Let&#8217;s first examine an assumption here, which is that a style rule with &#8220;.scene&#8221; actually applies to Scene objects. This is a reasonable assumption because we&#8217;ve set things up for the controls so that &#8220;.button&#8221; styles apply to Button, &#8220;.slider&#8221; styles apply to Slider, and so forth. This convention that applies to the controls, but it doesn&#8217;t apply everywhere. You can&#8217;t, for instance, declare a style rule for &#8220;.rectangle&#8221; and expect it to apply to all Rectangle objects. Try it! It doesn&#8217;t work. To style a Rectangle, you have to give it a styleClass value and then use that in your CSS. For example:</p>
<pre style="padding-left:30px;">// Main.fx
Rectangle { styleClass: "myrect" ... }

// styles.css
.myrect { -fx-fill: dodgerblue; }</pre>
<p>gives the following result:</p>
<p><a href="http://stuartmarks.files.wordpress.com/2010/06/img2.png"><img class="aligncenter size-full wp-image-231" title="img2" src="http://stuartmarks.files.wordpress.com/2010/06/img2.png?w=500" alt=""   /></a>Now back to Scene. If the &#8220;.scene&#8221; styles don&#8217;t apply to Scene objects, what do they apply to?</p>
<p>Let&#8217;s examine a little puzzle in the scene graph API. The scene graph is a tree of nodes, and all trees have a root. Every Node has a parent variable, which is of type Parent (a subclass of Node). If you walk up the scene graph following the parent variable, you&#8217;ll eventually get to the root. That&#8217;s the Scene, right? But it can&#8217;t be, because a Scene isn&#8217;t a Node. What is the root Node then? Let&#8217;s find out.</p>
<pre style="padding-left:30px;">var rect:Rectangle;
...
Stage {
    scene: Scene {
        ...
        content: [
            rect = Rectangle {
                styleClass: "myrect"
                x: 50 y: 50 width: 50 height: 50
            }
        ]
    }
}

println("parent={rect.parent}");
// and while we're at it
println("styleClass={rect.parent.styleClass}");</pre>
<p>The output will be something like this:</p>
<pre style="padding-left:30px;">parent=Scene$Root@27d314cc
styleClass=scene</pre>
<p>Whoa, what&#8217;s that? Inside of every Scene, there&#8217;s a hidden node called Scene$Root that&#8217;s the parent of every Node in the Scene&#8217;s content sequence. It&#8217;s a subclass of Parent. It&#8217;s the actual root node of the scene graph. And, most importantly for this discussion, it handles CSS on behalf of the Scene. Indeed, its styleClass is &#8220;scene&#8221;. So, style rules that use &#8220;.scene&#8221; as their selector are really applying styles to this hidden Scene$Root object.</p>
<p>We&#8217;re a little closer, since we now know that &#8220;.scene&#8221; styles apply to the Scene$Root object and not the Scene object itself. But Scene$Root doesn&#8217;t actually have any properties that are affected by CSS. What good does it do to set properties on Scene$Root if they don&#8217;t actually affect it?</p>
<p>To understand what&#8217;s going on, we have to talk about two features of CSS. First, a feature of JavaFX CSS is that colors can be specified not only using standard color names such as &#8220;dodgerblue&#8221; or by using RGB syntax like &#8220;#0093ff&#8221;, but they also can also be <em>looked up by name</em> using properties defined by styles above them in the hierarchy.  Second, as in standard CSS, some properties are <em>inherited</em>. Let&#8217;s examine these features in more detail.</p>
<h3>Color Lookup</h3>
<p>Continuing with the simple rectangle example from above, let&#8217;s define style rule for .scene that defines some new color names:</p>
<pre style="padding-left:30px;">.scene {
    -smarks-special-fill-color: #40d080;
    -smarks-special-border-color: #d02040;
}</pre>
<p>I just made up the property names -smarks-special-fill-color and -smarks-special-border color. They don&#8217;t exist anywhere else, and merely setting these properties won&#8217;t have any effect on anything. However, the property names and values are applied to Scene$Root, so we can put them to use. Define</p>
<pre style="padding-left:30px;">.myrect {
    -fx-fill: -smarks-special-fill-color;
    -fx-stroke: -smarks-special-border-color;
    -fx-stroke-width: 5;
}</pre>
<p>(I also made the stroke width thicker so that it&#8217;s easier to see the border.) The result is as follows:</p>
<p><a href="http://stuartmarks.files.wordpress.com/2010/06/img5.png"><img class="aligncenter size-full wp-image-235" title="img5" src="http://stuartmarks.files.wordpress.com/2010/06/img5.png?w=500" alt=""   /></a></p>
<p>This works because in JavaFX CSS, you can use an arbitrary property name as the value for a color property. This property name is looked up on all ancestor nodes, and if a value is found, that color is used in its place.</p>
<p>Now, I could have specified those colors directly in the .myrect rule and it would have worked just fine. However, if I had several different style rules (say, for different shapes) that wanted to use the same colors, I&#8217;d have those color values spread around in a bunch of different rules in my style sheet. If I wanted to change a color, I&#8217;d have to change it in several places. Since the Scene$Root node is the ancestor of every node that appears in any Scene, and since its styleClass is &#8220;scene&#8221;, I can place some color definitions in the &#8220;.scene&#8221; style rule and they&#8217;ll be visible to be looked up from any node in the scene graph. The &#8220;.scene&#8221; style is thus about as close as we can get to a global repository of color properties. Indeed, if you look at the &#8220;.scene&#8221; rule from the caspian.css file, just about all if its declarations are for color properties.</p>
<h3>Inheritance</h3>
<p>Let&#8217;s change the scene&#8217;s content to have some Text nodes in order to show inheritance of font properties:</p>
<pre style="padding-left:30px;">content: [
    Text { x: 30 y:  60 content: "Hello, JavaFX!" }
    Text { x: 30 y: 100 content: "CSS is fun!" }
]</pre>
<p>This will use the default font, which will give a result like this:</p>
<p><a href="http://stuartmarks.files.wordpress.com/2010/06/img3.png"><img class="aligncenter size-full wp-image-233" title="img3" src="http://stuartmarks.files.wordpress.com/2010/06/img3.png?w=500" alt=""   /></a>Now let&#8217;s modify the .scene style rule as follows:</p>
<pre style="padding-left:30px;">.scene {
    -fx-font: 18pt "Times-Italic";
}</pre>
<p>The result will change to the following:</p>
<p><a href="http://stuartmarks.files.wordpress.com/2010/06/img4.png"><img class="aligncenter size-full wp-image-234" title="img4" src="http://stuartmarks.files.wordpress.com/2010/06/img4.png?w=500" alt=""   /></a>Why did this have an effect? The reason is that, as in standard CSS, font properties are inherited down the hierarchy. More precisely, if a font value isn&#8217;t provided for a particular node, the font property is looked up in ancestor nodes until a value is found. Since Scene$Root is at the root of the hierarchy, and the &#8220;.scene&#8221; properties have been applied to it, the font defined there ends up being used by the Text nodes. Of course, I could override the font by specifying a font value directly in the code, or by creating a style with a font property and arranging for it to apply to the Text nodes or to an ancestor. Since I didn&#8217;t do that, the font property from the &#8220;.scene&#8221; rule applies. It&#8217;s effectively a specification of the default font to be used everywhere in the scene graph.</p>
<p>In summary, the &#8220;.scene&#8221; style rule doesn&#8217;t apply properties to the Scene itself (though maybe it should). Instead, it stores properties on the Scene$Root node. These properties aren&#8217;t used directly, but can be inherited (for fonts) and can be looked up (for colors) by nodes anywhere in the scene graph. Thus, the &#8220;.scene&#8221; style rule is where global color and font properties can be defined, which makes it easier to develop and maintain consistent style sheets.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/222/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=222&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2010/06/14/applying-styles-to-scenes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>

		<media:content url="http://stuartmarks.files.wordpress.com/2010/06/img1.png" medium="image">
			<media:title type="html">img1</media:title>
		</media:content>

		<media:content url="http://stuartmarks.files.wordpress.com/2010/06/img2.png" medium="image">
			<media:title type="html">img2</media:title>
		</media:content>

		<media:content url="http://stuartmarks.files.wordpress.com/2010/06/img5.png" medium="image">
			<media:title type="html">img5</media:title>
		</media:content>

		<media:content url="http://stuartmarks.files.wordpress.com/2010/06/img3.png" medium="image">
			<media:title type="html">img3</media:title>
		</media:content>

		<media:content url="http://stuartmarks.files.wordpress.com/2010/06/img4.png" medium="image">
			<media:title type="html">img4</media:title>
		</media:content>
	</item>
		<item>
		<title>SVJUGFX Talk Tonight!</title>
		<link>http://stuartmarks.wordpress.com/2010/04/14/svjugfx-talk-tonight/</link>
		<comments>http://stuartmarks.wordpress.com/2010/04/14/svjugfx-talk-tonight/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 21:20:51 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://stuartmarks.wordpress.com/?p=208</guid>
		<description><![CDATA[I&#8217;m talking at the Silicon Valley JavaFX Users Group tonight. The topic is Hands On JavaFX — Scripting The Scene Graph. Time and location information is available at the SVJUGFX website. If you&#8217;re not in the SF Bay Area, a webcast will also be available. Information is at that link. I&#8217;ve posted the presentation materials [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=208&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m talking at the Silicon Valley JavaFX Users Group tonight. <em>The topic is Hands On JavaFX — Scripting The Scene Graph</em>.</p>
<p>Time and location information is available at the <a title="SVJUGFX" href="http://www.svjugfx.org/calendar/12863551/" target="_blank">SVJUGFX</a> website. If you&#8217;re not in the SF Bay Area, a webcast will also be available. Information is at that link.</p>
<p>I&#8217;ve posted the presentation materials on my website <a href="http://www.smarks.org/svjugfx20100414/flood.html" target="_blank">here</a>. They&#8217;ll be helpful if you miss the talk and want to review it, or if you&#8217;re watching remotely and want to follow along (or read ahead).</p>
<p>See you there!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/208/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/208/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/208/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=208&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2010/04/14/svjugfx-talk-tonight/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>
	</item>
		<item>
		<title>Function Return Type Inference</title>
		<link>http://stuartmarks.wordpress.com/2010/03/31/function-return-type-inference/</link>
		<comments>http://stuartmarks.wordpress.com/2010/03/31/function-return-type-inference/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 06:31:55 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://stuartmarks.wordpress.com/?p=199</guid>
		<description><![CDATA[A recent exchange on the JavaFX Forums (see here and subsequent messages) has prompted me to write a note about function return types and type inference in JavaFX Script. JavaFX Script is a strongly-typed language. You don&#8217;t have to declare types everywhere; usually the compiler can infer the right type based on usage. For example, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=199&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A recent exchange on the JavaFX Forums (see <a href="http://forums.sun.com/thread.jspa?messageID=10962799#10962799" target="_blank">here</a> and subsequent messages) has prompted me to write a note about function return types and type inference in JavaFX Script.</p>
<p>JavaFX Script is a strongly-typed language. You don&#8217;t have to declare types everywhere; usually the compiler can infer the right type based on usage. For example, in the following:</p>
<pre style="padding-left:30px;">var msg = "Hello";</pre>
<p>The msg variable is of type <strong>String</strong>. Occasionally the compiler won&#8217;t be able to infer a type, in which case it will issue an error message, and you&#8217;ll have to declare the type explicitly.</p>
<p>Now, what&#8217;s the return type of a function? If you don&#8217;t declare the return type in the function declaration, the function&#8217;s return type will be the <strong>type of the last expression in the function body</strong>. (Also, the return value will be the value of that expression.) This is often just fine. For example,</p>
<pre style="padding-left:30px;">function getMessage(count:Integer) {
    def verb = if (count == 1) "is" else "are";
    def suffix = if (count == 1) "" else "s";
    "There {verb} {count} item{suffix}."
}
</pre>
<p>The return type is clearly String. You can use the <strong>return</strong> statement to return a value from a function, but you don&#8217;t have to.</p>
<p>Unfortunately this isn&#8217;t documented very well at all in the <em>JavaFX Script Language Reference</em>. The section on <a href="http://openjfx.java.sun.com/current-build/doc/reference/ch04s03.html" target="_blank">function return type inference</a> is extremely short, and I&#8217;ve quoted it below in its entirety.</p>
<blockquote><p>Type inferencing can generally determine the return type of a     function. In most cases the parameter types can be determined by type     inference as well.</p>
<p>However, functions which, by virtue of their access modifiers, are     visible outside the script should be explicitly typed.</p>
<p><em>[To do: detail on type inference]</em></p></blockquote>
<p>The advice about explicitly declaring the return type is a good one, but it doesn&#8217;t explain why. I&#8217;d prefer a stronger rule and say, <strong>always declare the return types of functions</strong>.</p>
<p>Functions are used for different purposes. Sometimes they&#8217;re used to compute a value and return it to the caller. Other times they contain sequences of statements that mutate state, but that do not return any value. Some languages, such as Pascal, distinguish between these cases by calling them different things: a <strong>function</strong> must return a value, whereas a <strong>procedure</strong> cannot return a value. In Java, all methods are declared the same way, but the return type must always be declared. A Java &#8220;procedure&#8221; returns no value and has a return type of <strong>void</strong>.</p>
<p>If you want to write a &#8220;procedure&#8221; in JavaFX Script, you can just declare its return type to be void. But why bother, since the compiler will infer the type for you? The last expression in the procedure might have some value. The compiler will return that value, and use its type, even if you didn&#8217;t want to return a value. Consider a banking application. You might want to allow someone to have deposit-only access to an account, but not allow them to make withdrawals or to check the balance. You might code up the interface like this:</p>
<pre style="padding-left:30px;">function makeDeposit(amount:Number) {
    balance += amount;
}
</pre>
<p>Whoops! The compiler inferred a return type of Number, and you just leaked the account balance. The obvious fix is:</p>
<pre style="padding-left:30px;">function makeDeposit(amount:Number):Void { ... }
</pre>
<p>Function return type inference can have some surprising effects, especially in the presence of subclassing and overriding. Consider the following example:</p>
<pre style="padding-left:30px;">class A {
    var count:Integer;
    var status:String;

    function update() {
        count++;
        status = "update() was called {count} times";
        println(status);
    }

    function doSomething() {
        // other stuff
        update()
    }
}

class B extends A {
    var subCount:Integer;

    override function doSomething() {
        // more stuff
        super.doSomething();
        subCount++;
    }
}
</pre>
<p>This works fine. Oh, you left a debugging println in A.update()&#8230; just take it out. The compiler now gives you an error, complaining about incompatible types at the end of B.doSomething(). Whut??</p>
<p>The return type of B.doSomething() should be Integer, since the last expression in the body is an Integer. Since it&#8217;s an override, it has to match the return type of A.doSomething(). What&#8217;s that? Well, it&#8217;s inferred from the return type of A.update(). Now, in the original code, the last expression in A.update() is a println(), which is one of the few things in JavaFX Script that has a return type of void. So that&#8217;s the return type of A.update(). When you removed the println, the last expression became a String and thus the return type of A.update(). That also affected the inferred return type of A.doSomething(), which also became String, which caused the mismatch with B.doSomething().</p>
<p>The fix here is to declare the return types for A.update() and A.doSomething() explicitly to be Void. It might also be reasonable to declare the return type for B.doSomething(). In this case it&#8217;s less important, though. The return type of an overriding function is determined by the type of the function being overridden, so the type won&#8217;t be inferred from the last expression in the body. Even though the last expression in B.doSomething() is an Integer, its return type must always match that of A.doSomething(). It&#8217;s good documentation to put in the return type, so you don&#8217;t have to go hunting through other source files to find out what it is. The compiler will flag an error if there&#8217;s a mismatch.</p>
<p>Like I said above, <strong>always declare the return types of functions.</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/199/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/199/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/199/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=199&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2010/03/31/function-return-type-inference/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>
	</item>
		<item>
		<title>That Infernal Scene Graph Warning Message II</title>
		<link>http://stuartmarks.wordpress.com/2009/12/04/that-infernal-scene-graph-warning-message-ii/</link>
		<comments>http://stuartmarks.wordpress.com/2009/12/04/that-infernal-scene-graph-warning-message-ii/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 06:50:35 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://stuartmarks.wordpress.com/?p=122</guid>
		<description><![CDATA[In my earlier post on this topic I hinted that we had found a resolution to the issue surrounding the warning message, I hinted further in some of my replies to comments, and I even left it as sort of a cliffhanger as to what the resolution was. So, here&#8217;s the resolution. We&#8217;ve decided that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=122&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In my earlier <a href="http://stuartmarks.wordpress.com/2009/10/12/that-infernal-scene-graph-warning-message/">post</a> on this topic I hinted that we had found a resolution to the issue surrounding the warning message, I hinted further in some of my replies to comments, and I even left it as sort of a cliffhanger as to what the resolution was. So, here&#8217;s the resolution.</p>
<p>We&#8217;ve decided that when a node is added to a group, that node is automatically removed from the group that previously owned it, if any. (Let&#8217;s call this the &#8220;auto-remove&#8221; feature.) We&#8217;ve also decided to turn off the warning message by default, but to have it be enabled optionally, possibly via a system property, for debugging purposes. Finally, we&#8217;ve relaxed the enforcement of some scene graph invariants in cases where the group&#8217;s content sequence is bound.</p>
<p>What&#8217;s the big deal? Well, there were a bunch of things pulling us in different directions. During the development of 1.2, we added code to prevent nodes from appearing more than once in the scene graph or creating cycles in the scene graph. One case in particular caused us a lot of trouble: adding a node to a group while the node was already a member of another group. We fully intended to disallow this case, and require that code remove a node from its old group before adding it to the new one. Unfortunately this caused a <strong>lot</strong> of our internal code to break. In versions 1.1 and prior, auto-remove was the specified behavior, and a surprising amount of code relied on this. Given the number of cases we ran across internally, we were sure that this would break a lot of external code. For this reason we decided to relax the restriction for this particular case, continue the auto-remove behavior temporarily, and issue a warning message instead. In a subsequent release, we were going to change the warning to an error and to remove auto-remove behavior.</p>
<p>During the development of our current release, we kept running into this issue. A couple of us wrote code that we thought was reasonable, yet it surprised us when the warning message came out! We had a few hallway conversations from time to time, but a clear-cut answer never emerged. Finally, we realized that we had to get the interested parties in a room and have a knock-down, drag-out meeting to resolve the issue. And so on October 7, 2009, <a href="http://www.java.net/blogs/aim" target="_blank">Amy Fowler</a>, Kevin Rushforth, <a href="http://fxexperience.com" target="_blank">Richard Bair</a>, and I got into a conference room to decide the issue. Three hours later &#8212; with no breaks! &#8212; we had decided. Actually, it was a great meeting, without a lot of conflict. There were just a lot of issues to cover. Each of us came into the meeting with our initial opinions, but the issues were so close that I think each one of us switched sides at least once during the meeting.</p>
<p>Obviously I can&#8217;t reproduce the entire discussion here, but the gist of the arguments went something like this:</p>
<ol>
<li>It&#8217;s simpler, more efficient, and more consistent to disallow auto-remove.</li>
<li>On the other hand, 1.1 allowed auto-remove, so this is incompatible.</li>
<li>On the third hand, we expect people to set up scene graphs at initialization time and modify nodes in-place, instead of doing scene graph surgery.</li>
<li>On the gripping hand, some applications really do need to move nodes around in the scene graph.</li>
<li>Well, that&#8217;s not too difficult, just remove the node from the old group first.</li>
<li>Sometimes (especially with <strong>bind</strong>) it&#8217;s difficult or even impossible to remove the node from the old group first.</li>
<li>But most of the cases we&#8217;ve seen with <strong>bind </strong>are actually poor coding practices that we want to have emit a warning message.</li>
</ol>
<p>And so on, back and forth, and around in circles.</p>
<p>Let&#8217;s start off with the topic of moving nodes around within the scene graph. What&#8217;s the problem? Suppose you have a node <em>n</em> that you wanted to insert into group <em>g</em>. If you do this:</p>
<pre style="padding-left:30px;">insert n into g.content;
</pre>
<p>This might generate the warning message if <em>n</em> were already a member of another Group. To avoid this, you&#8217;d have to do:</p>
<pre style="padding-left:30px;">if (n.parent instanceof Group) {
    delete n from (n.parent as Group).content;
}
</pre>
<p>This is a bit subtle but overall pretty straightforward. First we have to test that <em>n.parent</em> is a Group. (It might be a CustomNode instead.) Note also that if <em>n</em> has no parent, <em>n.parent</em> will be null and the <strong>instanceof</strong> test will fail. If the test succeeds, we can cast <em>n.parent</em> to a Group and then remove <em>n</em> from the <em>content</em> variable. This is a bit inconvenient but not too bad. We could wrap this up in a nice function and use it in a bunch of places. We even considered adding a utility function to the scene graph to handle this.</p>
<p>Things start to get hairy, though, when when you add <strong>bind </strong>into the mix. What are people doing with <strong>bind</strong> that makes it difficult or impossible to remove the node from the old group first? Which uses of <strong>bind</strong> are &#8220;poor coding practices&#8221; and which are legitimate?</p>
<p>In order to answer these questions, we&#8217;ll need to review the semantics of <strong>bind</strong>. Consider the following:</p>
<pre style="padding-left:30px;">var p = bind q + r;</pre>
<p>If either <em>q</em> or <em>r</em> changes, the expression is recomputed and assigned to <em>p</em>. The rule is that only the subtree of the expression affected by the variable change is re-evaluated. So if <em>q</em> changes, <em>r</em> isn&#8217;t recomputed, and instead its saved value is added to <em>q</em> to get the result that&#8217;s then assigned to <em>p</em>. This is hard to see if <em>q</em> and <em>r</em> are simple variables, so let&#8217;s make the expression a bit more complicated:</p>
<pre style="padding-left:30px;">var p = bind f(q) + g(r);</pre>
<p>where <em>f()</em> and <em>g()</em> are functions. In this expression, if <em>q</em> changes, <em>f()</em> is called with the new value of <em>q</em>, as one would expect. However, the function <em>g()</em> is not called again. Instead, the saved value of the previous call to <em>g(r)</em> is used, added to the new value of <em>f(q)</em>, giving the result assigned to <em>p</em>. You can see this by putting println() statements into <em>f()</em> and <em>g()</em> to see when they&#8217;re called. Try it!</p>
<p>Now let&#8217;s throw an object literal into the expression:</p>
<pre style="padding-left:30px;">var xval:Number = ...;
var yval:Number = ...;
var p = bind Point2D { x: f(xval) y: g(yval) };</pre>
<p>What does this do? Initially it calls <em>f(xval)</em> and <em>g(yval)</em>, then creates a new Point2D instance and initializes its <em>x</em> and <em>y</em> variables to the values obtained by calling the functions. Now suppose <em>xval</em> changes.  Naturally <em>f(xval)</em> has to be called again; as before, the saved value of <em>g(yval)</em> is used and function <em>g()</em> isn&#8217;t called again. These values are then used to construct a <strong>new</strong> instance of a Point2D, which is then assigned to <em>p</em>. What happens to the old instance? Well, it still exists (probably) but if it&#8217;s no longer referenced, it&#8217;ll eventually get garbage collected.</p>
<p>The important point here is that an object literal is an expression that creates a new instance of an object, not unlike calling a constructor. It&#8217;s kind of similar to something like this:</p>
<pre style="padding-left:30px;">var p = new Point2D(f(xval), g(yval));</pre>
<p>except that Point2D, being a JavaFX class, doesn&#8217;t actually have a (Number, Number) constructor.</p>
<p>Usually we don&#8217;t want to create new instances of objects when the bind-expression is re-evaluated. In some sense we might prefer to do something like this:</p>
<pre style="padding-left:30px;">var p = Point2D { x: bind f(xval) y: bind g(yval) };</pre>
<p>Instead of creating a new Point2D object each time <em>xval</em> or <em>yval</em> changes, it would create one object and mutate its variables in-place. This doesn&#8217;t work though, since the <em>x</em> and <em>y</em> variables of Point2D are <strong>public-init</strong>. To bind to a variable initializer in an object literal, that variable must be declared <strong>public</strong> so that code outside the class can modify it. So if you want to bind something that has type Point2D, you always end up creating new instances.</p>
<p>Most scene graph objects have <strong>public</strong> variables that can be bound. Consider this:</p>
<pre style="padding-left:30px;">var rect = Rectangle {
    x: bind xval
    y: bind yval
    width: bind wval
    height: bind hval
};</pre>
<p>This works quite nicely. One Rectangle instance is created and assigned to <em>rect</em>. If any of <em>xval</em>, <em>yval</em>, <em>wval</em>, or <em>hval</em> change, the variables in that single Rectangle instance are mutated, and the effect is that the Rectangle moves or changes size in-place in the scene graph. In turn, if you hook these values up to a Timeline or to one of the Transition classes, that&#8217;s how you get animations.</p>
<p>Now instead of writing all those binds, couldn&#8217;t we just do this?</p>
<pre style="padding-left:30px;">var rect = bind Rectangle {
    x: xval
    y: yval
    width: wval
    height: hval
};</pre>
<p>We <strong>could</strong> write this, and it would work, in that we&#8217;d get a Rectangle animating in the proper way. But it&#8217;s enormously wasteful. Each time <strong>any</strong> of <em>xval</em>, <em>yval</em>, <em>wval</em>, or <em>hval</em> changes, a new Rectangle instance is created and the old one is thrown away.</p>
<p>It gets worse.</p>
<pre style="padding-left:30px;">var g = Group {
    content: bind [
        Rectangle {
            x: xval
            y: yval
            width: wval
            height: hval
        }
    ]
];</pre>
<p>Now, when any of <em>xval</em>, <em>yval</em>, <em>wval</em>, or <em>hval</em> changes, a new Rectangle is created. Then, because the content sequence of the Group is bound, the old Rectangle is removed from the scene graph and the new Rectangle is inserted in its place. It&#8217;s quite common for an operation to change <strong>both</strong> the width and height of the Rectangle, by changing <em>wval</em> and <em>hval</em>. Let&#8217;s say <em>wval</em> changes first. This creates a new Rectangle and replaces the old Rectangle. Then, <em>hval</em> changes, and <strong>another</strong> new Rectangle is created and replaces the one that had just been created. Furthermore, replacing things in the scene graph is more expensive than moving pointers around. Additional calculations occur, such as recomputing bounds, invalidating and caching transformations, etc. Some of this can be done lazily (indeed, in the next release, more of it will be). But it&#8217;s undeniable that creating new objects, generating lots of garbage, and doing scene graph surgery because of where a <strong>bind</strong> is placed, is very expensive. It would be a lot more efficient to rewrite the above code like so:</p>
<pre style="padding-left:30px;">var g = Group {
    content: [
        Rectangle {
            x: bind xval
            y: bind yval
            width: bind wval
            height: bind hval
        }
    ]
};</pre>
<p>This mutates the Rectangle in-place, doesn&#8217;t generate any garbage, and doesn&#8217;t do any scene graph surgery. We&#8217;ve improved the efficiency of some of our code quite significantly just by moving <strong>bind</strong> around.</p>
<p>Now, what does this have to do with the auto-remove behavior that we&#8217;ve been debating? Let&#8217;s take a look at this variation:</p>
<pre style="padding-left:30px;">var g = bind Group {
    rotate: angle
    content: [
        Rectangle {
            x: xval
            y: yval
            width: wval
            height: hval
        }
    ]
};
</pre>
<p>Note that the <strong>bind</strong> is outside the group. This might look convenient, since the scene graph will automatically be updated if any of <em>angle</em>, <em>xval</em>, <em>yval</em>, <em>wval</em>, or <em>hval</em> is modified. But look carefully: suppose that the value of <em>angle</em> changes. Since it&#8217;s inside the Group object literal, a new Group object is created and its <em>rotate</em> variable is set to the new the new value of <em>angle</em>. There&#8217;s no need to create another Rectangle object, though, since none of its values have changed. Instead, the <strong>same</strong> Rectangle object is placed into the content variable of the new Group, which is then assigned to <em>g</em>. The old Group is unreferenced and will eventually be garbage collected. Now, who removes the Rectangle from the old Group? Aha!</p>
<p>This is where the auto-remove issue comes up. In the above code fragment, changing the value of <em>angle</em> causes the same Rectangle instance to be placed into the new Group, but it&#8217;s not removed from the old Group. As I mentioned previously, in release 1.1 auto-remove was the specified behavior, so placing the Rectangle into the new Group would automatically and silently remove it from the old Group. Furthermore, there&#8217;s really no way for application code to get in there and remove the Rectangle from the old Group first; the <strong>bind</strong> processing pretty much happens all at once. This would seem to be an argument in favor of auto-remove.</p>
<p>But wait, this code is pretty wasteful. It turns out that the auto-remove warning message was actually pretty useful, since it pointed out a bunch of places in our code where we were doing stuff like this: generating useless garbage and performing wasteful scene graph surgery. We ended up rewriting the code along these lines:</p>
<pre style="padding-left:30px;">var g = Group {
    rotate: bind angle
    content: [
        Rectangle {
            x: bind xval
            y: bind yval
            width: bind wval
            height: bind hval
        }
    ]
};
</pre>
<p>True, we had to write <strong>bind</strong> five times. But this made things much more efficient, since it didn&#8217;t create any excess objects and it avoided doing any scene graph surgery. It also got rid of the warning message! So that convinced us to leave the warning message in, to get people to fix their bad code, and eventually to turn the warning into an error and effectively disallow auto-remove.</p>
<p>Or did it?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=122&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2009/12/04/that-infernal-scene-graph-warning-message-ii/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>
	</item>
		<item>
		<title>Oracle OpenWorld 2009: Observations and Impressions</title>
		<link>http://stuartmarks.wordpress.com/2009/10/15/oracle-openworld-2009-observations-and-impressions/</link>
		<comments>http://stuartmarks.wordpress.com/2009/10/15/oracle-openworld-2009-observations-and-impressions/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 20:30:33 +0000</pubDate>
		<dc:creator>stuartmarks</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://stuartmarks.wordpress.com/?p=95</guid>
		<description><![CDATA[I&#8217;m attending a couple days of Oracle OpenWorld 2009. This won&#8217;t be quite live-blogging, but I&#8217;ll be updating this entry with more notes and observations as I get chance to add them. Update: Sections are in inverse chronological order, but within sections the notes are in forward order. I&#8217;ve also added details on the Fusion [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=95&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m attending a couple days of <a href="http://www.oracle.com/us/openworld/index.htm" target="_blank">Oracle OpenWorld 2009</a>. This won&#8217;t be quite live-blogging, but I&#8217;ll be updating this entry with more notes and observations as I get chance to add them. <strong>Update:</strong> Sections are in inverse chronological order, but within sections the notes are in forward order. I&#8217;ve also added details on the Fusion application suite demo and on the Treasure Island party.</p>
<h3>Customer Appreciation Event (evening Wed Oct 14)</h3>
<p>As a speaker I received a full conference pass, including a pass for the big party on Treasure Island. This was quite a privilege, as apparently Oracle employees (not even speakers) don&#8217;t get to go to this party.</p>
<p>[7:30pm] Hundreds of people are lined up to take chartered buses to Treasure Island. There&#8217;s apparently no parking there so buses and cabs and taxis are the only way for party guests on and off the island. We arrive and the place is big. Staggeringly big. Mind-bogglingly big. It&#8217;s like they&#8217;ve set up a county fair here for just one evening. There are two big tents each with several  buffets, rows of booths with more food, more booths with an open bar, carnival midway games (ball tossing, whack a mole, darts etc.) with stuffed animals as giveaways, and carnival rides like a ferris wheel, a drop tower, swing carousel, etc. Oh, and then there was the music.</p>
<p>[9:15pm] Aerosmith arrives onstage at the outdoor theater. There are probably a couple thousand people standing in an open area in front of the stage, and there are a couple thousand more in bleacher seats around them. The bleachers are pretty tall, maybe 40 rows high. They even have luxury boxes at the top, for the conference sponsors of course.</p>
<p>There was more music than talk, but here are some choice quotes from banter with the audience:</p>
<blockquote><p>We almost didn&#8217;t make it tonight, not because of the [B.S.] you heard about in the press, but because of some Mac event. But when we had to choose between Apples and Oracles we knew we made the right choice. &#8212; Steven Tyler</p></blockquote>
<blockquote><p>What&#8217;s the difference between Windows and viruses? Viruses keep getting better! &#8212; Steven Tyler [I think that joke would have worked better at the Apple party.]</p></blockquote>
<blockquote><p>This is the biggest frat party we&#8217;ve ever played. &#8212; Joe Perry</p></blockquote>
<p>Not being a huge Aerosmith fan, I didn&#8217;t recognize several of the songs they played. But they did play their big hits. Here&#8217;s a partial setlist:</p>
<ul>
<li>Dream On</li>
<li>Walkin&#8217; the Dog</li>
<li>Love In An Elevator</li>
<li>Livin&#8217; On The Edge</li>
<li>Walk This Way</li>
<li>Sweet Emotion (it looked like Perry played one note on a theremin)</li>
</ul>
<p>&#8211; encore &#8211;</p>
<ul>
<li>Joe Perry live duel against his Guitar Hero avatar</li>
<li>Train Kept A-Rollin&#8217;</li>
</ul>
<p>[10:50pm] Aerosmith&#8217;s set ended, so I wandered over to where Roger Daltrey was playing. His stage was set up in a large indoor tent area. It wasn&#8217;t quite as large as the Aerosmith stage but there was probably space for a couple thousand people. Unfortunately the sets overlapped, so he was already in the middle of his set when I arrived. I did hear a couple songs: <em>Ring Of Fire</em> (Johnny Cash style) and <em>Won&#8217;t Get Fooled Again</em>.</p>
<p>Other bands up were the Wailers and Three Dog Night. It was getting pretty late at this point though so I decided to skip them head home.</p>
<h3>Keynote (afternoon Wed Oct 14)</h3>
<p>[2:30pm] The Moscone North foyer (bottom of the escalators) is incredibly crowded. The Oracle logo, is everywhere. Banners, carpets, every surface you can think of. It&#8217;s hard to believe this is the same place where JavaOne happens. It looks so different.</p>
<p>The shoe-shine stand is open. Hm, they didn&#8217;t have the shoe-shine stand at JavaOne. I wonder why? <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>[2:50pm] Charles Phillips, Oracle President. Roger Daltrey stepped on stage and said a few words; promo for tonight&#8217;s &#8220;customer appreciation&#8221; concert.</p>
<p>[3:00pm] Kris Gopalakrishnan (founder InfoSys, a platinum sponsor) spoke on IT innovation in industry. Gap between intent and action in IT innovation: 78% of banks think innovation is important, but only 37% have an innovation plan. IT is about interconnection. We no longer should think about a value chain, but a value web. &#8220;No man is an island&#8221; &#8212; similarly, no enterprise is an island.</p>
<p>[3:35pm] Larry Ellison takes the stage.</p>
<ul>
<li> Status update: Oracle Enterprise Linux and Virtual Machine. Very pleased with uptake. 65% of Linux installations running Oracle RDBMS run Oracle Enterprise Linux. Smaller percentages for Red Hat, SUSE, and others.</li>
<li> Exadata 2: Sun/Oracle Announcement. This is a Linux/Intel box. Different from the Sunday announcement, which set the TPC-C records, which is a SPARC Enterprise T5440 machine running Oracle Database 11g on Solaris. (IBM is challenging Oracle&#8217;s claims of 16x their performance; they say it&#8217;s really only 6x the IBM machine&#8217;s performance. &#8220;They might be right. IBM also forgot to point out that their machine consumes 6x the energy of ours.&#8221;) Exadata 2 shows really impressive numbers. For example, a single rack Exadata 2 will do 1 million random I/O operations per second. Two racks do 2m, etc. Exadata 2 is fault tolerant, while IBM is not; Exadata 2 costs about a quarter of the competing IBM product; Exadata 2 is modularly expandable, whereas IBM&#8217;s need to be replaced entirely to be upgraded. &#8220;The fastest business computer that has ever been built.&#8221;</li>
</ul>
<p>[4:00pm] Special surprise guest: Arnold Schwarzenegger! &#8220;This conference is about pumping you up.&#8221; California is the world&#8217;s technology leader. Technology can help reduce errors in medical care; can help fight global warming; biotech and stem cell research can help Alzheimer&#8217;s sufferers; can grow algae for ship fuel; electric cars (Tesla); improved efficiency in the power grid (Smart Grid). Acknowledges two great California technology companies, two great success stories: Oracle and Sun, Larry Ellison and Scott McNealy [applause]. Employers of 16,000 people in CA and 150,000 people worldwide. Wishes the combined companies great success. California&#8217;s state IT infrastructure also improving. GIS being used to help firefighters&#8217; helicopters drop fire retardant more accurately even if the area is obscured by smoke. People&#8217;s lives and homes at stake. Confident in the future: we face enormous challenges that can be overcome with technological innovation. Global warming negotiation going on in Copenhagen. We hope this goes well but it&#8217;s a political negotiation. The real work is done here, in technology. &#8220;When this conference is over, don&#8217;t go home. Stay in California and spend money! We need the revenue!&#8221;</p>
<p>[4:30pm] Larry Ellison returns to the stage.</p>
<ul>
<li> New Product Support System. Proactive problem prevention. Keeps track of configurations; can alert potential problems experienced by other customers with similar configurations. Unification of Enterprise Manager and MyOracle service. A couple demos of service management by Richard Sarwal who has returned to Oracle from VMware.</li>
<li> Fusion Applications. Customers have made a huge investment in Siebel, JD Edwards, Peoplesoft,etc. Committed to support these product lines for a decade. [Mild applause.] Oracle has $3bn R&amp;D budget. Can maintain software you&#8217;re running today, but also develop new software you can migrate to tomorrow, next year, or in ten years. Fusion is brand new. SOA. Easily connected to existing suites. Fusion coexists with existing applications, can replace individual apps as needed or augment with new ones. Not developed in isolation; developed in close collaboration with customers. Has a &#8220;modern UI.&#8221; Enormous project: 6000 tables, 20,000 views. Fusion v1 code complete, in test with customers, will be delivered next year. Only suite built on standards-based middleware. All standards-based, all Java-based Fusion middleware. No custom components. UI is business-intelligence driven; &#8220;exception-based&#8221;. Steve Miranda, Chris Mayo: demo of Fusion. The demo included fixing a problem with an Exadata V2 order from Stark Industries. &#8220;We really need to fix this problem, because you know what happens when Tony Stark gets mad.&#8221; I don&#8217;t think anybody got the joke though.</li>
</ul>
<p>[5:15pm] Session ends. I now have some dead time until the evening event. This is totally not a geek conference. There are bean-bag chairs at the foot of the escalators in Moscone North (kind of like JavaOne) but they&#8217;re only half occupied. Power and network are easy to come by. There are still guys getting their shoes shined.</p>
<h3>Oracle Bloggers Meetup (evening Tue Oct 13)</h3>
<p>Pythian sponsored a <a href="http://www.pythian.com/news/3745/bloggers-meetup-oracle-open-world-2009?tag_shortener" target="_blank">bloggers meetup</a> at a bar in the Metreon this evening. Thanks to Alex Gorbachev for arranging it. Richard and I both went. This was pretty cool. We met a few Oracle folks there. There were also some Sun folks there (including blogger extraordinaire <a href="http://www.tbray.org/ongoing/" target="_blank">Tim Bray</a>).</p>
<p>It&#8217;s not like this was a substantial session or anything but some of the conversations got me thinking about Oracle&#8217;s strategy in buying Sun. One perspective is that Oracle is an Enterprise Software company. After all, that&#8217;s what they do today, and they have a $23bn business doing it. From this standpoint Oracle would mine out Sun&#8217;s software assets (primarily Java) and jettison the rest. But that rests on the assumption that Oracle is simply going to continue to be an Enterprise Software company. That&#8217;s not necessarily the case. So, where will Oracle go next?</p>
<p>Some clues are emerging at OpenWorld. Sun hardware has played quite a strong role here. First there were the Sunday announcements of the TPC-C record on Sun&#8217;s T5440. Then there&#8217;s the Exadata 2 announcement, which is based on Sun hardware. (I&#8217;m writing this in retrospect, but Ellison&#8217;s Wednesday keynote segment on the Exadata 2 was all about hitting IBM repeatedly and very, very hard.) So maybe Oracle is no longer going to be an enterprise <em>software</em> company, but instead an enterprise <em>systems</em> company.</p>
<p>What does this mean for JavaFX? Of course, nobody knows for sure. But any enterprise <em>systems</em> company is going to have to figure out what to do about the client side. Will Oracle settle for open technologies such as Ajax, or will they rely on other companies&#8217; proprietary technologies like Flash and Silverlight? When Ellison spoke at JavaOne he talked about how important Java and JavaFX are. So maybe that&#8217;s a hint at the answer.</p>
<h3>Our JavaFX Talk at Oracle Develop (afternoon Tue Oct 13)</h3>
<p>Richard Bair and I gave our introduction to JavaFX talk in the &#8220;Develop&#8221; stream of Oracle OpenWorld. The talk went pretty well. We deviated from the slides a lot though&#8230; Rich spent a lot of time typing live code into NetBeans and demonstrating immediate results. This actually went quite well. I think the audience (which consisted entirely of Java developers) appreciated the live coding exercise much more than slideware.</p>
<p>I did my part with a live demo of the JavaFX Production Suite, exporting artwork from Adobe Illustrator using the Suite, and bringing it into a simple JavaFX app in NetBeans and displaying and rotating it.</p>
<p>We were in a fairly small room (capacity 100) and there were about 25 attendees. This seemed small to us compared to JavaOne, where a small room fits 500. But I think this was typical for the Develop talks. While OpenWorld is a huge conference &#8212; I think I heard 37,000 attendees &#8212; it&#8217;s a business conference, not a developer conference. Oracle Develop was relegated to the &#8220;ghetto&#8221; of the Hilton San Francisco. It was crowded, but the space was much smaller than Moscone. I think Oracle Develop might have had only on the order of a thousand attendees. Compared to JavaOne, a developer conference that usually attracts over 10,000 and has had up t0 25,000, Oracle Develop is quite small.</p>
<p>Having a small audience had its advantages. There&#8217;s a lot less pressure, it&#8217;s more interactive, and while not quite intimate, it was easier to create personal connections with people in the audience. There were some good questions and a couple attendees hung around with us afterward and had in-depth conversations. I think they learned a lot from our talk, and in turn we learned a lot from talking to them. In that respect the talk was a success.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/stuartmarks.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/stuartmarks.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/stuartmarks.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/stuartmarks.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/stuartmarks.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/stuartmarks.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/stuartmarks.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/stuartmarks.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/stuartmarks.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/stuartmarks.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/stuartmarks.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/stuartmarks.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/stuartmarks.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/stuartmarks.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=stuartmarks.wordpress.com&#038;blog=6321442&#038;post=95&#038;subd=stuartmarks&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://stuartmarks.wordpress.com/2009/10/15/oracle-openworld-2009-observations-and-impressions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/673218f7a9f4d7bdd51c677af6a43a2f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">stuartmarks</media:title>
		</media:content>
	</item>
	</channel>
</rss>
