<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: UDD and Java	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/udd-and-java/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/udd-and-java?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=udd-and-java</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Wed, 06 Apr 2011 19:24:35 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.3</generator>
	<item>
		<title>
		By: julien		</title>
		<link>https://undocumentedmatlab.com/articles/udd-and-java#comment-39006</link>

		<dc:creator><![CDATA[julien]]></dc:creator>
		<pubDate>Wed, 06 Apr 2011 19:24:35 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2213#comment-39006</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/udd-and-java#comment-38994&quot;&gt;Donn&lt;/a&gt;.

Thank you for your answer Donn ! Unfortunately, I will have to deal with Bound properties (JavaBeans) to be sure that the properties I want to monitore fire PropertyChange events... 
Thanks again for your articles,
Best Regards]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/udd-and-java#comment-38994">Donn</a>.</p>
<p>Thank you for your answer Donn ! Unfortunately, I will have to deal with Bound properties (JavaBeans) to be sure that the properties I want to monitore fire PropertyChange events&#8230;<br />
Thanks again for your articles,<br />
Best Regards</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Donn		</title>
		<link>https://undocumentedmatlab.com/articles/udd-and-java#comment-38994</link>

		<dc:creator><![CDATA[Donn]]></dc:creator>
		<pubDate>Wed, 06 Apr 2011 17:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2213#comment-38994</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/udd-and-java#comment-38958&quot;&gt;julien&lt;/a&gt;.

@julien - I do not have an answer for you. Perhaps a person with more knowledge of java can explain why &#039;PropertyChange&#039; is only fired for a subset of JLabels properties. As for the &#039;PropertyPostSet&#039; listener this looks like a bug to me. I suspect that the MATLAB notation changes the UDD peer and generates the &#039;PropertyPostSet&#039; event and synchronizes the java objects property. When the java notation is used it may be that the java object is set and then the UDD object is synchronized. If that is the order of events then this may be related to MATLABs lack of support for asynchronous events in COM objects. Both the java peer mechanism and COM support are based on UDD. The MathWorks explicitly states with COM that asynchronous events are not supported.

Sorry I can&#039;t be of more help,

