<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247172</link>
    <title>MATLAB Central Newsreader - Creating subclass of MATLAB graphical object(class?)?</title>
    <description>Feed for thread: Creating subclass of MATLAB graphical object(class?)?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 20 Mar 2009 21:32:01 -0400</pubDate>
      <title>Creating subclass of MATLAB graphical object(class?)?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247172#636533</link>
      <author>Kesh </author>
      <description>Does anyone here know whether it is possible (if so, how) to create a MATLAB class that is a subclass of one of graphical objects? For instance,&lt;br&gt;
&lt;br&gt;
classdef arc &amp;lt; line&lt;br&gt;
...&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
to define a subclass of line and its object to be drawn in an axes.&lt;br&gt;
&lt;br&gt;
I was hoping the above syntax to work, but apparently &quot;line&quot; is not a class (no constructor available) although if you evaluate &quot;class(handle(line))&quot; returns &quot;line&quot;&lt;br&gt;
&lt;br&gt;
Does anybody here have any ideas to realize this idea?&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Kesh</description>
    </item>
    <item>
      <pubDate>Sat, 21 Mar 2009 15:22:01 -0400</pubDate>
      <title>Re: Creating subclass of MATLAB graphical object(class?)?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247172#636622</link>
      <author>per isakson</author>
      <description>&quot;Kesh &quot; &amp;lt;tikuma@hotmail.removethis.com&amp;gt; wrote in message &amp;lt;gq120h$ckq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Does anyone here know whether it is possible (if so, how) to create a MATLAB class that is a subclass of one of graphical objects? For instance,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; classdef arc &amp;lt; line&lt;br&gt;
&amp;gt; ...&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; to define a subclass of line and its object to be drawn in an axes.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I was hoping the above syntax to work, but apparently &quot;line&quot; is not a class (no constructor available) although if you evaluate &quot;class(handle(line))&quot; returns &quot;line&quot;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Does anybody here have any ideas to realize this idea?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt; Kesh&lt;br&gt;
&lt;br&gt;
I'm pretty sure that&lt;br&gt;
1. there is no documented way to do it &lt;br&gt;
2. the idea (or close) can be realized with a classes that have handle graphic objects as properies.&lt;br&gt;
&lt;br&gt;
/per</description>
    </item>
    <item>
      <pubDate>Sat, 21 Mar 2009 17:38:01 -0400</pubDate>
      <title>Re: Creating subclass of MATLAB graphical object(class?)?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247172#636640</link>
      <author>Kesh </author>
      <description>&amp;gt; &amp;gt; Does anyone here know whether it is possible (if so, how) to create a MATLAB class that is a subclass of one of graphical objects? For instance,&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; classdef arc &amp;lt; line&lt;br&gt;
&amp;gt; &amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; to define a subclass of line and its object to be drawn in an axes.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I was hoping the above syntax to work, but apparently &quot;line&quot; is not a class (no constructor available) although if you evaluate &quot;class(handle(line))&quot; returns &quot;line&quot;&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Does anybody here have any ideas to realize this idea?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I'm pretty sure that&lt;br&gt;
&amp;gt; 1. there is no documented way to do it &lt;br&gt;
&amp;gt; 2. the idea (or close) can be realized with a classes that have handle graphic objects as properies.&lt;br&gt;
&lt;br&gt;
Yeah, that's what I was afraid of. I knew of (1) as I've done a quite bit of reading and searching for the possibilities. I will try to use handle (actually, hgsetget) class as its superclass as suggested in (2). &lt;br&gt;
&lt;br&gt;
What I want is in two folds:&lt;br&gt;
1. The object of the derived arc class can be appended to the axes object's Children list, and&lt;br&gt;
2. Parent object of the associated line object to be reassigned from the axes to the object of the derived arc class.&lt;br&gt;
&lt;br&gt;
If any of the roaming Mathworks staff has inside info on this, I'd love to know if there is a hidden solution to this problem.&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
Kesh</description>
    </item>
    <item>
      <pubDate>Mon, 23 Mar 2009 19:26:26 -0400</pubDate>
      <title>Re: Creating subclass of MATLAB graphical object(class?)?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/247172#637048</link>
      <author>bradphelan</author>
      <description>On Mar 21, 6:38 pm, &quot;Kesh &quot; &amp;lt;tik...@hotmail.removethis.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Does anyone here know whether it is possible (if so, how) to create aMATLABclass that is asubclassof one of graphical objects? For instance,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; classdef arc &amp;lt; line&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; ...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; to define asubclassof line and its object to be drawn in an axes.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I was hoping the above syntax to work, but apparently &quot;line&quot; is not a class (no constructor available) although if you evaluate &quot;class(handle(line))&quot; returns &quot;line&quot;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Does anybody here have any ideas to realize this idea?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I'm pretty sure that&lt;br&gt;
&amp;gt; &amp;gt; 1. there is no documented way to do it&lt;br&gt;
&amp;gt; &amp;gt; 2. the idea (or close) can be realized with a classes that have handle graphic objects as properies.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Yeah, that's what I was afraid of. I knew of (1) as I've done a quite bit of reading and searching for the possibilities. I will try to use handle (actually, hgsetget) class as its superclass as suggested in (2).&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; What I want is in two folds:&lt;br&gt;
&amp;gt; 1. The object of the derived arc class can be appended to the axes object's Children list, and&lt;br&gt;
&amp;gt; 2. Parent object of the associated line object to be reassigned from the axes to the object of the derived arc class.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; If any of the roaming Mathworks staff has inside info on this, I'd love to know if there is a hidden solution to this problem.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thanks,&lt;br&gt;
&amp;gt; Kesh&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I don't come past CSSM too often these days ( hi Per ),&lt;br&gt;
&lt;br&gt;
I think it will work but you just need to use the package prefix 'hg'&lt;br&gt;
for all your handle graphics&lt;br&gt;
base classes. See the following code snippet ripped from the file&lt;br&gt;
exchange. It doesn't do&lt;br&gt;
what you want but gives away the names that Mathworks uses for the&lt;br&gt;
handle graphics&lt;br&gt;
classes. It still might not work though. I don't have a copy of Matlab&lt;br&gt;
handy to test it&lt;br&gt;
out. Let us know how it goes.&lt;br&gt;
&lt;br&gt;
From&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/19877?controller=file_infos&amp;download=true&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/19877?controller=file_infos&amp;download=true&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
----&lt;br&gt;
&lt;br&gt;
% Ensure hObj is valid target&lt;br&gt;
handleObj = handle(hObj);&lt;br&gt;
if ~ishandle(hObj)&lt;br&gt;
&amp;nbsp;&amp;nbsp;error('MAKEDATATIP:InvalidHandle',...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'HOBJ is an invalid handle object.');&lt;br&gt;
elseif ~isa(handleObj,'hg.surface') &amp;&amp;...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;~isa(handleObj,'hg.patch') &amp;&amp;...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;~isa(handleObj,'hg.line') &amp;&amp;...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;~isa(handleObj,'hg.image')&lt;br&gt;
&amp;nbsp;&amp;nbsp;error('MAKEDATATIP:InvalidObjectType',...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'Objects of class ''%s'' are not a valid targets for&lt;br&gt;
datatips.',...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;class(handleObj));&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
--&lt;br&gt;
&lt;br&gt;
Brad Phelan&lt;br&gt;
&lt;a href=&quot;http://xtargets.com&quot;&gt;http://xtargets.com&lt;/a&gt;</description>
    </item>
  </channel>
</rss>

