<?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>IDS &#8211; Undocumented Matlab</title>
	<atom:link href="https://undocumentedmatlab.com/articles/tag/ids/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Wed, 11 May 2011 17:28:35 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>Borderless button used for plot properties</title>
		<link>https://undocumentedmatlab.com/articles/borderless-button-used-for-plot-properties?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=borderless-button-used-for-plot-properties</link>
					<comments>https://undocumentedmatlab.com/articles/borderless-button-used-for-plot-properties#comments</comments>
		
		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Wed, 11 May 2011 17:28:35 +0000</pubDate>
				<category><![CDATA[GUI]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Low risk of breaking in future versions]]></category>
		<category><![CDATA[Semi-documented function]]></category>
		<category><![CDATA[Undocumented feature]]></category>
		<category><![CDATA[IDS]]></category>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=2307</guid>

					<description><![CDATA[<p>A borderless button can be used to add unobtrusive functionality to plot axes</p>
<p>The post <a rel="nofollow" href="https://undocumentedmatlab.com/articles/borderless-button-used-for-plot-properties">Borderless button used for plot properties</a> appeared first on <a rel="nofollow" href="https://undocumentedmatlab.com">Undocumented Matlab</a>.</p>
<div class='yarpp-related-rss'>
<h3>Related posts:</h3><ol>
<li><a href="https://undocumentedmatlab.com/articles/plot-liminclude-properties" rel="bookmark" title="Plot LimInclude properties">Plot LimInclude properties </a> <small>The plot objects' XLimInclude, YLimInclude, ZLimInclude, ALimInclude and CLimInclude properties are an important feature, that has both functional and performance implications....</small></li>
<li><a href="https://undocumentedmatlab.com/articles/toolbar-button-labels" rel="bookmark" title="Toolbar button labels">Toolbar button labels </a> <small>GUI toolbar button labels can easily be set and customized using underlying Java components. ...</small></li>
<li><a href="https://undocumentedmatlab.com/articles/undocumented-button-highlighting" rel="bookmark" title="Undocumented button highlighting">Undocumented button highlighting </a> <small>Matlab button uicontrols can easily be highlighted by simply setting their Value property. ...</small></li>
<li><a href="https://undocumentedmatlab.com/articles/adding-custom-properties-to-gui-objects" rel="bookmark" title="Adding custom properties to GUI objects">Adding custom properties to GUI objects </a> <small>It is very easy to add custom user-defined properties and methods to GUI handles and Java references in Matlab. ...</small></li>
</ol>
</div>
]]></description>
										<content:encoded><![CDATA[<p>A couple of days ago, a reader of this blog has posted a comment asking for advise in enabling the user to dynamically set plot properties. While this can be done using the built-in <i><b>inspect</b></i> function, the reader correctly noted that this presents a list of numerous properties, most of which may not be very interesting for the casual user. So I wanted to use the opportunity to show an alternative mechanism that I have used in one of my applications and I think answers the need. It relies on a border-less button that is located right next to the plot axis origin, and when clicked, presents a simple plot line-style modification dialog window.<br />
We start by creating a simple Java button (a <code>com.mathworks.mwswing.MJButton</code> in this case) with the simple text &#8216;+&#8217;. The benefit of using <code>com.mathworks.mwswing.MJButton</code> rather than the standard <code>javax.swing.JButton</code>, which <code>MJButton</code> extends, is that <code>MJButton</code> added a <b>FlyOverAppearance</b> property to the standard <code>JButton</code>. This is a very handy feature that enables to present a border-less button, except upon mouse hove, in which case a shadow border is displayed. This is exactly the effect used to highlight toolbar buttons upon mouse hover. To emphasize the button&#8217;s action, we set a HAND_CURSOR cursor whenever the mouse hovers over the button.<br />
This button is then displayed onscreen using the built-in semi-documented <i><b>javacomponent</b></i> function, at the axes origin position. We set the button&#8217;s callback property to <i><b>uisetlineprops</b></i>, which was adapted from <a target="_blank" rel="nofollow" href="http://www.mathworks.cn/matlabcentral/fileexchange/14143-uisetlineprops">a File Exchange submission</a> by the same name:</p>
<pre lang='matlab'>
axesPos = get(hAxes,'pos');
btLinePropsCbStr = ['uisetlineprops(findall(' num2str(hAxes,99) ',''type'',''line''))'];
btLinePropsPos = [axesPos(1:2)+0.003,0.03,0.03];
% Note: all the following code is just to have a specific cursor
% ^^^^ (HAND_CURSOR) when hovering over the button...
btLineprops = com.mathworks.mwswing.MJButton('+');
btLineprops.setBorder([]);
btLineprops.setBackground(java.awt.Color.white);
btLineprops.setCursor(java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
btLineprops.setFlyOverAppearance(true);
btLineprops.setToolTipText('Modify properties of plot lines');
[dummy,btContainer] = javacomponent(btLineprops,[0 0 1 1],hFig); %#ok
set(btLineprops, 'ActionPerformedCallback',btLinePropsCbStr);
set(btContainer, 'Units','Norm', 'Position',btLinePropsPos);
 </pre>
<p><center><figure style="width: 415px" class="wp-caption aligncenter"><img decoding="async" alt="A borderless button used to modify plot properties" src="https://undocumentedmatlab.com/images/borderless_button_animated.gif" title="A borderless button used to modify plot properties" width="415" /><figcaption class="wp-caption-text">A borderless button used to modify plot properties</figcaption></figure></center><br />
The benefit of using this simple trick is that the &#8216;+&#8217; button is unobtrusive, and yet highly accessible. Of course, similar button can be used for a wide variety of callback functionalities, limited only by your imagination!</p>
<p>The post <a rel="nofollow" href="https://undocumentedmatlab.com/articles/borderless-button-used-for-plot-properties">Borderless button used for plot properties</a> appeared first on <a rel="nofollow" href="https://undocumentedmatlab.com">Undocumented Matlab</a>.</p>
<div class='yarpp-related-rss'>
<h3>Related posts:</h3><ol>
<li><a href="https://undocumentedmatlab.com/articles/plot-liminclude-properties" rel="bookmark" title="Plot LimInclude properties">Plot LimInclude properties </a> <small>The plot objects' XLimInclude, YLimInclude, ZLimInclude, ALimInclude and CLimInclude properties are an important feature, that has both functional and performance implications....</small></li>
<li><a href="https://undocumentedmatlab.com/articles/toolbar-button-labels" rel="bookmark" title="Toolbar button labels">Toolbar button labels </a> <small>GUI toolbar button labels can easily be set and customized using underlying Java components. ...</small></li>
<li><a href="https://undocumentedmatlab.com/articles/undocumented-button-highlighting" rel="bookmark" title="Undocumented button highlighting">Undocumented button highlighting </a> <small>Matlab button uicontrols can easily be highlighted by simply setting their Value property. ...</small></li>
<li><a href="https://undocumentedmatlab.com/articles/adding-custom-properties-to-gui-objects" rel="bookmark" title="Adding custom properties to GUI objects">Adding custom properties to GUI objects </a> <small>It is very easy to add custom user-defined properties and methods to GUI handles and Java references in Matlab. ...</small></li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://undocumentedmatlab.com/articles/borderless-button-used-for-plot-properties/feed</wfw:commentRss>
			<slash:comments>16</slash:comments>
		
		
			</item>
	</channel>
</rss>
