<?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>Pixel Duke</title>
	<atom:link href="http://pixelduke.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://pixelduke.wordpress.com</link>
	<description></description>
	<lastBuildDate>Tue, 10 Jan 2012 15:24:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='pixelduke.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/55ab9e68dde05f81cd74a96b23818f95?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Pixel Duke</title>
		<link>http://pixelduke.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://pixelduke.wordpress.com/osd.xml" title="Pixel Duke" />
	<atom:link rel='hub' href='http://pixelduke.wordpress.com/?pushpress=hub'/>
		<item>
		<title>2011 in review</title>
		<link>http://pixelduke.wordpress.com/2012/01/02/2011-in-review/</link>
		<comments>http://pixelduke.wordpress.com/2012/01/02/2011-in-review/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 00:53:07 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=310</guid>
		<description><![CDATA[The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog. Here&#8217;s an excerpt: A San Francisco cable car holds 60 people. This blog was viewed about 3,100 times in 2011. If it were a cable car, it would take about 52 trips to carry that many people. Click here to see the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=310&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The WordPress.com stats helper monkeys prepared a 2011 annual report for this blog.</p>
<p><a href="/2011/annual-report/"><img src="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" alt="" width="100%" /></a></p>
<p>Here&#8217;s an excerpt:</p>
<blockquote><p>A San Francisco cable car holds 60 people. This blog was viewed about <strong>3,100</strong> times in 2011. If it were a cable car, it would take about 52 trips to carry that many people.</p></blockquote>
<p><a href="/2011/annual-report/">Click here to see the complete report.</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/310/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/310/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/310/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=310&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2012/01/02/2011-in-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>

		<media:content url="http://www.wordpress.com/wp-content/mu-plugins/annual-reports/img/emailteaser.jpg" medium="image" />
	</item>
		<item>
		<title>JavaFX Empty Path Issue</title>
		<link>http://pixelduke.wordpress.com/2011/12/25/javafx-empty-path-issue/</link>
		<comments>http://pixelduke.wordpress.com/2011/12/25/javafx-empty-path-issue/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 21:05:21 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=298</guid>
		<description><![CDATA[Some time ago I stumbled upon an issue with JavaFX that was generating a lot of rendering glitches, namely: objects disappearing or partially disappearing. As can be seen it the pictures. Thankfully, I was able to isolate the source of the problem and also an easy workaround. This issue happens when you have an empty [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=298&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_303" class="wp-caption alignleft" style="width: 208px"><a href="http://pixelduke.files.wordpress.com/2011/12/renderingglitches2.png"><img class="size-full wp-image-303" title="renderingGlitches2" src="http://pixelduke.files.wordpress.com/2011/12/renderingglitches2.png?w=480" alt=""   /></a><p class="wp-caption-text">With rendering glitches</p></div>
<div id="attachment_300" class="wp-caption alignleft" style="width: 208px"><a href="http://pixelduke.files.wordpress.com/2011/12/withoutglitches.png"><img class="size-full wp-image-300" title="WithoutGlitches" src="http://pixelduke.files.wordpress.com/2011/12/withoutglitches.png?w=480" alt=""   /></a><p class="wp-caption-text">WITHOUT rendering glitches</p></div>
<p>Some time ago I stumbled upon an issue with JavaFX that was generating a lot of rendering glitches, namely: objects disappearing or partially disappearing. As can be seen it the pictures. Thankfully, I was able to isolate the source of the problem and also an easy workaround.</p>
<p>This issue happens when you have an empty Path object on your scenegraph, that is a Path without any elements added to it. The solution: just add paths which are not empty to the scenegraph, wait till you populate the path and then only then add it to the scenegraph. Another option is to pass in the following to the JVM &#8220;-Dprism.dirtyopts=false&#8221;, this will turn off the dirty region optimization and force a complete repaint of the scene each time the scene changes.</p>
<p>It has been fixed on JavaFX 2.1: : <a href="http://javafx-jira.kenai.com/browse/RT-18080">http://javafx-jira.kenai.com/browse/RT-18080</a>. However till then you&#8217;ll have to rely on this easy workaround.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/298/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/298/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/298/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=298&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2011/12/25/javafx-empty-path-issue/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>

		<media:content url="http://pixelduke.files.wordpress.com/2011/12/renderingglitches2.png" medium="image">
			<media:title type="html">renderingGlitches2</media:title>
		</media:content>

		<media:content url="http://pixelduke.files.wordpress.com/2011/12/withoutglitches.png" medium="image">
			<media:title type="html">WithoutGlitches</media:title>
		</media:content>
	</item>
		<item>
		<title>PopupMenu in JavaFX 2</title>
		<link>http://pixelduke.wordpress.com/2011/12/11/popupmenu-in-javafx/</link>
		<comments>http://pixelduke.wordpress.com/2011/12/11/popupmenu-in-javafx/#comments</comments>
		<pubDate>Sun, 11 Dec 2011 18:34:53 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=253</guid>
		<description><![CDATA[Creating Popup Menus To create a Popupmenu in JavaFX you can use the ContextMenu class. You add MenuItems to it and can also create visual separators using SeparatorMenuItem. In the example below I&#8217;ve opted to subclass ContextMenu and add the MenuItems on its constructor. Line 5: I get the Collection of children of the ContextMenu [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=253&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Creating Popup Menus</strong><br />
<a href="http://pixelduke.files.wordpress.com/2011/12/popup.png"><img class="size-full wp-image-254 aligncenter" title="popup" src="http://pixelduke.files.wordpress.com/2011/12/popup.png?w=480" alt=""   /></a></p>
<p>To create a Popupmenu in JavaFX you can use the ContextMenu class. You add MenuItems to it and can also create visual separators using SeparatorMenuItem.</p>
<p>In the example below I&#8217;ve opted to subclass ContextMenu and add the MenuItems on its constructor.</p>
<p><pre class="brush: java; wrap-lines: false;">
public class AnimationPopupMenu extends ContextMenu{
public AnimationPopupMenu()
{
(...)
  getItems().addAll(
    MenuItemBuilder.create()
    .text(ADD_PARTICLE)
    .graphic(createIcon(...))
    .onAction(new EventHandler() {
    @Override
    public void handle(ActionEvent actionEvent) {
      // some code that gets called when the user clicks the menu item
    }
    })
    .build(),

(...)
    SeparatorMenuItemBuilder.create().build(),
    MenuItemBuilder.create()
    .text(ADD_DISTANCE_MEASURER)
    .onAction(new EventHandler() {
    @Override
    public void handle(ActionEvent actionEvent) {
      // Some code that will get called when the user clicks the menu item
    }
  })
  .graphic(createIcon(...))
  .build(),
(...)
  );
}

</pre></p>
<ul>
<li>Line 5: I get the Collection of children of the ContextMenu and call addAll to add the MenuItems;</li>
<li>Line 6: Uses the MenuItem builder do create a MenuItem;</li>
<li>Line 7: Passes in the text of the menu item. Variable ADD_PARTICLE is equal to &#8220;Add Particle&#8221;;</li>
<li>Line 8: Calls graphic which receives the menu item icon returned by createIcon:
<div><pre class="brush: java; first-line: 32; wrap-lines: false;">

    ImageView createIcon(URL iconURL)
    {
        return ImageViewBuilder.create()
                               .image(new Image(iconURL.toString()))
                               .build();
    }
</pre></p>
</div>
</li>
<li>Line 9: onAction receives the event handler which will be called when the user clicks the menu item;</li>
<li>Line15: Finally the MenuItem gets created by executing build() on the MenuItemBuilder class;</li>
<li>Line18: Creates The Separator which you can see on the figure on the start of this post. It&#8217;s the dotted line between &#8220;Add Origin&#8221; and &#8220;Add Distance Measurer&#8221;;</li>
<li>The other lines of code just repeat the same process to create the rest of the menu items.</li>
</ul>
<p><strong><br />
</strong></p>
<p><strong>Using JavaFX Popup Menus inside JFXPanel </strong></p>
<p>If your embeding a JavaFX scene in a Swing app you&#8217;ll have to do some extra steps manually, if you don&#8217;t there won&#8217;t be hover animations on the popup menu and it won&#8217;t get dismissed automatically when the user clicks outside of it. There is a fix targeted at JavaFX 3.0 for this &#8211;  <a href="http://javafx-jira.kenai.com/browse/RT-14899">http://javafx-jira.kenai.com/browse/RT-14899</a></p>
<p>First you&#8217;ll have to request the focus on the javafx container so that the popup gets hover animations and when you click outside your app window it gets dismissed. In my case I pass a reference to the javafx swing container on the construtor of the popup menu, then I&#8217;ve overwritten the show method of ContextMenu so as to request the focus on the swing container before actually showing the popup:</p>
<p><pre class="brush: java; wrap-lines: false;">
public void show(Node anchor, MouseEvent event)
{
  wrapper.requestFocusInWindow();
  super.show(anchor, event.getScreenX(), event.getScreenY());
}
</pre></p>
<p>And lastly you&#8217;ll have to also dismiss the popup when the user clicks inside the javafx scene but outside of the popup by calling hide().</p>
<p>I almost forgot.. thanks to Martin Sladecek (Oracle JavaFX team) for giving me some pointers.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/253/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/253/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/253/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=253&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2011/12/11/popupmenu-in-javafx/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>

		<media:content url="http://pixelduke.files.wordpress.com/2011/12/popup.png" medium="image">
			<media:title type="html">popup</media:title>
		</media:content>
	</item>
		<item>
		<title>Migrating from javafx 1.3 to javafx 2.0</title>
		<link>http://pixelduke.wordpress.com/2011/12/03/migrating-from-javafx-1-3-to-javafx-2-0/</link>
		<comments>http://pixelduke.wordpress.com/2011/12/03/migrating-from-javafx-1-3-to-javafx-2-0/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 19:11:21 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=233</guid>
		<description><![CDATA[Some days ago I finished migrating the source code of Modellus from javafx 1.3 script to Javafx 2.0 java language. So I thought it would be nice to write about what I&#8217;ve learned in the process. I&#8217;d like to point out that if you want to keep using javafx script in javafx 2.0 you can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=233&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some days ago I finished migrating the source code of Modellus from javafx 1.3 script to Javafx 2.0 java language. So I thought it would be nice to write about what I&#8217;ve learned in the process.</p>
<p>I&#8217;d like to point out that if you want to keep using javafx script in javafx 2.0 you can use Visage: <a href="http://code.google.com/p/visage/">http://code.google.com/p/visage/</a></p>
<ol>
<li>CustomNode class doesn&#8217;t exist any more. Extend Group or Region to create &#8220;custom nodes&#8221;.</li>
<li>No more blocksMouse.
<div>In javafx 2.0 mouse events are only received by the top most node.</div>
<div>There is also a new method on Node: setMouseTransparent(boolean). Mouse events on node with mouseTransparent set to true will be ignored and captured by the topmost node below.</div>
</li>
<li>Use properties to bind values.
<div>Javafx 2.0 has a set of classes you can use to bind values to each other. For each primitive type there is a class &#8211; SimpleBooleanProperty, SimpleDoubleProperty, etc, and for reference types you use an Object Property instance, for instance if you want to bind colors you can use SimpleObjectProperty&lt;Color&gt;.</div>
</li>
<li>Not all variables from the API are &#8220;bindable&#8221;.
<div>
In Javafx 1.3 script you could bind to any variable of the API. In javafx 2.0 java language, that means that all variables from the API would need to be available as propertys. But that is not the case, for instance Bounds, LinearGradient, Stop are examples of classes that do not have propertys, so you can&#8217;t bind directly to their fields.  In this situations you&#8217;ll need to use other methods like <a href="http://docs.oracle.com/javafx/2.0/binding/jfxpub-binding.htm">low-level binding</a>.</p>
<div>For example suppose you wanted to bind a variable to the width of the layout bounds of a node. Since the field width of Bounds is not available as a property you would have to do something like this:</div>
<p>In Javafx script:</p>
<p><pre class="brush: plain; wrap-lines: false;">
float nameLabelXPosition = bind - nameLabel.layoutBounds.width / 2;
</pre></p>
<p>In Javafx2.0 java language:</p>
<p><pre class="brush: java; wrap-lines: false;">
nameLabelXPosition.bind(new DoubleBinding() {
    {
        super.bind(nameLabel.layoutBoundsProperty());
    }

    @Override
    protected double computeValue() {
        return nameLabel.getLayoutBounds().getWidth() / 2;
    }
});
</pre></p>
</div>
</li>
<li>When you used javafx script initiliazer blocks you can now use javafx <a href="http://weblogs.java.net/blog/opinali/archive/2011/05/28/javafx-20-beta-first-impressions">builders</a>.
<div>However in javafx script you could use binding in the initializer block, on java you can&#8217;t do that with builders. Only in JavaFX 3.0 (Lombard) will you be able to do that:<a href="http://javafx-jira.kenai.com/browse/RT-13680">http://javafx-jira.kenai.com/browse/RT-13680</a>. So, whenever you used binding on javafx script initializer blocks you can&#8217;t use builders in java javafx 2.0.</div>
</li>
<li>No more language level support for sequences on javafx 2.0 java.
<div>Wherever you used sequences you now will use ObservableLists. To create ObservableLists you can use FXColections creator methods, there you&#8217;ll find all sorts of methods to create ObservableLists, even empty ones.</div>
<div>Sequences present on the API have been converted to ObservableLists. If, for instance, you want to insert a node on a Group you need to get it&#8217;s children ObservableList and than call the method add on it. Like so: .getChildren().add(Node)</div>
</li>
<li>No more function types.
<div>Since only on java8 will there be support for Closures, the Oracle team has relied on the use of SAM types instead. That is a Class with only a single abstract method that you&#8217;ll have to override (Single Abstract Method). You can use the same strategy as Oracle and write SAM types wherever you used function objects.</div>
</li>
<li>No more triggers.
<div>Replace triggers with change listeners. You can assign a change listener to a property which is the same as assign a trigger on javafx script.</div>
</li>
<li>No more variable overrides on subclasses.
<div>For these one you won&#8217;t have a substitute on java, the best thing you can do is reassign a value to the variable on a subclass. But it is not the same, since overriding variables, assigned values before initializer blocks of superclass were invoked.</div>
</li>
</ol>
<p>For further reading on this topic checkout:<br />
<a href="http://weblogs.java.net/blog/opinali/archive/2011/05/28/javafx-20-beta-first-impressions">http://weblogs.java.net/blog/opinali/archive/2011/05/28/javafx-20-beta-first-impressions</a></p>
<p>If you have any more valuable tips on this topic which I don&#8217;t cover please add them in the comments and I&#8217;ll insert them in the post.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/233/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/233/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/233/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=233&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2011/12/03/migrating-from-javafx-1-3-to-javafx-2-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>
	</item>
		<item>
		<title>Convert to and from BufferedImage in javafx 2.0</title>
		<link>http://pixelduke.wordpress.com/2011/11/20/swing-utilities-for-javafx/</link>
		<comments>http://pixelduke.wordpress.com/2011/11/20/swing-utilities-for-javafx/#comments</comments>
		<pubDate>Sun, 20 Nov 2011 20:46:01 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=212</guid>
		<description><![CDATA[While porting Modellus from javafx1.3 using  javafx script to javafx2.0 using java language I ended up creating a class with a few helper methods for converting swing objects to and from javafx objects: Converting from java.awt.color  to javafx.scene.paint.Color and vice versa Converting from java.awt.image.BufferedImage to javafx.scene.image.Image and vice versa Nothing too fancy but I thought [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=212&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While porting Modellus from javafx1.3 using  javafx script to javafx2.0 using java language I ended up creating a class with a few helper methods for converting swing objects to and from javafx objects:</p>
<ul>
<li>Converting from java.awt.color  to javafx.scene.paint.Color and vice versa</li>
<li>Converting from java.awt.image.BufferedImage to javafx.scene.image.Image and vice versa</li>
</ul>
<p>Nothing too fancy but I thought it might come in handy to other people so here&#8217;s the code:</p>
<p><pre class="brush: java; wrap-lines: false;">
public class SwingUtils {

    public static java.awt.Color toAWTColor(javafx.scene.paint.Color fxColor)
    {
        return new java.awt.Color((float)fxColor.getRed(), (float)fxColor.getGreen(), (float)fxColor.getBlue(), (float)fxColor.getOpacity());
    }

    public static javafx.scene.paint.Color fromAWTColor(java.awt.Color awtColor)
    {
        return ColorBuilder.create()
                            .red(awtColor.getRed() / 255.0)
                            .green(awtColor.getGreen() / 255.0)
                            .blue(awtColor.getBlue() / 255.0).build();
    }

    // There is a problem with this implementation: transparent pixels on the BufferedImage aren't converted to transparent pixels on the fxImage.
    public static javafx.scene.image.Image convertToFxImage(java.awt.image.BufferedImage awtImage) {
    	if (Image.impl_isExternalFormatSupported(BufferedImage.class)) {
    		return javafx.scene.image.Image.impl_fromExternalImage(awtImage);
    	} else {
    		return null;
    	}
    }

    public static java.awt.image.BufferedImage convertToAwtImage(javafx.scene.image.Image fxImage) {
    	if (Image.impl_isExternalFormatSupported(BufferedImage.class)) {
    		java.awt.image.BufferedImage awtImage = new BufferedImage((int)fxImage.getWidth(), (int)fxImage.getHeight(), BufferedImage.TYPE_INT_ARGB);
        	return (BufferedImage)fxImage.impl_toExternalImage(awtImage);
    	} else {
    		return null;
    	}
    }
}
</pre></p>
<p>This will probably be added on Lombard (next javafx version) as shown by this issue: <a href="http://javafx-jira.kenai.com/browse/RT-14038">http://javafx-jira.kenai.com/browse/RT-14038</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=212&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2011/11/20/swing-utilities-for-javafx/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>
	</item>
		<item>
		<title>Modellus 5 beta 1 release</title>
		<link>http://pixelduke.wordpress.com/2010/10/10/modellus-5-beta-1-release/</link>
		<comments>http://pixelduke.wordpress.com/2010/10/10/modellus-5-beta-1-release/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 20:49:22 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[Modellus]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=204</guid>
		<description><![CDATA[Modellus 5 beta1 is available for download here. This version should be extremely usable. Unpack files and run Modellus5.jar through the JVM (Java 1.6 update 20 is the minimum requirement). This is the PC version, I suspect some things won&#8217;t work on Mac and Linux although I haven&#8217;t tried it yet. Modellus 5 is free. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=204&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://pixelduke.files.wordpress.com/2010/10/modellus5beta1.png"><img class="size-full wp-image-205 alignnone" title="Modellus5beta1" src="http://pixelduke.files.wordpress.com/2010/10/modellus5beta1.png?w=480&#038;h=360" alt="" width="480" height="360" /></a></p>
<p>Modellus 5 beta1 is available for download <a href="http://code.google.com/p/modellus5/downloads/detail?name=modellus5.zip&amp;can=2&amp;q=">here</a>. This version should be extremely usable.</p>
<p>Unpack files and run Modellus5.jar through the JVM (Java 1.6 update 20 is the minimum requirement). This is the PC version, I suspect some things won&#8217;t work on Mac and Linux although I haven&#8217;t tried it yet.</p>
<p>Modellus 5 is free. It is primarily used to aid teaching. By using only a mathematical  language (no need to learn any new language) students and teachers are  able to create models which then they can interact/view using  animations/graphs/tables, etc.</p>
<p>From a technical standpoint, this version was created using javafx and swing. The animation window (background) was done in javafx while all the rest is Swing.</p>
<p>I&#8217;ll be posting more information about this version, shortly.</p>
<p>There are some examples you can try: <a href="http://code.google.com/p/modellus5/downloads/detail?name=Modellus4_01Examples.zip&amp;can=2&amp;q=">here</a> and <a href="http://www.fisicanalixa.blogspot.com/">here</a> these are Modellus 4 examples though, they don&#8217;t use version 5 new features.</p>
<p>Let me know of any bugs you encounter or feature requests.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=204&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2010/10/10/modellus-5-beta-1-release/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>

		<media:content url="http://pixelduke.files.wordpress.com/2010/10/modellus5beta1.png" medium="image">
			<media:title type="html">Modellus5beta1</media:title>
		</media:content>
	</item>
		<item>
		<title>Event handling proposal</title>
		<link>http://pixelduke.wordpress.com/2010/08/01/event-handling-proposal/</link>
		<comments>http://pixelduke.wordpress.com/2010/08/01/event-handling-proposal/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 14:22:26 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[JavaFX]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=191</guid>
		<description><![CDATA[JavaFX brings a new event handling approach, making an improvement over the Java use of the too verbose observer pattern. Normally in javafx you&#8217;ll use binding to listen to state changes and update other objects as appropriate. However this approach is not adequate when you want to listen to something that doesn&#8217;t imply a state [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=191&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>JavaFX brings a new event handling approach, making an improvement over the Java use of the too verbose observer pattern.</p>
<p>Normally in javafx you&#8217;ll use binding to listen to state changes and update other objects as appropriate. However this approach is not adequate when you want to listen to something that doesn&#8217;t imply a state change, something like say pressing a button (not a two state button, that would involve state).</p>
<p>With this post I wanted to share an idea I had about how javafx could handle those cases not covered by binding.</p>
<p>In JavaFX functions are variables, you can have a sequence of functions with this:</p>
<pre>var buttonPressedListeners: function(:MouseEvent)[];</pre>
<p>Let&#8217;s say you have a button and every time the button is pressed you iterate through the sequence above and call the listener functions. If you want to expose this to any interested listener you can declare the above sequence public. Now lets say a listener wants to register for listening, he can do so by inserting a function on the listener sequence:</p>
<pre>insert fooListener into button.buttonPressedListeners;</pre>
<p>If he wants to unregister this simple call would do it:</p>
<pre>delete fooListener from button.buttonPressedListeners;</pre>
<p>There is however a problem with this, you can insert the same listener two times into the sequence. We could iterate through the sequence list and check for duplicates but  that would imply writing the same boiler plate code over and over again. So I would propose a language feature to enable declaring a sequence which doesn&#8217;t allow repeating values. Something like:</p>
<pre>var buttonPressedListeners:  function(:MouseEvent) <strong>unique</strong> [];</pre>
<p>Every time you want to call the functions on the sequence you&#8217;ll have to write down a for each statement which iterates through the sequence of functions, to fix this I would propose a second language feature: the ability to call all the functions in a function sequence with a single method call.</p>
<p>And that&#8217;s my event handling proposal. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/191/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/191/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/191/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=191&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2010/08/01/event-handling-proposal/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>
	</item>
		<item>
		<title>Moving on&#8230;</title>
		<link>http://pixelduke.wordpress.com/2010/06/29/moving-on/</link>
		<comments>http://pixelduke.wordpress.com/2010/06/29/moving-on/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 21:53:28 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=186</guid>
		<description><![CDATA[On July 1st I&#8217;ll be no longer working full time with Modellus and as a consequence with JavaFX. I will however continue to work on it as an hobby, Modellus 5 is almost complete and I wish on having a very usable version on September. From that point one, I preview Modellus will start to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=186&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignnone" style="width: 510px"><a href="http://www.flickr.com/photos/mundilfari_gjk/"><img src="http://pixelduke.files.wordpress.com/2010/06/2322036241_4c00bb3f02.jpg?w=500&#038;h=374" alt="" width="500" height="374" /></a><p class="wp-caption-text">Image by Mundilfari</p></div>
<p>On July 1st I&#8217;ll be no longer working full time with Modellus and as a consequence with JavaFX. I will however continue to work on it as an hobby, Modellus 5 is almost complete and I wish on having a very usable version on September.<br />
From that point one, I preview Modellus will start to evolve at a quick pace taking advantage of the change of swing to javafx.</p>
<p>Despite some flawed features and omissions I&#8217;ve grown to like JavaFX very much, I think its based on solid concepts and will grow to become a very powerful language. I hope somewhere in the future I can continue working with it at a professional level..</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/186/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/186/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/186/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=186&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2010/06/29/moving-on/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>

		<media:content url="http://pixelduke.files.wordpress.com/2010/06/2322036241_4c00bb3f02.jpg" medium="image" />
	</item>
		<item>
		<title>Modellus new animated characters</title>
		<link>http://pixelduke.wordpress.com/2010/04/24/modellus-new-animated-characters/</link>
		<comments>http://pixelduke.wordpress.com/2010/04/24/modellus-new-animated-characters/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 03:48:21 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[Modellus]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=121</guid>
		<description><![CDATA[Thanks to Feel Fine who has given us all their assets from their funny game Sweet Dreams (available on the IPhone) for free, we were able to add a bit more fun for kids learning science subjects through the use of Modellus. On a technical aspect I don&#8217;t think there is much to say because [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=121&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://pixelduke.files.wordpress.com/2010/04/giraffe6000.png"><img class="size-full wp-image-133" title="giraffe6000" src="http://pixelduke.files.wordpress.com/2010/04/giraffe6000.png?w=480" alt=""   /></a></p>
<p>Thanks to Feel Fine who has given us all their assets from their funny game Sweet Dreams (available on the IPhone) for free, we were able to add a bit more fun for kids learning science subjects through the use of Modellus.</p>
<p>On a technical aspect I don&#8217;t think there is much to say because I found things rather easy, the hardest part was retouching the images to fit nicely on Modellus format.<br />
For every animation i use something like this Timeline :</p>
<pre>var animationX:Timeline = Timeline {
 repeatCount: Timeline.INDEFINITE
 keyFrames: [
  KeyFrame {
   time: 0s
  },
  KeyFrame {
   time: 1s / fpsPerSecond
   action: function()
   {
     currentFrameIndex = (<code>currentFrameIndex </code><code>+ 1) mod (sizeof frames); <span style="color:#888888;">// change frame index</span>
     currentImage = </code><code>frames</code><code>[</code><code>currentFrameIndex</code><code>]; <span style="color:#888888;">// change currentImage which is bound to an ImageView image property</span>
     if (currentSelectedFramesIndex == (sizeof selectedFrames) - 1)
     {</code>
       <span style="color:#888888;">// This is the final frame. I'm just going to stop the animation</span>
       <code> </code><code>animationX</code><code>.stop();</code>

     }
   }
 }
 ]
};</pre>
<p>You can see the new characters in action on the following video &#8211; <strong>the animations are actually much smoother than in the video</strong> <strong>(don&#8217;t know why)</strong>:<br />
<span style="text-align:center; display: block;"><a href="http://pixelduke.wordpress.com/2010/04/24/modellus-new-animated-characters/"><img src="http://img.youtube.com/vi/ZjoSKMUxXO8/2.jpg" alt="" /></a></span></p>
<p><span style="color:#000000;">If you&#8217;re a designer and would like to contribute some of your work: icons, animations, etc to Modellus please contact me (we don&#8217;t have the necessary time to create them) &#8211; mail is on the about page. Modellus is a free tool, used all around the globe, which aims to aid teaching of science subjects. Please help us shape the future of teaching making it more fun and less abstract. Your work will be credited and will obviously still remain your property.</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=121&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2010/04/24/modellus-new-animated-characters/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>

		<media:content url="http://pixelduke.files.wordpress.com/2010/04/giraffe6000.png" medium="image">
			<media:title type="html">giraffe6000</media:title>
		</media:content>
	</item>
		<item>
		<title>JavaFX 1.3 &#8211; What to expect..</title>
		<link>http://pixelduke.wordpress.com/2010/04/13/javafx-1-3-what-to-expect/</link>
		<comments>http://pixelduke.wordpress.com/2010/04/13/javafx-1-3-what-to-expect/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 19:15:51 +0000</pubDate>
		<dc:creator>pedroduquevieira</dc:creator>
				<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://pixelduke.wordpress.com/?p=101</guid>
		<description><![CDATA[Updated (16 April) To better plan my projects I&#8217;ve always been nosing around trying to figure out what to expect on future JavaFX releases. After someone on a thread asked me to tell him what I knew about what is to come, I figured that since the list is a bit extensive and other people [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=101&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Updated (16 April)</strong></p>
<p><img class="alignright" title="JavaFX Duke" src="http://blogs.sun.com/theplanetarium/resource/thumb-java-duke-guitar.png" alt="" width="300" height="256" />To better plan my projects I&#8217;ve always been nosing around trying to figure out what to expect on future JavaFX releases.</p>
<p>After someone on a thread asked me to tell him what I knew about what is to come, I figured that since the list is a bit extensive and other people might be interested in knowing I&#8217;d do a post about it on my blog.</p>
<p><span style="text-decoration:underline;">So here is what I know so far</span>:</p>
<ul>
<li>New graphics stack called Prism, no longer dependent on awt/swing. Expect better performance.<em><span style="color:#3366ff;"><strong> </strong></span></em></li>
</ul>
<p><em><span style="color:#3366ff;"><span style="color:#000000;">(Update: You&#8217;re probably able to choose whether or not you want to use Prism</span></span></em><em> </em>)</p>
<ul>
<li>All bindings will be lazy (not sure how will that cope up with the rest)</li>
</ul>
<p><span style="color:#3366ff;"> <em><span style="color:#000000;">(Update:The runtime will figure out what type of bind to use and always try to choose lazy over normal bind to get better performance. The scene graph has been changed to better accommodate  lazy binding. On replace triggers will use normal binding by default.</span></em></span>)<br />
<strong><span style="color:#3366ff;"> </span></strong></p>
<p><strong>3D</strong>:</p>
<ul>
<li>3D Space with 3d transforms putting 2d objects on a 3d space.</li>
<li>Perspective and Parallel camera &#8211; probably the same feature that exists in Java3D</li>
<li>Bounds now is on 3D<span style="color:#888888;"> </span></li>
</ul>
<p><span style="text-decoration:line-through;"><span style="color:#888888;"><em>A little bit disappointed that there will be no 3d shapes, I needed that on my app. But than again there aren&#8217;t probably many people needing this.</em></span></span></p>
<p><span style="color:#000000;"><em>(Updade:</em><span style="text-decoration:line-through;"><em> </em></span></span><span style="color:#888888;"><em><span style="color:#000000;">Just reminded that 3d shapes are done with transformed 2d shapes like triangles or squares, duuuuhhhhh! So you should probably be able to create 3D shapes yourself using the existing 2d shapes.</span>)<br />
</em></span></p>
<p><strong>Controls:</strong></p>
<ul>
<li>Multi-line TextBox (TextBox is a text input field)</li>
<li>Better skinning API. Added Regions</li>
<li>Caspian Skin</li>
<li>Password Box control</li>
<li>Separator control</li>
<li>ChoiceBox control. <span style="text-decoration:line-through;">(not sure what this is, if someone knows please post a comment)</span> Its a non-editable ComboBox</li>
<li>Spacer Control (for layout purposes)</li>
<li>Custom cell support on Lists</li>
<li>Menus</li>
<li>ToolBar</li>
<li>Tree</li>
<li>CSS support for charts</li>
</ul>
<p><span style="color:#888888;"><em>The biggest miss here is Table. Of course you can always rely on Swing Table</em></span></p>
<p><strong>Graphics:</strong></p>
<ul>
<li>Support for custom cursors</li>
<li>Filling shapes with a texture</li>
</ul>
<p><span></span><br />
That&#8217;s all I know, also expect bug fixes and performance tuning here and there. <span style="text-decoration:line-through;">I&#8217;m guessing</span> It won&#8217;t take long for 1.3 to be released.</p>
<p>I think this release will give the so much needed boost to JavaFX: except for the table almost all standard controls, better performance, 3d capabilities and some other nice goodies.</p>
<p><strong><span style="color:#993300;">Edit: Don&#8217;t forget that this is only what I suppose will be available on 1.3. These are not facts and somethings are probably wrong or not 100% right</span></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/pixelduke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/pixelduke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/pixelduke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/pixelduke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/pixelduke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/pixelduke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/pixelduke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/pixelduke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/pixelduke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/pixelduke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/pixelduke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/pixelduke.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/pixelduke.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/pixelduke.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=pixelduke.wordpress.com&amp;blog=11549925&amp;post=101&amp;subd=pixelduke&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://pixelduke.wordpress.com/2010/04/13/javafx-1-3-what-to-expect/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/396f6b5bd26ddfded83a8113c66d2959?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">pedroduquevieira</media:title>
		</media:content>

		<media:content url="http://blogs.sun.com/theplanetarium/resource/thumb-java-duke-guitar.png" medium="image">
			<media:title type="html">JavaFX Duke</media:title>
		</media:content>
	</item>
	</channel>
</rss>