Donn]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/udd-and-java#comment-38958">julien</a>.</p>
<p>@julien &#8211; I do not have an answer for you. Perhaps a person with more knowledge of java can explain why &#8216;PropertyChange&#8217; is only fired for a subset of JLabels properties. As for the &#8216;PropertyPostSet&#8217; listener this looks like a bug to me. I suspect that the MATLAB notation changes the UDD peer and generates the &#8216;PropertyPostSet&#8217; event and synchronizes the java objects property. When the java notation is used it may be that the java object is set and then the UDD object is synchronized. If that is the order of events then this may be related to MATLABs lack of support for asynchronous events in COM objects. Both the java peer mechanism and COM support are based on UDD. The MathWorks explicitly states with COM that asynchronous events are not supported.</p>
<p>Sorry I can&#8217;t be of more help,</p>
<p>Donn</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: julien		</title>
		<link>https://undocumentedmatlab.com/articles/udd-and-java#comment-38958</link>

		<dc:creator><![CDATA[julien]]></dc:creator>
		<pubDate>Wed, 06 Apr 2011 07:18:59 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2213#comment-38958</guid>

					<description><![CDATA[Thanks Donn for these excellent and well written articles !
I have a question, maybe you could help me. My problem is simple, I would like to trigger a Matlab callback when the value of a property of a java object changes.
I tried 2 things : First is to set &#039;PropertyChangeCallback&#039; to the UDD companion of my java Object.
&lt;pre lang=&quot;matlab&quot;&gt;
J=handle(javax.swing.JLabel(&#039;Hello&#039;),&#039;CallbackProperties&#039;);
set(J,&#039;PropertyChangeCallback&#039;,@(h,e)disp(&#039;Property changed&#039;));
&lt;/pre&gt;
When I modify the &quot;Text&quot; property, it works perfectly well.
&lt;pre lang=&quot;matlab&quot;&gt;
&gt;&gt; J.setText(&#039;New Value&#039;);
Property changed
&lt;/pre&gt;
However, the callback does not trigger on every properties. For example, 
&lt;pre lang=&quot;matlab&quot;&gt;J.setAutoscrolls(true); % Does not trigger the Callback&lt;/pre&gt;

So, my second try was to use UDD property event mechanism. 
&lt;pre lang=&quot;matlab&quot;&gt;
J=handle(javax.swing.JLabel(&#039;Hello&#039;),&#039;CallbackProperties&#039;);
P=findprop(J,&#039;Text&#039;);
L=handle.listener(J,P,&#039;PropertyPostSet&#039;,@(h,e)disp(&#039;UDD property changed&#039;));
&lt;/pre&gt;
This works, but only when the property value is changed from the set method on the UDD object : 
&lt;pre lang=&quot;matlab&quot;&gt;
&gt;&gt; J.setText(&#039;Again a new value&#039;); % Java side : does not trigger listener callback
&gt;&gt; set(J,&#039;Text&#039;,&#039;Hello&#039;); % This triggers the listener callback
UDD property changed
&lt;/pre&gt;

What I would like is to be able to trigger the callback on all properties of java objects and from property changes which come from java side (j.setProperty syntax) or Matlab side (set(obj,&#039;Property&#039;,Value) syntax).

Do you know how I could do that from Matlab side ?
Thank you very much in advance for your help.]]></description>
			<content:encoded><![CDATA[<p>Thanks Donn for these excellent and well written articles !<br />
I have a question, maybe you could help me. My problem is simple, I would like to trigger a Matlab callback when the value of a property of a java object changes.<br />
I tried 2 things : First is to set &#8216;PropertyChangeCallback&#8217; to the UDD companion of my java Object.</p>
<pre lang="matlab">
J=handle(javax.swing.JLabel('Hello'),'CallbackProperties');
set(J,'PropertyChangeCallback',@(h,e)disp('Property changed'));
</pre>
<p>When I modify the &#8220;Text&#8221; property, it works perfectly well.</p>
<pre lang="matlab">
>> J.setText('New Value');
Property changed
</pre>
<p>However, the callback does not trigger on every properties. For example, </p>
<pre lang="matlab">J.setAutoscrolls(true); % Does not trigger the Callback</pre>
<p>So, my second try was to use UDD property event mechanism. </p>
<pre lang="matlab">
J=handle(javax.swing.JLabel('Hello'),'CallbackProperties');
P=findprop(J,'Text');
L=handle.listener(J,P,'PropertyPostSet',@(h,e)disp('UDD property changed'));
</pre>
<p>This works, but only when the property value is changed from the set method on the UDD object : </p>
<pre lang="matlab">
>> J.setText('Again a new value'); % Java side : does not trigger listener callback
>> set(J,'Text','Hello'); % This triggers the listener callback
UDD property changed
</pre>
<p>What I would like is to be able to trigger the callback on all properties of java objects and from property changes which come from java side (j.setProperty syntax) or Matlab side (set(obj,&#8217;Property&#8217;,Value) syntax).</p>
<p>Do you know how I could do that from Matlab side ?<br />
Thank you very much in advance for your help.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matt Whitaker		</title>
		<link>https://undocumentedmatlab.com/articles/udd-and-java#comment-37769</link>

		<dc:creator><![CDATA[Matt Whitaker]]></dc:creator>
		<pubDate>Thu, 24 Mar 2011 18:51:34 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2213#comment-37769</guid>

					<description><![CDATA[I totally agree Yair. I have been reading this series closely and have learned an immense amount of detail on these UDD objects.
Bravo, Donn! Much appreciated]]></description>
			<content:encoded><![CDATA[<p>I totally agree Yair. I have been reading this series closely and have learned an immense amount of detail on these UDD objects.<br />
Bravo, Donn! Much appreciated</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
