<?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: Matlab layout managers: uicontainer and relatives	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=matlab-layout-managers-uicontainer-and-relatives</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Sat, 30 Apr 2016 20:17:23 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: nirvana-msu		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-375389</link>

		<dc:creator><![CDATA[nirvana-msu]]></dc:creator>
		<pubDate>Sat, 30 Apr 2016 20:17:23 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-375389</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-375292&quot;&gt;nirvana-msu&lt;/a&gt;.

True, we add java peers and not uicontrol handles themselves, but at the end of the day it does allow us to effectively manage the layout of arbitrary uicontrols (and java components) using flexible Java layout managers, which, I think, not a lot of people realize.
Btw, thanks for all your great utilities and tips : )]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-375292">nirvana-msu</a>.</p>
<p>True, we add java peers and not uicontrol handles themselves, but at the end of the day it does allow us to effectively manage the layout of arbitrary uicontrols (and java components) using flexible Java layout managers, which, I think, not a lot of people realize.<br />
Btw, thanks for all your great utilities and tips : )</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-375382</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 30 Apr 2016 17:37:09 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-375382</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-375292&quot;&gt;nirvana-msu&lt;/a&gt;.

@nirvana - this is correct, but what you are essentially doing is adding a Java component to a Java container - you are not adding the Matlab uicontrol. In this respect, using the underlying Java peer (via &lt;i&gt;&lt;b&gt;findjobj&lt;/b&gt;&lt;/i&gt;) is bypassing this limitation. Unfortunately, axes do not have similar Java peers that can be manipulated in a similar manner - they do have a Java canvas that can be accessed, but it extends over the entire figure&#039;s ContentPane (in theory you could try to resize that canvas and add it to the JContainer, but odd things might result...).]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-375292">nirvana-msu</a>.</p>
<p>@nirvana &#8211; this is correct, but what you are essentially doing is adding a Java component to a Java container &#8211; you are not adding the Matlab uicontrol. In this respect, using the underlying Java peer (via <i><b>findjobj</b></i>) is bypassing this limitation. Unfortunately, axes do not have similar Java peers that can be manipulated in a similar manner &#8211; they do have a Java canvas that can be accessed, but it extends over the entire figure&#8217;s ContentPane (in theory you could try to resize that canvas and add it to the JContainer, but odd things might result&#8230;).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: nirvana-msu		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-375292</link>

		<dc:creator><![CDATA[nirvana-msu]]></dc:creator>
		<pubDate>Fri, 29 Apr 2016 17:08:10 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-375292</guid>

					<description><![CDATA[Hi Yair,

Isn&#039;t this statement incorrect?
&lt;pre&gt;
Just remember the limitation that no Matlab component (such as GUI controls or plot axes) can be added to Java containers.
&lt;/pre&gt;

You cannot add axes, but you can manage a mixture of java components &lt;b&gt;and &lt;i&gt;uicontrols&lt;/i&gt;&lt;/b&gt; using swing layout mangers. You just need to add the corresponding java handles of &lt;i&gt;uicontrol&lt;/i&gt; objects to your java container.

E.g. here&#039;s an example applying a &lt;i&gt;BoxLayout&lt;/i&gt; with a horizontal glue to a couple of &lt;i&gt;uicontrol&lt;/i&gt; buttons:

&lt;pre lang=&quot;matlab&quot;&gt;
parent = figure();
jPanel = javaObjectEDT(&#039;javax.swing.JPanel&#039;);

jPanel.setLayout(javax.swing.BoxLayout(jPanel,javax.swing.BoxLayout.X_AXIS));

hButton = uicontrol(&#039;String&#039;, &#039;Button 1&#039;);
jButton = findjobj(hButton);
jPanel.add(jButton);

jPanel.add(javax.swing.Box.createHorizontalGlue());

hButton2 = uicontrol(&#039;String&#039;, &#039;Button 2&#039;);
jButton2 = findjobj(hButton2);
jPanel.add(jButton2(1));

parentPixelPos = getpixelposition(parent);
[~, hContainer] = javacomponent(jPanel, [1, 1, parentPixelPos(3), parentPixelPos(4)], parent);
set(hContainer, &#039;Units&#039;, &#039;normalized&#039;);
&lt;/pre&gt;

I don&#039;t really see much point using &lt;i&gt;uiflowcontainer&lt;/i&gt; and alike. GUI Layout toolbox is perfect for most of the tasks, and when you need a fine-grained control of &lt;i&gt;uicontrol&lt;/i&gt;, layout you can use the technique above (mixing them with java components if required).]]></description>
			<content:encoded><![CDATA[<p>Hi Yair,</p>
<p>Isn&#8217;t this statement incorrect?</p>
<pre>
Just remember the limitation that no Matlab component (such as GUI controls or plot axes) can be added to Java containers.
</pre>
<p>You cannot add axes, but you can manage a mixture of java components <b>and <i>uicontrols</i></b> using swing layout mangers. You just need to add the corresponding java handles of <i>uicontrol</i> objects to your java container.</p>
<p>E.g. here&#8217;s an example applying a <i>BoxLayout</i> with a horizontal glue to a couple of <i>uicontrol</i> buttons:</p>
<pre lang="matlab">
parent = figure();
jPanel = javaObjectEDT('javax.swing.JPanel');

jPanel.setLayout(javax.swing.BoxLayout(jPanel,javax.swing.BoxLayout.X_AXIS));

hButton = uicontrol('String', 'Button 1');
jButton = findjobj(hButton);
jPanel.add(jButton);

jPanel.add(javax.swing.Box.createHorizontalGlue());

hButton2 = uicontrol('String', 'Button 2');
jButton2 = findjobj(hButton2);
jPanel.add(jButton2(1));

parentPixelPos = getpixelposition(parent);
[~, hContainer] = javacomponent(jPanel, [1, 1, parentPixelPos(3), parentPixelPos(4)], parent);
set(hContainer, 'Units', 'normalized');
</pre>
<p>I don&#8217;t really see much point using <i>uiflowcontainer</i> and alike. GUI Layout toolbox is perfect for most of the tasks, and when you need a fine-grained control of <i>uicontrol</i>, layout you can use the technique above (mixing them with java components if required).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-367556</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sat, 16 Jan 2016 17:21:43 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-367556</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-367460&quot;&gt;Shalin&lt;/a&gt;.

You can use the &lt;b&gt;GridSize&lt;/b&gt; and &lt;b&gt;Position&lt;/b&gt; properties (default values = &lt;code&gt;[1,1]&lt;/code&gt; and &lt;code&gt;[0,0,1,1]&lt;/code&gt; meaning 100% in both directions, when &lt;b&gt;Units&lt;/b&gt;=&lt;code&gt;&#039;normalized&#039;&lt;/code&gt;)]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-367460">Shalin</a>.</p>
<p>You can use the <b>GridSize</b> and <b>Position</b> properties (default values = <code>[1,1]</code> and <code>[0,0,1,1]</code> meaning 100% in both directions, when <b>Units</b>=<code>'normalized'</code>)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Shalin		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-367460</link>

		<dc:creator><![CDATA[Shalin]]></dc:creator>
		<pubDate>Fri, 15 Jan 2016 16:41:57 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-367460</guid>

					<description><![CDATA[Is there a way to specify a minimum height or width of uigridcontainer?]]></description>
			<content:encoded><![CDATA[<p>Is there a way to specify a minimum height or width of uigridcontainer?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Is there something peculiar to Matlab or Mathworks that supports so much "undocumented" code? &#124; DL-UAT		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-351438</link>

		<dc:creator><![CDATA[Is there something peculiar to Matlab or Mathworks that supports so much "undocumented" code? &#124; DL-UAT]]></dc:creator>
		<pubDate>Tue, 16 Jun 2015 23:36:09 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-351438</guid>

					<description><![CDATA[[...] while researching UI layout techniques for programmatic GUI creation one of their articles made mention of this uiflowcontainer, which if you get the documentation on it you find it is undocumented. [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] while researching UI layout techniques for programmatic GUI creation one of their articles made mention of this uiflowcontainer, which if you get the documentation on it you find it is undocumented. [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: how to mislay a impression with jquery - Accardo		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-331132</link>

		<dc:creator><![CDATA[how to mislay a impression with jquery - Accardo]]></dc:creator>
		<pubDate>Tue, 09 Sep 2014 02:05:56 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-331132</guid>

					<description><![CDATA[[...] exact, MATLAB has some undocumented plans managers: uiflowcontainer and uigridcontainer. See this article by Yair [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] exact, MATLAB has some undocumented plans managers: uiflowcontainer and uigridcontainer. See this article by Yair [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-326167</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 11 Jun 2014 16:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-326167</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-326166&quot;&gt;Yaroslav&lt;/a&gt;.

I am not aware of the ability to inherit multiple UDD superclasses, but this is not the same as saying that it&#039;s not possible. Perhaps Donn Shull knows how to do it. I&#039;d start looking in Donn&#039;s article on UDD inheritance.

In &lt;i&gt;&lt;b&gt;uicomponent&lt;/b&gt;&lt;/i&gt; I wanted to merge the properties of the Java object and the Matlab container. So I took one of them and simply added to it (dynamically, using &lt;i&gt;&lt;b&gt;schema.prop&lt;/b&gt;&lt;/i&gt;) the properties of the other. Whenever I added such a dynamic property, I also overrode the new property&#039;s &lt;i&gt;&lt;b&gt;set&lt;/b&gt;&lt;/i&gt; method and added &lt;i&gt;&lt;b&gt;handle.listener&lt;/b&gt;&lt;/i&gt;s, so that the original and the new properties would be linked, such that modifying any of them in run-time would automatically update the other. All this is done in a loop over the properties, so it is quite efficient and generic. Look at the source code of &lt;i&gt;&lt;b&gt;uicomponent&lt;/b&gt;&lt;/i&gt; for details - it&#039;s well documented.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-326166">Yaroslav</a>.</p>
<p>I am not aware of the ability to inherit multiple UDD superclasses, but this is not the same as saying that it&#8217;s not possible. Perhaps Donn Shull knows how to do it. I&#8217;d start looking in Donn&#8217;s article on UDD inheritance.</p>
<p>In <i><b>uicomponent</b></i> I wanted to merge the properties of the Java object and the Matlab container. So I took one of them and simply added to it (dynamically, using <i><b>schema.prop</b></i>) the properties of the other. Whenever I added such a dynamic property, I also overrode the new property&#8217;s <i><b>set</b></i> method and added <i><b>handle.listener</b></i>s, so that the original and the new properties would be linked, such that modifying any of them in run-time would automatically update the other. All this is done in a loop over the properties, so it is quite efficient and generic. Look at the source code of <i><b>uicomponent</b></i> for details &#8211; it&#8217;s well documented.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yaroslav		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-326166</link>

		<dc:creator><![CDATA[Yaroslav]]></dc:creator>
		<pubDate>Wed, 11 Jun 2014 16:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-326166</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-326151&quot;&gt;Yaroslav&lt;/a&gt;.

The problem with adding properties to existing UDD handles, is that one must &lt;i&gt;redefine&lt;/i&gt; all the new properties; I want to &lt;i&gt;merge&lt;/i&gt; two UDD classes  (double inheritance, etc.).  Is it possible?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-326151">Yaroslav</a>.</p>
<p>The problem with adding properties to existing UDD handles, is that one must <i>redefine</i> all the new properties; I want to <i>merge</i> two UDD classes  (double inheritance, etc.).  Is it possible?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-326155</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 11 Jun 2014 13:53:42 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=1593#comment-326155</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-326151&quot;&gt;Yaroslav&lt;/a&gt;.

@Yaroslav - take a look at my &lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/14583-uicomponent-expands-uicontrol-to-all-java-classes&quot; rel=&quot;nofollow&quot;&gt;&lt;i&gt;&lt;b&gt;uicomponent&lt;/b&gt;&lt;/i&gt; utility&lt;/a&gt; and how it adds properties to existing UDD handles via the &lt;a href=&quot;http://undocumentedmatlab.com/blog/udd-properties&quot; rel=&quot;nofollow&quot;&gt;&lt;i&gt;&lt;b&gt;schema.prop&lt;/b&gt;&lt;/i&gt;&lt;/a&gt; function.

Note that unfortunately this feature is no longer available in the &lt;a href=&quot;http://undocumentedmatlab.com/blog/hg2-update&quot; rel=&quot;nofollow&quot;&gt;upcoming HG2&lt;/a&gt;.

For more information on UDD inheritance, &lt;a href=&quot;http://undocumentedmatlab.com/blog/hierarchical-systems-with-udd&quot; rel=&quot;nofollow&quot;&gt;read this&lt;/a&gt;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/matlab-layout-managers-uicontainer-and-relatives#comment-326151">Yaroslav</a>.</p>
<p>@Yaroslav &#8211; take a look at my <a href="http://www.mathworks.com/matlabcentral/fileexchange/14583-uicomponent-expands-uicontrol-to-all-java-classes" rel="nofollow"><i><b>uicomponent</b></i> utility</a> and how it adds properties to existing UDD handles via the <a href="http://undocumentedmatlab.com/blog/udd-properties" rel="nofollow"><i><b>schema.prop</b></i></a> function.</p>
<p>Note that unfortunately this feature is no longer available in the <a href="http://undocumentedmatlab.com/blog/hg2-update" rel="nofollow">upcoming HG2</a>.</p>
<p>For more information on UDD inheritance, <a href="http://undocumentedmatlab.com/blog/hierarchical-systems-with-udd" rel="nofollow">read this</a>.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
