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

<channel>
	<title>Just Java</title>
	<atom:link href="http://blog.cedarsoft.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.cedarsoft.com</link>
	<description>Johannes Schneider (cedarsoft GmbH) about Java and related stuff</description>
	<lastBuildDate>Thu, 15 Jul 2010 14:56:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Maven: Fixing table bug for site plugin 2.1</title>
		<link>http://blog.cedarsoft.com/2010/07/maven-fixing-table-bug-for-site-plugin-2-1/</link>
		<comments>http://blog.cedarsoft.com/2010/07/maven-fixing-table-bug-for-site-plugin-2-1/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 14:56:35 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[Maven]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=372</guid>
		<description><![CDATA[Some time ago a new big release for the site plugin has been done.
Unfortunately they have introduced a small bug:
The table tags now contain the alignment attribute set to &#8220;left&#8221;.
This results to some strange bugs. Take a look at that page:
http://fest.easytesting.org/javafx/maven/compile-mojo.html

Look at the background of the table.  The following h3 gets resized and its ]]></description>
			<content:encoded><![CDATA[<p>Some time ago a new big release for the site plugin has been done.<br />
Unfortunately they have introduced a small bug:</p>
<p>The table tags now contain the alignment attribute set to &#8220;left&#8221;.</p>
<p>This results to some strange bugs. Take a look at that page:<br />
<a href="http://fest.easytesting.org/javafx/maven/compile-mojo.html">http://fest.easytesting.org/javafx/maven/compile-mojo.html</a></p>
<p><a href="http://blog.cedarsoft.com/wp-uploads/2010/07/Screenshot-Maven-JavaFX-Compiler-Plugin-javafxccompile-Mozilla-Firefox.png"><img src="http://blog.cedarsoft.com/wp-uploads/2010/07/Screenshot-Maven-JavaFX-Compiler-Plugin-javafxccompile-Mozilla-Firefox-300x81.png" alt="Table Bug in maven-site-plugin:2.1" title="Table Bug in maven-site-plugin:2.1" width="300" height="81" class="alignnone size-medium wp-image-375" /></a></p>
<p>Look at the background of the table.  The following h3 gets resized and its background is drawn behind the table&#8230;</p>
<p>To fix it, just add those lines to the CSS:</p>
<div class="codecolorer-container css default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">table <span style="color: #00AA00;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2007/09/splitting-up-your-pom-xml-into-multiple-files/" rel="bookmark" class="crp_title">Splitting up your pom.xml into multiple files</a></li><li><a href="http://blog.cedarsoft.com/2010/04/javafx-about-bounds/" rel="bookmark" class="crp_title">JavaFX: Bounds by example</a></li><li><a href="http://blog.cedarsoft.com/2010/04/javafx-custom-controls-in-1-3/" rel="bookmark" class="crp_title">JavaFX: Custom controls in 1.3</a></li><li><a href="http://blog.cedarsoft.com/2010/04/new-javafx-default-font-amble-condensed/" rel="bookmark" class="crp_title">New JavaFX default font (Amble Condensed) looks ugly!</a></li><li><a href="http://blog.cedarsoft.com/2010/01/google-collections-released-finally/" rel="bookmark" class="crp_title">Google Collections released (finally)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/07/maven-fixing-table-bug-for-site-plugin-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JUnit @Theory oddities</title>
		<link>http://blog.cedarsoft.com/2010/07/junit-theory-oddities/</link>
		<comments>http://blog.cedarsoft.com/2010/07/junit-theory-oddities/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 11:28:00 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[junit]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=368</guid>
		<description><![CDATA[At the moment I try to switch my tests for serialization.cedarsoft.org over to JUnit Theories (4.8.1).
And I run into some problems:
No DataPoints
12345678@RunWith&#40; Theories.class &#41;
public class TheoriesTest &#123;
&#160; @Theory
&#160; public void aTheory&#40; String arg &#41; &#123;
&#160; &#160; System.out.println&#40; &#34;TheoriesTest.aTheory(&#34; + arg + &#34;)&#34; &#41;;
&#160; &#160; assertNotNull&#40; arg &#41;;
&#160; &#125;
&#125;
Throws an exception: java.lang.AssertionError: Never found parameters that ]]></description>
			<content:encoded><![CDATA[<p>At the moment I try to switch my tests for <a href="http://serialization.cedarsoft.org">serialization.cedarsoft.org</a> over to JUnit Theories (4.8.1).</p>
<p>And I run into some problems:</p>
<h2>No DataPoints</h2>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@RunWith<span style="color: #009900;">&#40;</span> Theories.<span style="color: #000000; font-weight: bold;">class</span> <span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TheoriesTest <span style="color: #009900;">&#123;</span><br />
&nbsp; @Theory<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> aTheory<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> arg <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;TheoriesTest.aTheory(&quot;</span> <span style="color: #339933;">+</span> arg <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;)&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; assertNotNull<span style="color: #009900;">&#40;</span> arg <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Throws an exception: java.lang.AssertionError: Never found parameters that satisfied method assumptions.  Violated assumptions: []</p>
<p>Very nice. A theory doesn&#8217;t make any sense without any DataPoints.</p>
<h2>A DataPoint method</h2>
<p>Okay, now I created a DataPoints method:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; @DataPoint<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> getParam<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;daParam&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>And everything works as expected.</p>
<h2>Removing the static keyword</h2>
<p>In my test cases I try to avoid every unnecessary key press as good as I can. Therefore I would like to create an abstract method that I just have to implement (IDE creates the method stub for me then).</p>
<p>So I just removed the static keyword from the method to try if it is possible&#8230;</p>
<p>And guess what?</p>
<p><strong>The test method did not run &#8211; but is reported as succeeded&#8230;</strong></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2010/05/analyzing-javafx/" rel="bookmark" class="crp_title">Analyzing JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2010/05/javafx-internals-part-2/" rel="bookmark" class="crp_title">JavaFX Internals Part 2</a></li><li><a href="http://blog.cedarsoft.com/2008/01/generics-and-collections-done-right-1-foolproof-step/" rel="bookmark" class="crp_title">Generics and Collections done right (1 foolproof step)&#8230;</a></li><li><a href="http://blog.cedarsoft.com/2010/05/binding-propertychangesupport-to-javafx-objects/" rel="bookmark" class="crp_title">Binding PropertyChangeSupport to JavaFX objects transparently</a></li><li><a href="http://blog.cedarsoft.com/2007/09/guice-injecting-method-interceptors/" rel="bookmark" class="crp_title">Guice: Injecting Method Interceptors</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/07/junit-theory-oddities/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaFX2Java Bridge added to JFXtras (step 2)</title>
		<link>http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-2/</link>
		<comments>http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-2/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 07:52:12 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[JFXtras]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[bridge]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=364</guid>
		<description><![CDATA[Thanks to Stephen: He has prepared a branch for the upcoming 0.7 release of JFXtras. Now it has been possible to merge the latest changes to the JFXtras default branch.
There are a lot of changes waiting in line. While the 0.7 release will be a huge step, I am really looking forward for 0.8&#8230;
So if ]]></description>
			<content:encoded><![CDATA[<p>Thanks to Stephen: He has prepared a branch for the upcoming 0.7 release of JFXtras. Now it has been possible to merge the latest changes to the JFXtras default branch.</p>
<p>There are a lot of changes waiting in line. While the 0.7 release will be a huge step, I am really looking forward for 0.8&#8230;</p>
<p>So if you want to take a look at the latest changes, just check out the source code at <a href="http://code.google.com/p/jfxtras/source/checkout">http://code.google.com/p/jfxtras/source/checkout</a>.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-1/" rel="bookmark" class="crp_title">JavaFX2Java Bridge added to JFXtras (step 1)</a></li><li><a href="http://blog.cedarsoft.com/2010/06/jfxtras-0-7-rc1-released/" rel="bookmark" class="crp_title">JFXtras: 0.7 RC1 released</a></li><li><a href="http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/" rel="bookmark" class="crp_title">Closing the gap between Java and JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2010/04/javafx-1-3-is-available/" rel="bookmark" class="crp_title">JavaFX 1.3 is available&#8230;</a></li><li><a href="http://blog.cedarsoft.com/2007/09/google-releases-some-nice-code/" rel="bookmark" class="crp_title">Google releases some nice code&#8230;</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaFX2Java Bridge added to JFXtras (step 1)</title>
		<link>http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-1/</link>
		<comments>http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-1/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 19:09:54 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[JFXtras]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[bridge]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=359</guid>
		<description><![CDATA[It has taken a long time since I promised to integrate the JavaFX2Java bridge to JFXtras until I finally did it&#8230;
At the moment the code is located at a clone that will be integrated as soon as JFXtras 0.7 has been released.
The clone can be accessed there:
https://js-mavenization.googlecode.com/hg/
The package is named &#8220;org.jfxtras.bridge&#8221;.
Related Posts:JavaFX2Java Bridge added to ]]></description>
			<content:encoded><![CDATA[<p>It has taken a long time since I promised to integrate the <a href="http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/">JavaFX2Java bridge</a> to JFXtras until I finally did it&#8230;</p>
<p>At the moment the code is located at a clone that will be integrated as soon as JFXtras 0.7 has been released.</p>
<p>The clone can be accessed there:<br />
https://js-mavenization.googlecode.com/hg/</p>
<p>The package is named &#8220;org.jfxtras.bridge&#8221;.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-2/" rel="bookmark" class="crp_title">JavaFX2Java Bridge added to JFXtras (step 2)</a></li><li><a href="http://blog.cedarsoft.com/2010/06/jfxtras-0-7-rc1-released/" rel="bookmark" class="crp_title">JFXtras: 0.7 RC1 released</a></li><li><a href="http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/" rel="bookmark" class="crp_title">Closing the gap between Java and JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2010/05/binding-propertychangesupport-to-javafx-objects/" rel="bookmark" class="crp_title">Binding PropertyChangeSupport to JavaFX objects transparently</a></li><li><a href="http://blog.cedarsoft.com/2010/01/google-collections-released-finally/" rel="bookmark" class="crp_title">Google Collections released (finally)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JFXtras: 0.7 RC1 released</title>
		<link>http://blog.cedarsoft.com/2010/06/jfxtras-0-7-rc1-released/</link>
		<comments>http://blog.cedarsoft.com/2010/06/jfxtras-0-7-rc1-released/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 08:21:44 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[JFXtras]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=354</guid>
		<description><![CDATA[Hi guys,
the first release candidate for JFXtras 0.7 has been released. This version is (should be) fully functional with JavaFX 1.3
Downloads can be found at http://jfxtras.org/
Related Posts:JavaFX2Java Bridge added to JFXtras (step 1)JavaFX2Java Bridge added to JFXtras (step 2)Google Collections released (finally)Closing the gap between Java and JavaFXNo! Don&#8217;t do this! This is not the ]]></description>
			<content:encoded><![CDATA[<p>Hi guys,</p>
<p>the first release candidate for JFXtras 0.7 has been released. This version is (should be) fully functional with JavaFX 1.3<br />
Downloads can be found at <a href="http://jfxtras.org/">http://jfxtras.org/</a></p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-1/" rel="bookmark" class="crp_title">JavaFX2Java Bridge added to JFXtras (step 1)</a></li><li><a href="http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-2/" rel="bookmark" class="crp_title">JavaFX2Java Bridge added to JFXtras (step 2)</a></li><li><a href="http://blog.cedarsoft.com/2010/01/google-collections-released-finally/" rel="bookmark" class="crp_title">Google Collections released (finally)</a></li><li><a href="http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/" rel="bookmark" class="crp_title">Closing the gap between Java and JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2007/09/no-dont-do-this-this-is-not-the-way-bean-bindings/" rel="bookmark" class="crp_title">No! Don&#8217;t do this! This is not the way! (Bean Bindings)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/06/jfxtras-0-7-rc1-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Closing the gap between Java and JavaFX</title>
		<link>http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/</link>
		<comments>http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/#comments</comments>
		<pubDate>Tue, 11 May 2010 14:39:20 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[binding]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=330</guid>
		<description><![CDATA[There is a huge gap between Java and JavaFX: While it is very easy to bind JavaFX objects to each other there has been no way to bind JavaFX objects to Java properties (and vice versa).
It has taken me some time to figure out how this could be solved. And at the moment I am ]]></description>
			<content:encoded><![CDATA[<p>There is a huge gap between Java and JavaFX: While it is very easy to bind JavaFX objects to each other there has been no way to bind JavaFX objects to Java properties (and vice versa).</p>
<p>It has taken me some time to figure out how this could be solved. And at the moment I am in the progress of adding that stuff to the <a href="http://jfxtras.org/">JFXtras</a> project.<br />
This will take some time until I have taken all necessary steps.</p>
<p>Until then i want to give you a quick jar that can be used to try that stuff&#8230;</p>
<p>To try it, download that jar and add it to the classpath of your JavaFX project:<br />
<a href='http://blog.cedarsoft.com/wp-uploads/2010/05/bridge-1.0.0-SNAPSHOT-jar-with-dependencies.jar'>bridge-1.0.0-SNAPSHOT-jar-with-dependencies</a></p>
<p>There are two ways of synchronization. At first it is possible to listen for changes to Java objects and update an JavaFX object accordingly. At the moment I have implemented two ways to listen for updates.</p>
<h2>Java to JavaFX</h2>
<ul>
<li>PropertyChangeEvents: This is the recommended way: Just make your Java bean fire PropertyChangeEvents whenever a property has changed.</li>
<li>Busy waiting: I have added a hackish way of busy waiting. This should not be used in production code. But it offers a fast way to test things</li>
</ul>
<h2>JavaFX to Java</h2>
<p>The reverse way has also two ways implemented:</p>
<ul>
<li>Calling of setters: If a JavaFX var is updated, this bridge calls the corresponding setter of your Java object (using reflection or optionally your own optimized implementation).</li>
<li>PropertyChangeEvents: It is possible to create a bridge that converts the JavaFX binding<br />
updates to PropertyChangeEvents.</li>
</ul>
<h2>With inverse&#8230;</h2>
<p>Of course it is also possible (and most of the time necessary) to create bindings with inverse. I give you a small sample how this might work here:</p>
<p>We create our Java &#8220;model&#8221;:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">fxbindingtest</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.beans.PropertyChangeListener</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.beans.PropertyChangeSupport</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> JavaClass <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">float</span> amount <span style="color: #339933;">=</span> <span style="color: #cc66cc;">99</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">float</span> getAmount<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> amount<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setAmount<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span> amount<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #006633;">firePropertyChange</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;amount&quot;</span>, <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">amount</span>, <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">amount</span><span style="color: #339933;">=</span>amount<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Changed amount to &quot;</span> <span style="color: #339933;">+</span> amount <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span> <br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangesupport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeSupport</span></a> pcs <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangesupport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeSupport</span></a><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> addPropertyChangeListener<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangelistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeListener</span></a> listener<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #006633;">addPropertyChangeListener</span><span style="color: #009900;">&#40;</span>listener<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> removePropertyChangeListener<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangelistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeListener</span></a> listener<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #006633;">removePropertyChangeListener</span><span style="color: #009900;">&#40;</span>listener<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>And here comes our JavaFX stage. This stage contains just a slider that is bound to the Java object (with inverse).<br />
Every five seconds the model object is updated (amount+=10) &#8211; and reflected by the slider.</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br /></div></td><td><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">package fxbindingtest<span style="color: #339933;">;</span><br />
<br />
import javafx.<span style="color: #202020;">stage</span>.<span style="color: #202020;">Stage</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">Scene</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">control</span>.<span style="color: #202020;">Slider</span><span style="color: #339933;">;</span><br />
import com.<span style="color: #202020;">cedarsoft</span>.<span style="color: #202020;">fx</span>.<span style="color: #202020;">JavaFxBridge</span><span style="color: #339933;">;</span><br />
import com.<span style="color: #202020;">sun</span>.<span style="color: #202020;">javafx</span>.<span style="color: #202020;">runtime</span>.<span style="color: #202020;">FXObject</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">animation</span>.<span style="color: #202020;">Timeline</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">animation</span>.<span style="color: #202020;">KeyFrame</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #808080; font-style: italic;">/**<br />
&nbsp;* @author johannes<br />
&nbsp;*/</span><br />
var slider<span style="color: #339933;">:</span> Slider<span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//The java model class. Contains the property &quot;amount&quot; and a PropertyChangeSupport</span><br />
def javaModel <span style="color: #339933;">=</span> new JavaClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
Stage <span style="color: #009900;">&#123;</span><br />
&nbsp; title<span style="color: #339933;">:</span> <span style="color: #ff0000;">&quot;Application title&quot;</span><br />
&nbsp; scene<span style="color: #339933;">:</span> Scene <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; width<span style="color: #339933;">:</span> <span style="color: #0000dd;">800</span><br />
&nbsp; &nbsp; height<span style="color: #339933;">:</span> <span style="color: #0000dd;">600</span><br />
&nbsp; &nbsp; content<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; slider <span style="color: #339933;">=</span> Slider <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min<span style="color: #339933;">:</span> <span style="color: #0000dd;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max<span style="color: #339933;">:</span> <span style="color: #0000dd;">100</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; snapToTicks<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">true</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#93;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;">//Create the binding from the java model to the slider</span><br />
<span style="color: #666666; font-style: italic;">//Using the defaults:</span><br />
<span style="color: #666666; font-style: italic;">// Java --&gt; FX: PropertyChangeEvents</span><br />
<span style="color: #666666; font-style: italic;">// FX --&gt; Java: Calling setters by reflection</span><br />
JavaFxBridge.<span style="color: #202020;">bridge</span><span style="color: #009900;">&#40;</span> javaModel <span style="color: #009900;">&#41;</span>.<span style="color: #202020;">to</span><span style="color: #009900;">&#40;</span> slider as FXObject <span style="color: #009900;">&#41;</span>.<span style="color: #202020;">connecting</span><span style="color: #009900;">&#40;</span><br />
&nbsp; JavaFxBridge.<span style="color: #202020;">bind</span><span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;amount&quot;</span> <span style="color: #009900;">&#41;</span>.<span style="color: #202020;">to</span><span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;value&quot;</span> <span style="color: #009900;">&#41;</span>.<span style="color: #202020;">withInverse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//sorry for the stupid API - needs some polishing...</span><br />
<br />
<span style="color: #666666; font-style: italic;">//Add a timeline to simulate changes to the model</span><br />
Timeline <span style="color: #009900;">&#123;</span><br />
&nbsp; repeatCount<span style="color: #339933;">:</span> Timeline.<span style="color: #202020;">INDEFINITE</span><br />
&nbsp; keyFrames<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; KeyFrame <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; time<span style="color: #339933;">:</span> 5s<br />
&nbsp; &nbsp; &nbsp; action<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; println<span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;changing amount on model&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; javaModel.<span style="color: #202020;">setAmount</span><span style="color: #009900;">&#40;</span> javaModel.<span style="color: #202020;">getAmount</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">10</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span>.<span style="color: #202020;">play</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>And here a JNLP to run the demo (open Java Console to see the updates printed to System.out):<br />
<a href='http://blog.cedarsoft.com/wp-uploads/2010/05/FxBindingTest.jnlp'><img src="http://java.sun.com/products/jfc/tsc/sightings/images/webstart.small.jpg" alt="webstart" /></a></p>
<p><strong>Disclaimer:</strong><br />
This is just a working-in-some-situations-prototype. It is not production-ready by far.<br />
But if you have any comments/ideas/bugs, please mail me.</p>
<p>The source code can be <a href='http://blog.cedarsoft.com/wp-uploads/2010/05/bridge-1.0.0-SNAPSHOT-project.zip'>downloaded here</a>. But I will add that stuff to JFXtras very soon&#8230;</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2010/05/binding-propertychangesupport-to-javafx-objects/" rel="bookmark" class="crp_title">Binding PropertyChangeSupport to JavaFX objects transparently</a></li><li><a href="http://blog.cedarsoft.com/2010/04/javafx-light-bulb-with-improved-ui-performance-slider/" rel="bookmark" class="crp_title">JavaFX Light Bulb with improved UI performance</a></li><li><a href="http://blog.cedarsoft.com/2010/05/javafx-bug-or-feature-panel-doesnt-layout-if-placed-in-class/" rel="bookmark" class="crp_title">JavaFX Bug or Feature? Panel doesn&#8217;t layout if placed in class</a></li><li><a href="http://blog.cedarsoft.com/2010/05/javafx-internals-part-2/" rel="bookmark" class="crp_title">JavaFX Internals Part 2</a></li><li><a href="http://blog.cedarsoft.com/2010/07/javafx2java-bridge-added-to-jfxtras-step-1/" rel="bookmark" class="crp_title">JavaFX2Java Bridge added to JFXtras (step 1)</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Binding PropertyChangeSupport to JavaFX objects transparently</title>
		<link>http://blog.cedarsoft.com/2010/05/binding-propertychangesupport-to-javafx-objects/</link>
		<comments>http://blog.cedarsoft.com/2010/05/binding-propertychangesupport-to-javafx-objects/#comments</comments>
		<pubDate>Sat, 08 May 2010 20:03:48 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[bean]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[bridge]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[pcs]]></category>
		<category><![CDATA[property]]></category>
		<category><![CDATA[PropertyChangeEvent]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=316</guid>
		<description><![CDATA[Binding is one of the best features in JavaFX. The possibility to class Java APIs from JavaFX is another one.
But unfortunately there is no easy way to combine JavaFX binding and Java PropertyChangeEvents. Therefore I have taken a look at the JavaFX code and I think I have found a possible solution:
The manual way
Of course ]]></description>
			<content:encoded><![CDATA[<p>Binding is one of the best features in JavaFX. The possibility to class Java APIs from JavaFX is another one.<br />
But unfortunately there is no easy way to combine JavaFX binding and Java PropertyChangeEvents. Therefore I have taken a look at the JavaFX code and I think I have found a possible solution:</p>
<h2>The manual way</h2>
<p>Of course you can add on replace triggers on every var and fire your events manually:</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">class Customer<span style="color: #009900;">&#123;</span><br />
&nbsp; public var name<span style="color: #339933;">:</span>String <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span> on replace old <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #202020;">firePropertyChange</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;name&quot;</span><span style="color: #339933;">,</span> old<span style="color: #339933;">,</span> name <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; public var address<span style="color: #339933;">:</span>String <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span> on replace old <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #202020;">firePropertyChange</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;address&quot;</span><span style="color: #339933;">,</span> old<span style="color: #339933;">,</span> address <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; public var mail<span style="color: #339933;">:</span>Email on replace old <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #202020;">firePropertyChange</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;mail&quot;</span><span style="color: #339933;">,</span> old<span style="color: #339933;">,</span> mail <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; public<span style="color: #339933;">-</span>read def pcs <span style="color: #339933;">=</span> new PropertyChangeSupport<span style="color: #009900;">&#40;</span> this <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>This has at least three disadvantages: </p>
<ul>
<li>At first your code becomes very ugly. A lot of boilerplate code without any type checking. Very easy to make faults. Very hard to find them.</li>
<li>But the second problem is even worse &#8211; if you don&#8217;t know for sure whether there is a listener registered. This approach destroys lazy binding which has been introduced in JavaFX 1.3. Every time the binding is invalidated, the replace trigger forces an update &#8211; even if nobody is registered at the PropertyChangeSupport.</li>
<li>It can&#8217;t be &#8220;attached&#8221; to existing JavaFX classes.</li>
</ul>
<h1>Using an automated bridge</h1>
<p>I have created a bridge that can be attached to every JavaFX object. This bridge uses the JavaFX binding stuff and translates the binding updates to PropertyChangeEvents.<br />
There is no reflection involved when vars are updated (just when setting it up). So performance shouldn&#8217;t be a problem.<br />
(Of course this approach also prevents lazy bindings since the events have to be created every time the vars change). So only attach the bridge if it is necessary.</p>
<p>The bridge can be used like that:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;<span style="color: #339933;">*</span> FXObject fxObject <span style="color: #339933;">=</span> ...<br />
&nbsp;<span style="color: #339933;">*</span> Fx2PropertyChangeEvent bridge <span style="color: #339933;">=</span> Fx2PropertyChangeEvent.<span style="color: #006633;">bindProperties</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;name&quot;</span>, <span style="color: #0000ff;">&quot;id&quot;</span> <span style="color: #009900;">&#41;</span>.<span style="color: #006633;">to</span><span style="color: #009900;">&#40;</span> fxObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp;<span style="color: #339933;">*</span> bridge.<span style="color: #006633;">addPropertyChangeListener</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;name&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangelistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeListener</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>...<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>Of course the bridge can also be used within your JavaFX scripts/classes.</p>
<p>And here comes the code: Feel free to use it:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br />182<br />183<br />184<br />185<br />186<br />187<br />188<br />189<br />190<br />191<br />192<br />193<br />194<br />195<br />196<br />197<br />198<br />199<br />200<br />201<br />202<br />203<br />204<br />205<br />206<br />207<br />208<br />209<br />210<br />211<br />212<br />213<br />214<br />215<br />216<br />217<br />218<br />219<br />220<br />221<br />222<br />223<br />224<br />225<br />226<br />227<br />228<br />229<br />230<br />231<br />232<br />233<br />234<br />235<br />236<br />237<br />238<br />239<br />240<br />241<br />242<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.cedarsoft.fx</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.DependentsManager</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXBase</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXObject</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.Public</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jetbrains.annotations.NonNls</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jetbrains.annotations.NotNull</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jetbrains.annotations.Nullable</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.beans.PropertyChangeEvent</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.beans.PropertyChangeListener</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.beans.PropertyChangeSupport</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.ArrayList</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp;* This is a bridge that connects a PropertyChangeSupport to one or more JavaFX vars.<br />
&nbsp;* &lt;p/&gt;<br />
&nbsp;* This bridge does use reflection only to set things up! Whenever a var is updated there no(!) reflection is used!<br />
&nbsp;* Therefore the performance is quite good.<br />
&nbsp;* &lt;p/&gt;<br />
&nbsp;* &lt;p/&gt;<br />
&nbsp;* The Code might look like that:<br />
&nbsp;* &lt;pre&gt;<br />
&nbsp;* FXObject fxObject = ...<br />
&nbsp;* Fx2PropertyChangeEvent bridge = Fx2PropertyChangeEvent.bindProperties( &quot;name&quot;, &quot;id&quot; ).to( fxObject );<br />
&nbsp;* bridge.addPropertyChangeListener( &quot;name&quot;, new PropertyChangeListener(){...} );<br />
&nbsp;* &lt;/pre&gt;<br />
&nbsp;*/</span><br />
@<span style="color: #000000; font-weight: bold;">Public</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Fx2PropertyChangeEvent <span style="color: #000000; font-weight: bold;">extends</span> FXBase <span style="color: #009900;">&#123;</span><br />
&nbsp; @NotNull<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangesupport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeSupport</span></a> pcs<span style="color: #339933;">;</span><br />
&nbsp; @NotNull<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> List<span style="color: #339933;">&lt;</span>Entry<span style="color: #339933;">&gt;</span> entries <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> ArrayList<span style="color: #339933;">&lt;</span>Entry<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; @NotNull<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> FXObject bindee<span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Fx2PropertyChangeEvent<span style="color: #009900;">&#40;</span> @NotNull FXObject bindee <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span> bindee, <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Fx2PropertyChangeEvent<span style="color: #009900;">&#40;</span> @NotNull FXObject bindee, @Nullable <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangesupport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeSupport</span></a> pcs <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">bindee</span> <span style="color: #339933;">=</span> bindee<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">pcs</span> <span style="color: #339933;">=</span> pcs <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">?</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangesupport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeSupport</span></a><span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> pcs<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; initialize$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp;* Convert to property change events.<br />
&nbsp; &nbsp;*<br />
&nbsp; &nbsp;* @param propertyName the name of the property (var)<br />
&nbsp; &nbsp;*/</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">void</span> bindTo<span style="color: #009900;">&#40;</span> @NotNull <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> propertyName <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> fieldName <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;$&quot;</span> <span style="color: #339933;">+</span> propertyName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; bindee.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getField</span><span style="color: #009900;">&#40;</span> fieldName <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Exception</span></a> ignore <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aillegalargumentexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IllegalArgumentException</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Invalid property name &lt;&quot;</span> <span style="color: #339933;">+</span> propertyName <span style="color: #339933;">+</span> <span style="color: #0000ff;">&quot;&gt;&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> varNumFieldName <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;VOFF$&quot;</span> <span style="color: #339933;">+</span> propertyName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a> varNumField <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a> <span style="color: #009900;">&#41;</span> bindee.<span style="color: #006633;">getClass</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getField</span><span style="color: #009900;">&#40;</span> varNumFieldName <span style="color: #009900;">&#41;</span>.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> index <span style="color: #339933;">=</span> addEntry<span style="color: #009900;">&#40;</span> propertyName, varNumField <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; DependentsManager.<span style="color: #006633;">addDependent</span><span style="color: #009900;">&#40;</span> bindee, varNumField, <span style="color: #000000; font-weight: bold;">this</span>, index <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Exception</span></a> e <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aruntimeexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">RuntimeException</span></a><span style="color: #009900;">&#40;</span> e <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; @Override<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> update$<span style="color: #009900;">&#40;</span> FXObject src, <span style="color: #000066; font-weight: bold;">int</span> depNum, <span style="color: #000066; font-weight: bold;">int</span> startPos, <span style="color: #000066; font-weight: bold;">int</span> endPos, <span style="color: #000066; font-weight: bold;">int</span> newLength, <span style="color: #000066; font-weight: bold;">int</span> phase <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; Entry entry <span style="color: #339933;">=</span> getEntry<span style="color: #009900;">&#40;</span> depNum <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> phase <span style="color: #339933;">==</span> <span style="color: #cc66cc;">65</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> oldValue <span style="color: #339933;">=</span> src.<span style="color: #006633;">get</span>$<span style="color: #009900;">&#40;</span> entry.<span style="color: #006633;">getVarNumField</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; entry.<span style="color: #006633;">setOldValue</span><span style="color: #009900;">&#40;</span> oldValue <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> phase <span style="color: #339933;">==</span> <span style="color: #cc66cc;">92</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> newValue <span style="color: #339933;">=</span> src.<span style="color: #006633;">get</span>$<span style="color: #009900;">&#40;</span> entry.<span style="color: #006633;">getVarNumField</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; pcs.<span style="color: #006633;">firePropertyChange</span><span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangeevent+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeEvent</span></a><span style="color: #009900;">&#40;</span> src, entry.<span style="color: #006633;">getPropertyName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, entry.<span style="color: #006633;">getOldValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, newValue <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aillegalstateexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IllegalStateException</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Invalid phase: &quot;</span> <span style="color: #339933;">+</span> phase <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">update</span>$<span style="color: #009900;">&#40;</span> src, depNum, startPos, endPos, newLength, phase <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">int</span> addEntry<span style="color: #009900;">&#40;</span> @NotNull @NonNls <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> propertyName, <span style="color: #000066; font-weight: bold;">int</span> varNumField <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> index <span style="color: #339933;">=</span> entries.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; entries.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> Entry<span style="color: #009900;">&#40;</span> propertyName, varNumField <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> index<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; @NotNull<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> Entry getEntry<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> depNum <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> entries.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span> depNum <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> addPropertyChangeListener<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangelistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeListener</span></a> listener <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #006633;">addPropertyChangeListener</span><span style="color: #009900;">&#40;</span> listener <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> removePropertyChangeListener<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangelistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeListener</span></a> listener <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #006633;">removePropertyChangeListener</span><span style="color: #009900;">&#40;</span> listener <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> addPropertyChangeListener<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> propertyName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangelistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeListener</span></a> listener <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #006633;">addPropertyChangeListener</span><span style="color: #009900;">&#40;</span> propertyName, listener <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> removePropertyChangeListener<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> propertyName, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangelistener+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeListener</span></a> listener <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; pcs.<span style="color: #006633;">removePropertyChangeListener</span><span style="color: #009900;">&#40;</span> propertyName, listener <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; @NotNull<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> FXObject getBindee<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> bindee<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; @NotNull<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apropertychangesupport+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">PropertyChangeSupport</span></a> getPcs<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> pcs<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> Entry <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> propertyName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> varNumField<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> oldValue<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> Entry<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> propertyName, <span style="color: #000066; font-weight: bold;">int</span> varNumField <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">propertyName</span> <span style="color: #339933;">=</span> propertyName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">varNumField</span> <span style="color: #339933;">=</span> varNumField<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> getPropertyName<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> propertyName<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> getVarNumField<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> varNumField<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> getOldValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> oldValue<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setOldValue<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> oldValue <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">oldValue</span> <span style="color: #339933;">=</span> oldValue<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp;* Binds the given property names<br />
&nbsp; &nbsp;*<br />
&nbsp; &nbsp;* @param propertyNames the property names<br />
&nbsp; &nbsp;* @return the fluent factory used to create a Fx2PropertyChangeEvent<br />
&nbsp; &nbsp;*/</span><br />
&nbsp; @NotNull<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> FluentFactory bindProperties<span style="color: #009900;">&#40;</span> @NotNull @NonNls <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>... <span style="color: #006633;">propertyNames</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> FluentFactory<span style="color: #009900;">&#40;</span> propertyNames <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp;* Binds the given property names<br />
&nbsp; &nbsp;*<br />
&nbsp; &nbsp;* @param propertyNames the property names<br />
&nbsp; &nbsp;* @return the fluent factory used to create a Fx2PropertyChangeEvent<br />
&nbsp; &nbsp;*/</span><br />
&nbsp; @NotNull<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> FluentFactory bind<span style="color: #009900;">&#40;</span> @NotNull @NonNls <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>... <span style="color: #006633;">propertyNames</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> bindProperties<span style="color: #009900;">&#40;</span> propertyNames <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp;* Fluent factory implementation<br />
&nbsp; &nbsp;*/</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">class</span> FluentFactory <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; @NotNull<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> propertyNames<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> FluentFactory<span style="color: #009900;">&#40;</span> @NonNls @NotNull <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> propertyNames <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//noinspection AssignmentToCollectionOrArrayFieldFromParameter</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">propertyNames</span> <span style="color: #339933;">=</span> propertyNames<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp; &nbsp; &nbsp;* Binds the property names to the given bindee<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @param bindee the bindee the properties are bound to<br />
&nbsp; &nbsp; &nbsp;* @return the bridge<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @noinspection InstanceMethodNamingConvention<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; @NotNull<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> Fx2PropertyChangeEvent to<span style="color: #009900;">&#40;</span> @NotNull FXObject bindee <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> propertyNames.<span style="color: #006633;">length</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aillegalargumentexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">IllegalArgumentException</span></a><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Need at least one property to bind to&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; Fx2PropertyChangeEvent bridge <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Fx2PropertyChangeEvent<span style="color: #009900;">&#40;</span> bindee <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> propertyName <span style="color: #339933;">:</span> propertyNames <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; bridge.<span style="color: #006633;">bindTo</span><span style="color: #009900;">&#40;</span> propertyName <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> bridge<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #008000; font-style: italic; font-weight: bold;">/**<br />
&nbsp;* Copyright (C) cedarsoft GmbH.<br />
&nbsp;*<br />
&nbsp;* Licensed under the GNU General Public License version 3 (the &quot;License&quot;)<br />
&nbsp;* with Classpath Exception; you may not use this file except in compliance<br />
&nbsp;* with the License. You may obtain a copy of the License at<br />
&nbsp;*<br />
&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; http://www.cedarsoft.org/gpl3ce<br />
&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; (GPL 3 with Classpath Exception)<br />
&nbsp;*<br />
&nbsp;* This code is free software; you can redistribute it and/or modify it<br />
&nbsp;* under the terms of the GNU General Public License version 3 only, as<br />
&nbsp;* published by the Free Software Foundation. cedarsoft GmbH designates this<br />
&nbsp;* particular file as subject to the &quot;Classpath&quot; exception as provided<br />
&nbsp;* by cedarsoft GmbH in the LICENSE file that accompanied this code.<br />
&nbsp;*<br />
&nbsp;* This code is distributed in the hope that it will be useful, but WITHOUT<br />
&nbsp;* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or<br />
&nbsp;* FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the GNU General Public License<br />
&nbsp;* version 3 for more details (a copy is included in the LICENSE file that<br />
&nbsp;* accompanied this code).<br />
&nbsp;*<br />
&nbsp;* You should have received a copy of the GNU General Public License version<br />
&nbsp;* 3 along with this work; if not, write to the Free Software Foundation,<br />
&nbsp;* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.<br />
&nbsp;*<br />
&nbsp;* Please contact cedarsoft GmbH, 72810 Gomaringen, Germany,<br />
&nbsp;* or visit www.cedarsoft.com if you need additional information or<br />
&nbsp;* have any questions.<br />
&nbsp;*/</span></div></td></tr></tbody></table></div>
<p>I will upload a complete project very soon (Monday). This will contain several samples and unit tests&#8230;.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/" rel="bookmark" class="crp_title">Closing the gap between Java and JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2010/05/analyzing-javafx/" rel="bookmark" class="crp_title">Analyzing JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2010/05/javafx-internals-part-2/" rel="bookmark" class="crp_title">JavaFX Internals Part 2</a></li><li><a href="http://blog.cedarsoft.com/2007/09/no-dont-do-this-this-is-not-the-way-bean-bindings/" rel="bookmark" class="crp_title">No! Don&#8217;t do this! This is not the way! (Bean Bindings)</a></li><li><a href="http://blog.cedarsoft.com/2010/07/junit-theory-oddities/" rel="bookmark" class="crp_title">JUnit @Theory oddities</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/05/binding-propertychangesupport-to-javafx-objects/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaFX Internals Part 2</title>
		<link>http://blog.cedarsoft.com/2010/05/javafx-internals-part-2/</link>
		<comments>http://blog.cedarsoft.com/2010/05/javafx-internals-part-2/#comments</comments>
		<pubDate>Sat, 08 May 2010 13:15:34 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[internals]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=309</guid>
		<description><![CDATA[Yesterday I wrote about some JavaFX Internals&#8230;. Today comes the second part.
Today we start to use some of the JavaFX classes by Java. Therefore I just added all JavaFX jars to the classpath.
Extending FXBase
It is a very good idea to extend FXBase. We just have to figure out which methods have to be called for ]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.cedarsoft.com/2010/05/analyzing-javafx/">Yesterday I wrote about some JavaFX Internals&#8230;</a>. Today comes the second part.</p>
<p>Today we start to use some of the JavaFX classes by Java. Therefore I just added all JavaFX jars to the classpath.</p>
<h2>Extending FXBase</h2>
<p>It is a very good idea to extend FXBase. We just have to figure out which methods have to be called for initialization. Following the samples, our class could look like that:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXBase</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXObject</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.Public</span><span style="color: #339933;">;</span><br />
<br />
<br />
@<span style="color: #000000; font-weight: bold;">Public</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Run <span style="color: #000000; font-weight: bold;">extends</span> FXBase <span style="color: #000000; font-weight: bold;">implements</span> FXObject <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Starting!&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;Finished&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Run<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; initialize$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Run<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">boolean</span> paramBoolean <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span> paramBoolean <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<h2>Approaching that binding stuff</h2>
<p>As mentioned yesterday the magic happens within the DependentsManager. Thankfully that sources are available&#8230;<br />
One key is the <em>WeakBinderRef</em> that can be stored within each <em>FXObject</em> and be retrieved calling <em>getThisRef$internal$()</em>.<br />
There is a static method that creates those refs lazyly: <em>WeakBinderRef.instance()</em>.</p>
<p>This WeakBinderRef contains the dependencies for this object. The field <em>bindees</em> contains a chain of Dep instances. Interestingly the <em>WeakBinderRef</em> for test does not contain any <em>bindees</em> as one might have expected. Those are the reverse dependencies!</p>
<p>The &#8220;real&#8221; dependencies are stored within each object within the field <em>DepChain$internal$</em> (of type <em>DepChain</em>).<br />
Relevant is the <em>bindeeVarNum</em>. Here is the var num stored that dependency is based upon.</p>
<h2>Process of dependency notification</h2>
<p>Whenever a var is changed, there are two calls made to <em>notifyDependents$</em>. They can be distinguished by the <em>phase</em> (argument).<br />
That methods uses the <em>DependentsManager</em> to call invalidate on all depending objects. Those simply change the flag so that the next time the var is accessed, it can be resolved again.</p>
<p>While the binding performance in JavaFX is much better in 1.3 it is still not really lazy. There happen a lot of calls until the value is marked as invalid.<br />
So I assume that the performance has just been increased for complex binding expressions. Just binding one var to another shouldn&#8217;t be much faster now (this is just an assumption!)&#8230;</p>
<h2>Adding dependencies manually</h2>
<p>Now we try to add a dependency manually. It is possible by simply calling &#8220;<em>DependentsManager.addDependent()</em>&#8220;.<br />
Of course it does not have any visible effects (besides that the update/invalidate methods are called). Because the values are fetched from the original objects&#8230; But the debugger shows us, that it is possible to use that bind mechanism from Java.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2010/05/analyzing-javafx/" rel="bookmark" class="crp_title">Analyzing JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2010/05/binding-propertychangesupport-to-javafx-objects/" rel="bookmark" class="crp_title">Binding PropertyChangeSupport to JavaFX objects transparently</a></li><li><a href="http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/" rel="bookmark" class="crp_title">Closing the gap between Java and JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2010/04/javafx-bind-bug-or-am-i-just-stupid/" rel="bookmark" class="crp_title">[JavaFX] Bind bug? Or am I just stupid?</a></li><li><a href="http://blog.cedarsoft.com/2010/07/junit-theory-oddities/" rel="bookmark" class="crp_title">JUnit @Theory oddities</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/05/javafx-internals-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analyzing JavaFX</title>
		<link>http://blog.cedarsoft.com/2010/05/analyzing-javafx/</link>
		<comments>http://blog.cedarsoft.com/2010/05/analyzing-javafx/#comments</comments>
		<pubDate>Wed, 05 May 2010 20:23:40 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[JavaFX]]></category>
		<category><![CDATA[binding]]></category>
		<category><![CDATA[javap]]></category>
		<category><![CDATA[reflection]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=302</guid>
		<description><![CDATA[Today I wanted to analyze the internals of JavaFX. This post is the documentation &#8211; primarily made for myself. But maybe useful for somebody else, too&#8230;
Simple class
At first I tried to create a simple class with just one var of type String:
123public class Test&#123;
&#160; var value:String = &#34;asdf&#34;;
&#125;
And then I tried to take a look ]]></description>
			<content:encoded><![CDATA[<p>Today I wanted to analyze the internals of JavaFX. This post is the documentation &#8211; primarily made for myself. But maybe useful for somebody else, too&#8230;</p>
<h2>Simple class</h2>
<p>At first I tried to create a simple class with just one var of type String:</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">public class Test<span style="color: #009900;">&#123;</span><br />
&nbsp; var value<span style="color: #339933;">:</span>String <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;asdf&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>And then I tried to take a look at the internals. Of course I did not decompile that stuff. Instead I used javap and Reflection to analyze it myself. The result could look like that:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXBase</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXObject</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.Public</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.ScriptPrivate</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.SourceName</span><span style="color: #339933;">;</span><br />
<br />
@<span style="color: #000000; font-weight: bold;">Public</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Test <span style="color: #000000; font-weight: bold;">extends</span> FXBase <span style="color: #000000; font-weight: bold;">implements</span> FXObject <span style="color: #009900;">&#123;</span><br />
&nbsp; @ScriptPrivate<br />
&nbsp; @SourceName<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;value&quot;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> $value<span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; initialize$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">boolean</span> paramBoolean <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span> paramBoolean <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;asdf&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>So, what is interesting about this?<br />
At first the name of the field is not so nice. Very hard to access using Reflection&#8230; But probably that is intended.<br />
Every JavaFX class extends FXBase (or implement FXObject if extending another Java class).</p>
<p>Well, those information can be found within the sources of FXBase (look at src.zip)&#8230;</p>
<h2>Changing var to def</h2>
<p>What is the difference? There is just an annotation (@Def) added to the field&#8230;<br />
<span id="more-302"></span></p>
<h2>Simple binding</h2>
<p>Of course binding is the most interesting part for me. So let&#8217;s create add simple binding. Therefore we create a second var (&#8221;boundValue&#8221;) and bind it to value using <em>bind value</em>.</p>
<p>And now here comes the wow. Look at that monster javafxc has created:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.Checks</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXBase</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXObject</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.Public</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.ScriptPrivate</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.SourceName</span><span style="color: #339933;">;</span><br />
<br />
@<span style="color: #000000; font-weight: bold;">Public</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Test <span style="color: #000000; font-weight: bold;">extends</span> FXBase <span style="color: #000000; font-weight: bold;">implements</span> FXObject <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VCNT$ <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> VOFF$value <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> VOFF$boundValue <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">short</span> VFLG$value<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">short</span> VFLG$boundValue<span style="color: #339933;">;</span><br />
<br />
&nbsp; @ScriptPrivate<br />
&nbsp; @SourceName<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;value&quot;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> $value<span style="color: #339933;">;</span><br />
<br />
&nbsp; @ScriptPrivate<br />
&nbsp; @SourceName<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;boundValue&quot;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> $boundValue<span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VCNT$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> count$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$value<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> invalidate$value<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0x7<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> i <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> j <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> paramInt <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; paramInt <span style="color: #339933;">&amp;=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">35</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; notifyDependents$<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">0</span>, paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> get$boundValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x18 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">|</span> 0x400 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x104 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">260</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0xFFFFFFE7 <span style="color: #339933;">|</span> 0x0 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str <span style="color: #339933;">=</span> get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">|</span> 0x200 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x5 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> i<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> str<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> 0x19 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$boundValue <span style="color: #339933;">=</span> str<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$boundValue<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> invalidate$boundValue<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x7<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> i <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> j <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #339933;">&amp;</span> 0x8 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0x5 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> paramInt <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; paramInt <span style="color: #339933;">&amp;=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">35</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> applyDefaults$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>varTestBits$<span style="color: #009900;">&#40;</span> paramInt, <span style="color: #cc66cc;">56</span>, <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.$value<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">|</span> 0x18 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>Checks.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span> str, <span style="color: #0000ff;">&quot;asdf&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> 0x10 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; invalidate$value<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">97</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;asdf&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; invalidate$value<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">94</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> 0x1 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">65</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">92</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x440 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> get$boundValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">applyDefaults</span>$<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> get$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> get$boundValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">get</span>$<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> set$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> paramObject <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> <span style="color: #009900;">&#41;</span> paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> <span style="color: #009900;">&#41;</span> paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">set</span>$<span style="color: #009900;">&#40;</span> paramInt, paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> invalidate$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt1, <span style="color: #000066; font-weight: bold;">int</span> paramInt2, <span style="color: #000066; font-weight: bold;">int</span> paramInt3, <span style="color: #000066; font-weight: bold;">int</span> paramInt4, <span style="color: #000066; font-weight: bold;">int</span> paramInt5 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$value<span style="color: #009900;">&#40;</span> paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">invalidate</span>$<span style="color: #009900;">&#40;</span> paramInt1, paramInt2, paramInt3, paramInt4, paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> varChangeBits$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt1, <span style="color: #000066; font-weight: bold;">int</span> paramInt2, <span style="color: #000066; font-weight: bold;">int</span> paramInt3 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> <span style="color: #009900;">&#40;</span> paramInt2 <span style="color: #339933;">^</span> 0xFFFFFFFF <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> <span style="color: #009900;">&#40;</span> paramInt2 <span style="color: #339933;">^</span> 0xFFFFFFFF <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">varChangeBits</span>$<span style="color: #009900;">&#40;</span> paramInt1, paramInt2, paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; initialize$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">boolean</span> paramBoolean <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span> paramBoolean <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #cc66cc;">769</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$boundValue <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Very interesting. Let&#8217;s take a deeper look:<br />
First two fields are created as expected. </p>
<h4>Dirty flags</h4>
<p>Additionally for both fields a short &#8220;VFLG$&#8221; has been generated. Those hold the dirty state of the var. There is also a static field (int) prefixed with &#8220;VOFF&#8221; for every var. Seems to hold some sort of index?</p>
<h4>Getters</h4>
<p>And now there have been created (private!) getters. The getter for the unbound var is simple. Just returns the field. The getter for <em>boundValue</em> is more interesting:<br />
It contains some checks about its state using <em>VFLG$boundValue</em>. Depending on that state the field is updated (see line 61) using the getter for <em>value</em>. Here we can see that bindings are in fact lazy.</p>
<h4>Invalidate methods</h4>
<p>For every var there has been created an invalidate method. Those change the dirty flag and call <em>notifyDependents$</em>. That method delegates to <em>DependentsManager</em>.<br />
Very interesting: The invalidate method for boudnValue does not call <em>notifyDepenents</em>. This is probably an optimization because the scope of the vars is script.</p>
<h4>Generic methods</h4>
<p>There are generic get/set/invalidate methods that delegate to the corresponding methods based on the index.</p>
<h4>applyDefaults</h4>
<p>This method is also interesting. It is called from FXBase#applyDefaults which itself is called within the constructor. I don&#8217;t know if it is called sometimes else. But probably it is&#8230;</p>
<h4>Constructor</h4>
<p>The constructor is different. It does not initialize the the fields. Instead they are set to their default values.</p>
<h2>One var with <em>on replace</em></h2>
<p>To verify that thought we go one step back: Just one var, but this time we add a <em>on replace</em> method.</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.Checks</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXBase</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXObject</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.Public</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.ScriptPrivate</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.SourceName</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.lang.Builtins</span><span style="color: #339933;">;</span><br />
<br />
@<span style="color: #000000; font-weight: bold;">Public</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Test <span style="color: #000000; font-weight: bold;">extends</span> FXBase <span style="color: #000000; font-weight: bold;">implements</span> FXObject <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VCNT$ <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> VOFF$value <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">short</span> VFLG$value<span style="color: #339933;">;</span><br />
<br />
&nbsp; @ScriptPrivate<br />
&nbsp; @SourceName<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;value&quot;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> $value<span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VCNT$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> count$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$value<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> onReplace$value<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString1, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString2 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; Builtins.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;value changed to %s&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span>get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> applyDefaults$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>varTestBits$<span style="color: #009900;">&#40;</span> paramInt, <span style="color: #cc66cc;">56</span>, <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.$value<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">|</span> 0x18 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>Checks.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span> str, <span style="color: #0000ff;">&quot;asdf&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> 0x10 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;asdf&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onReplace$value<span style="color: #009900;">&#40;</span> str, <span style="color: #0000ff;">&quot;asdf&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">applyDefaults</span>$<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> get$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">get</span>$<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> set$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> paramObject <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> <span style="color: #009900;">&#41;</span> paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">set</span>$<span style="color: #009900;">&#40;</span> paramInt, paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> varChangeBits$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt1, <span style="color: #000066; font-weight: bold;">int</span> paramInt2, <span style="color: #000066; font-weight: bold;">int</span> paramInt3 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> <span style="color: #009900;">&#40;</span> paramInt2 <span style="color: #339933;">^</span> 0xFFFFFFFF <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">varChangeBits</span>$<span style="color: #009900;">&#40;</span> paramInt1, paramInt2, paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; initialize$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">boolean</span> paramBoolean <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span> paramBoolean <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #cc66cc;">65</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>What is the difference?<br />
The same stuff is created as in the last example. Of course this is necessary because the on replace method is part of the binding stuff. The difference is, that there has been created a <em>onReplace$value</em> method with two parameters (don&#8217;t know what those parameters represent).<br />
This method is only called in <em>applyDefaults</em>. Probably another optimization.</p>
<h2>Two public-read vars with a on replace method</h2>
<p>This results in something like that:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br />182<br />183<br />184<br />185<br />186<br />187<br />188<br />189<br />190<br />191<br />192<br />193<br />194<br />195<br />196<br />197<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.cedarsoft.collustra</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.Checks</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXBase</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXObject</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.Public</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.PublicReadable</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.ScriptPrivate</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.SourceName</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javafx.lang.Builtins</span><span style="color: #339933;">;</span><br />
<br />
@<span style="color: #000000; font-weight: bold;">Public</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Test <span style="color: #000000; font-weight: bold;">extends</span> FXBase <span style="color: #000000; font-weight: bold;">implements</span> FXObject <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VCNT$ <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VOFF$value <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VOFF$boundValue <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">short</span> VFLG$value<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">short</span> VFLG$boundValue<span style="color: #339933;">;</span><br />
<br />
&nbsp; @PublicReadable<br />
&nbsp; @ScriptPrivate<br />
&nbsp; @SourceName<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;value&quot;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> $value<span style="color: #339933;">;</span><br />
<br />
&nbsp; @PublicReadable<br />
&nbsp; @ScriptPrivate<br />
&nbsp; @SourceName<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;boundValue&quot;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> $boundValue<span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VCNT$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> count$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$value<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> set$value<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0x200 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> restrictSet$<span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.$value<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">|</span> 0x18 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>Checks.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span> str, paramString <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> 0x10 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; invalidate$value<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">97</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$value <span style="color: #339933;">=</span> paramString<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; invalidate$value<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">94</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; onReplace$value<span style="color: #009900;">&#40;</span> str, paramString <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> 0x1 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$value<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> invalidate$value<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0x7<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> i <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> j <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> paramInt <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; paramInt <span style="color: #339933;">&amp;=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">35</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; notifyDependents$<span style="color: #009900;">&#40;</span> VOFF$value, paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #339933;">&amp;</span> 0x8 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0x40 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">64</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onReplace$value<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString1, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString2 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; Builtins.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>.<span style="color: #006633;">format</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;value changed to %s&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#123;</span>get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> get$boundValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x18 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">|</span> 0x400 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x104 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">260</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0xFFFFFFE7 <span style="color: #339933;">|</span> 0x0 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str1 <span style="color: #339933;">=</span> get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">|</span> 0x200 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x5 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> i<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> str1<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.$boundValue<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> 0x19 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>Checks.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span> str2, str1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> 0x10 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$boundValue <span style="color: #339933;">=</span> str1<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; onReplace$boundValue<span style="color: #009900;">&#40;</span> str2, str1 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$boundValue<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> set$boundValue<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x200 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> restrictSet$<span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">|</span> 0x200 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.$boundValue<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">|</span> 0x18 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>Checks.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span> str, paramString <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> 0x10 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">97</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$boundValue <span style="color: #339933;">=</span> paramString<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">94</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; onReplace$boundValue<span style="color: #009900;">&#40;</span> str, paramString <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> 0x1 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$boundValue<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> invalidate$boundValue<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x7<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> i <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> j <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #339933;">&amp;</span> 0x8 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> 0x5 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> paramInt <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; paramInt <span style="color: #339933;">&amp;=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">35</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; notifyDependents$<span style="color: #009900;">&#40;</span> VOFF$boundValue, paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onReplace$boundValue<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString1, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString2 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> applyDefaults$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>varTestBits$<span style="color: #009900;">&#40;</span> paramInt, <span style="color: #cc66cc;">56</span>, <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; set$value<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;asdf&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">65</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">92</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> 0x440 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> get$boundValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">applyDefaults</span>$<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> get$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> get$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> get$boundValue<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">get</span>$<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> set$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> paramObject <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; set$value<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> <span style="color: #009900;">&#41;</span> paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; set$boundValue<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> <span style="color: #009900;">&#41;</span> paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">set</span>$<span style="color: #009900;">&#40;</span> paramInt, paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> invalidate$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt1, <span style="color: #000066; font-weight: bold;">int</span> paramInt2, <span style="color: #000066; font-weight: bold;">int</span> paramInt3, <span style="color: #000066; font-weight: bold;">int</span> paramInt4, <span style="color: #000066; font-weight: bold;">int</span> paramInt5 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$value<span style="color: #009900;">&#40;</span> paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$boundValue<span style="color: #009900;">&#40;</span> paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">invalidate</span>$<span style="color: #009900;">&#40;</span> paramInt1, paramInt2, paramInt3, paramInt4, paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> varChangeBits$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt1, <span style="color: #000066; font-weight: bold;">int</span> paramInt2, <span style="color: #000066; font-weight: bold;">int</span> paramInt3 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">&amp;</span> <span style="color: #009900;">&#40;</span> paramInt2 <span style="color: #339933;">^</span> 0xFFFFFFFF <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">&amp;</span> <span style="color: #009900;">&#40;</span> paramInt2 <span style="color: #339933;">^</span> 0xFFFFFFFF <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">varChangeBits</span>$<span style="color: #009900;">&#40;</span> paramInt1, paramInt2, paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; initialize$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">boolean</span> paramBoolean <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span> paramBoolean <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$value <span style="color: #339933;">=</span> <span style="color: #cc66cc;">65</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$boundValue <span style="color: #339933;">=</span> <span style="color: #cc66cc;">769</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$value <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$boundValue <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>And now (see line 51) the call to <em>onReplace</em> has been added to the setter for <em>value</em>. Now we also understand the meaning of the parameters. The first one is the old value while the second one is the new one.</p>
<p>Interestingly there also has been genereated an empty <em>onReplace</em> method for <em>boundValue</em>. Propably because of overriding stuff?</p>
<p>The getter and setter are both public now. But I just set the scope to public-read. So don&#8217;t understand exactly why it is necessary to make the setter public, too.</p>
<h2>Binding from other class</h2>
<p>Now we create a sample where we bind from another class. Maybe we can learn something new.</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">public class Test2<span style="color: #009900;">&#123;</span><br />
&nbsp; var test <span style="color: #339933;">=</span> Test<span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; public var otherBound <span style="color: #339933;">=</span> bind test.<span style="color: #202020;">value</span><span style="color: #339933;">;</span> &nbsp; &nbsp;<br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>And here is the pseudo java code:</p>
<div class="codecolorer-container java default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br />182<br />183<br />184<br />185<br />186<br />187<br />188<br />189<br />190<br />191<br />192<br />193<br />194<br />195<br />196<br />197<br />198<br />199<br />200<br />201<br /></div></td><td><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.Checks</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXBase</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.FXObject</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.Public</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.ScriptPrivate</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.sun.javafx.runtime.annotation.SourceName</span><span style="color: #339933;">;</span><br />
<br />
@<span style="color: #000000; font-weight: bold;">Public</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Test2 <span style="color: #000000; font-weight: bold;">extends</span> FXBase <span style="color: #000000; font-weight: bold;">implements</span> FXObject <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VCNT$ <span style="color: #339933;">=</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> VOFF$test <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VOFF$otherBound <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">short</span> VFLG$test<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">short</span> VFLG$otherBound<span style="color: #339933;">;</span><br />
<br />
&nbsp; @ScriptPrivate<br />
&nbsp; @SourceName<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;test&quot;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> Test $test<span style="color: #339933;">;</span><br />
<br />
&nbsp; @<span style="color: #000000; font-weight: bold;">Public</span><br />
&nbsp; @SourceName<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;otherBound&quot;</span> <span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> $otherBound<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> DCNT$ <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000066; font-weight: bold;">int</span> DEP$test$_$value <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> VCNT$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> count$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> Test get$test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$test<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> invalidate$test<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">&amp;</span> 0x7<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> i <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> j <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> paramInt <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; paramInt <span style="color: #339933;">&amp;=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">35</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; notifyDependents$<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">0</span>, paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; invalidate$otherBound<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> onReplace$test<span style="color: #009900;">&#40;</span> Test paramTest1, Test paramTest2 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> Test.<span style="color: #006633;">VOFF</span>$value<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; FXBase.<span style="color: #006633;">switchDependence</span>$<span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>, paramTest1, i, paramTest2, i, <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> get$otherBound<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0x18 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">|</span> 0x400 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0x104 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">260</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0xFFFFFFE7 <span style="color: #339933;">|</span> 0x0 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str1 <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> get$test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> get$test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">get</span>$value<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">|</span> 0x200 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0x5 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> i<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> str1<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.$otherBound<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> 0x19 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>Checks.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span> str2, str1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> 0x10 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$otherBound <span style="color: #339933;">=</span> str1<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; onReplace$otherBound<span style="color: #009900;">&#40;</span> str2, str1 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$otherBound<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> set$otherBound<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0x200 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> restrictSet$<span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">|</span> 0x200 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> str <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.$otherBound<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">|</span> 0x18 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>Checks.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span> str, paramString <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> 0x10 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; invalidate$otherBound<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">97</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$otherBound <span style="color: #339933;">=</span> paramString<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; invalidate$otherBound<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">94</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; onReplace$otherBound<span style="color: #009900;">&#40;</span> str, paramString <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> 0x1 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.$otherBound<span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> invalidate$otherBound<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0x7<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> i <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> j <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #339933;">&amp;</span> 0x8 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">&amp;</span> 0x5 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> paramInt <span style="color: #339933;">&gt;&gt;</span> <span style="color: #cc66cc;">4</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; paramInt <span style="color: #339933;">&amp;=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">35</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; notifyDependents$<span style="color: #009900;">&#40;</span> VOFF$otherBound, paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onReplace$otherBound<span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString1, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> paramString2 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> applyDefaults$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>varTestBits$<span style="color: #009900;">&#40;</span> paramInt, <span style="color: #cc66cc;">56</span>, <span style="color: #cc66cc;">8</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Test localTest1 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Test localTest2 <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.$test<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">int</span> i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">|</span> 0x18 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> localTest2 <span style="color: #339933;">!=</span> localTest1 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> i <span style="color: #339933;">&amp;</span> 0x10 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; invalidate$test<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">97</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$test <span style="color: #339933;">=</span> localTest1<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; invalidate$test<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">94</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onReplace$test<span style="color: #009900;">&#40;</span> localTest2, localTest1 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">&amp;</span> 0xFFFFFFF8 <span style="color: #339933;">|</span> 0x1 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$otherBound<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">65</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$otherBound<span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">92</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> 0x440 <span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#41;</span> get$otherBound<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">applyDefaults</span>$<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">int</span> DCNT$<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> update$<span style="color: #009900;">&#40;</span> FXObject paramFXObject, <span style="color: #000066; font-weight: bold;">int</span> paramInt1, <span style="color: #000066; font-weight: bold;">int</span> paramInt2, <span style="color: #000066; font-weight: bold;">int</span> paramInt3, <span style="color: #000066; font-weight: bold;">int</span> paramInt4, <span style="color: #000066; font-weight: bold;">int</span> paramInt5 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> paramFXObject <span style="color: #339933;">==</span> <span style="color: #000000; font-weight: bold;">this</span>.$test <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; invalidate$otherBound<span style="color: #009900;">&#40;</span> paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">update</span>$<span style="color: #009900;">&#40;</span> paramFXObject, paramInt1, paramInt2, paramInt3, paramInt4, paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> get$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> get$test<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> get$otherBound<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">get</span>$<span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> set$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> paramObject <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$test <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> Test <span style="color: #009900;">&#41;</span> paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; set$otherBound<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> <span style="color: #009900;">&#41;</span> paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">set</span>$<span style="color: #009900;">&#40;</span> paramInt, paramObject <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> invalidate$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt1, <span style="color: #000066; font-weight: bold;">int</span> paramInt2, <span style="color: #000066; font-weight: bold;">int</span> paramInt3, <span style="color: #000066; font-weight: bold;">int</span> paramInt4, <span style="color: #000066; font-weight: bold;">int</span> paramInt5 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$test<span style="color: #009900;">&#40;</span> paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; invalidate$otherBound<span style="color: #009900;">&#40;</span> paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">invalidate</span>$<span style="color: #009900;">&#40;</span> paramInt1, paramInt2, paramInt3, paramInt4, paramInt5 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> varChangeBits$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">int</span> paramInt1, <span style="color: #000066; font-weight: bold;">int</span> paramInt2, <span style="color: #000066; font-weight: bold;">int</span> paramInt3 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">switch</span> <span style="color: #009900;">&#40;</span> paramInt1 <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">&amp;</span> <span style="color: #009900;">&#40;</span> paramInt2 <span style="color: #339933;">^</span> 0xFFFFFFFF <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">short</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">&amp;</span> <span style="color: #009900;">&#40;</span> paramInt2 <span style="color: #339933;">^</span> 0xFFFFFFFF <span style="color: #009900;">&#41;</span> <span style="color: #339933;">|</span> paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">varChangeBits</span>$<span style="color: #009900;">&#40;</span> paramInt1, paramInt2, paramInt3 <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test2<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span><span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; initialize$<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> Test2<span style="color: #009900;">&#40;</span> <span style="color: #000066; font-weight: bold;">boolean</span> paramBoolean <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span> paramBoolean <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$test <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">VFLG</span>$otherBound <span style="color: #339933;">=</span> <span style="color: #cc66cc;">769</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.$otherBound <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>The most interesting part is at line 52: There a call to <em>FXBase.switchDependence$</em> is made every time the test reference is changing. This method delegates to <em>DependentsManager#addDependent</em>. </p>
<p>This is where the magic happens. I think I will take a deeper look at that stuff later.</p>
<h2>Initialzing objects with parameters</h2>
<p>If objects are created using the object literal, the JavaFX compiler generates the calls to set the initial value and calls <em>complete$()</em> on the newly created object finally.<br />
Within complete$() the userInit$() and postInit$() methods are called.</p>
<h2>Conclusion regarding binding</h2>
<p>I hoped to find a way how to bind JavaFX objects to Java objects providing PropertyChangeEvents. Investigating the DependentsManager further might give further hints.<br />
At the moment it looks a little bit difficult since the DependentsManager is working on FXObjects. So it is very probable that at least some kind of adapter objects is necessary&#8230; But who knows&#8230;.</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2010/05/javafx-internals-part-2/" rel="bookmark" class="crp_title">JavaFX Internals Part 2</a></li><li><a href="http://blog.cedarsoft.com/2010/07/junit-theory-oddities/" rel="bookmark" class="crp_title">JUnit @Theory oddities</a></li><li><a href="http://blog.cedarsoft.com/2010/05/binding-propertychangesupport-to-javafx-objects/" rel="bookmark" class="crp_title">Binding PropertyChangeSupport to JavaFX objects transparently</a></li><li><a href="http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/" rel="bookmark" class="crp_title">Closing the gap between Java and JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2008/01/why-you-should-only-return-collections-with-bounded-wildcards/" rel="bookmark" class="crp_title">Why you should only return Collections with bounded wildcards</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/05/analyzing-javafx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JavaFX Bug or Feature? Panel doesn&#8217;t layout if placed in class</title>
		<link>http://blog.cedarsoft.com/2010/05/javafx-bug-or-feature-panel-doesnt-layout-if-placed-in-class/</link>
		<comments>http://blog.cedarsoft.com/2010/05/javafx-bug-or-feature-panel-doesnt-layout-if-placed-in-class/#comments</comments>
		<pubDate>Sat, 01 May 2010 14:50:26 +0000</pubDate>
		<dc:creator>johannes</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.cedarsoft.com/?p=300</guid>
		<description><![CDATA[I run into a strange problem. I think I have missed something. So every hint is welcome!
Try this demo:
123456789101112131415161718192021222324252627282930313233343536373839404142434445import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.Panel;
import javafx.scene.shape.Rectangle;
import javafx.scene.paint.Color;
import javafx.scene.layout.Container;

public function run&#40; &#160; &#41; &#123;

&#160; //Remove the next two lines for a miracle!
&#160; Asdf &#123;&#125;&#125;
public class Asdf &#123;

&#160; def stage: Stage = Stage &#123;
&#160; &#160; &#160; scene: Scene &#123;
&#160; &#160; ]]></description>
			<content:encoded><![CDATA[<p>I run into a strange problem. I think I have missed something. So every hint is welcome!</p>
<p>Try this demo:</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br /></div></td><td><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import javafx.<span style="color: #202020;">stage</span>.<span style="color: #202020;">Stage</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">Scene</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">layout</span>.<span style="color: #202020;">Panel</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">shape</span>.<span style="color: #202020;">Rectangle</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">paint</span>.<span style="color: #202020;">Color</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">layout</span>.<span style="color: #202020;">Container</span><span style="color: #339933;">;</span><br />
<br />
public <span style="color: #000000; font-weight: bold;">function</span> run<span style="color: #009900;">&#40;</span> &nbsp; <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; <span style="color: #666666; font-style: italic;">//Remove the next two lines for a miracle!</span><br />
&nbsp; Asdf <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#125;</span><br />
public class Asdf <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; def stage<span style="color: #339933;">:</span> Stage <span style="color: #339933;">=</span> Stage <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; scene<span style="color: #339933;">:</span> Scene <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> <span style="color: #0000dd;">800</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; height<span style="color: #339933;">:</span> <span style="color: #0000dd;">600</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; content<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; def p<span style="color: #339933;">:</span> Panel <span style="color: #339933;">=</span> Panel <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> bind stage.<span style="color: #202020;">scene</span>.<span style="color: #202020;">width</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height<span style="color: #339933;">:</span> bind stage.<span style="color: #202020;">scene</span>.<span style="color: #202020;">height</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onLayout<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> Void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p.<span style="color: #202020;">resizeContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span> node in Container.<span style="color: #202020;">getManaged</span><span style="color: #009900;">&#40;</span> p.<span style="color: #202020;">content</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Container.<span style="color: #202020;">positionNode</span><span style="color: #009900;">&#40;</span> node<span style="color: #339933;">,</span> indexof node <span style="color: #339933;">*</span> <span style="color: #0000dd;">20</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">50</span><span style="color: #339933;">,</span> indexof node <span style="color: #339933;">*</span> <span style="color: #0000dd;">30</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">40</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; content<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rectangle <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> <span style="color: #0000dd;">140</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #0000dd;">90</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fill<span style="color: #339933;">:</span> Color.<span style="color: #202020;">ORANGE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity<span style="color: #339933;">:</span> <span style="color:#800080;">0.5</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rectangle <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> <span style="color: #0000dd;">100</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #0000dd;">120</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fill<span style="color: #339933;">:</span> Color.<span style="color: #202020;">BLUE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity<span style="color: #339933;">:</span> <span style="color:#800080;">0.5</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>The layout of the panel doesn&#8217;t work properly&#8230;</p>
<p>Now lets move the stage directly into the run function (just remove two lines):</p>
<div class="codecolorer-container c default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br /></div></td><td><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">import javafx.<span style="color: #202020;">stage</span>.<span style="color: #202020;">Stage</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">Scene</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">layout</span>.<span style="color: #202020;">Panel</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">shape</span>.<span style="color: #202020;">Rectangle</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">paint</span>.<span style="color: #202020;">Color</span><span style="color: #339933;">;</span><br />
import javafx.<span style="color: #202020;">scene</span>.<span style="color: #202020;">layout</span>.<span style="color: #202020;">Container</span><span style="color: #339933;">;</span><br />
<br />
public <span style="color: #000000; font-weight: bold;">function</span> run<span style="color: #009900;">&#40;</span> &nbsp; <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; <span style="color: #666666; font-style: italic;">//Remove the next two lines for a miracle!</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">//Asdf {}}</span><br />
<span style="color: #666666; font-style: italic;">//public class Asdf {</span><br />
<br />
&nbsp; def stage<span style="color: #339933;">:</span> Stage <span style="color: #339933;">=</span> Stage <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; scene<span style="color: #339933;">:</span> Scene <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> <span style="color: #0000dd;">800</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; height<span style="color: #339933;">:</span> <span style="color: #0000dd;">600</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; content<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; def p<span style="color: #339933;">:</span> Panel <span style="color: #339933;">=</span> Panel <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> bind stage.<span style="color: #202020;">scene</span>.<span style="color: #202020;">width</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height<span style="color: #339933;">:</span> bind stage.<span style="color: #202020;">scene</span>.<span style="color: #202020;">height</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; onLayout<span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> Void <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p.<span style="color: #202020;">resizeContent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span> node in Container.<span style="color: #202020;">getManaged</span><span style="color: #009900;">&#40;</span> p.<span style="color: #202020;">content</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Container.<span style="color: #202020;">positionNode</span><span style="color: #009900;">&#40;</span> node<span style="color: #339933;">,</span> indexof node <span style="color: #339933;">*</span> <span style="color: #0000dd;">20</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">50</span><span style="color: #339933;">,</span> indexof node <span style="color: #339933;">*</span> <span style="color: #0000dd;">30</span> <span style="color: #339933;">+</span> <span style="color: #0000dd;">40</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; content<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rectangle <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> <span style="color: #0000dd;">140</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #0000dd;">90</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fill<span style="color: #339933;">:</span> Color.<span style="color: #202020;">ORANGE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity<span style="color: #339933;">:</span> <span style="color:#800080;">0.5</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rectangle <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width<span style="color: #339933;">:</span> <span style="color: #0000dd;">100</span><span style="color: #339933;">,</span> height<span style="color: #339933;">:</span> <span style="color: #0000dd;">120</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fill<span style="color: #339933;">:</span> Color.<span style="color: #202020;">BLUE</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; opacity<span style="color: #339933;">:</span> <span style="color:#800080;">0.5</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Now everything works as expected! Any hints?</p>
<div id="crp_related"><h3>Related Posts:</h3><ul><li><a href="http://blog.cedarsoft.com/2010/04/new-javafx-default-font-amble-condensed/" rel="bookmark" class="crp_title">New JavaFX default font (Amble Condensed) looks ugly!</a></li><li><a href="http://blog.cedarsoft.com/2010/04/javafx-light-bulb-with-improved-ui-performance-slider/" rel="bookmark" class="crp_title">JavaFX Light Bulb with improved UI performance</a></li><li><a href="http://blog.cedarsoft.com/2010/05/closing-the-gap-between-java-and-javafx/" rel="bookmark" class="crp_title">Closing the gap between Java and JavaFX</a></li><li><a href="http://blog.cedarsoft.com/2010/04/javafx-and-custom-controls/" rel="bookmark" class="crp_title">JavaFX and custom controls</a></li><li><a href="http://blog.cedarsoft.com/2010/04/javafx-creating-custom-controls-the-right-way/" rel="bookmark" class="crp_title">JavaFX: Creating custom controls &#8211; the right way</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://blog.cedarsoft.com/2010/05/javafx-bug-or-feature-panel-doesnt-layout-if-placed-in-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
