Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
JavaFrame being deprecated in future release

Subject: JavaFrame being deprecated in future release

From: Matthew Whitaker

Date: 11 Mar, 2009 23:09:01

Message: 1 of 3

Hello,

I just updated from R2006b to R2009a. I have some critical functions in my code that rely on being able to interact with the underlying Java API for handle graphics objects.

I see that the Mathworks folks have decided to start warning that the JavaFrame property of the figure object is going to be obsoleted in a future release. I gave them my feedback at their site but I'm interested in who else out there will be greatly inconvenienced by this. Also does anyone have any insight into any replacements for this.

I do realize that it is an undocumented feature and can change any time (so I need no lectures on that) but when there still is not a built in method (as far as I can see) to maximize and minimize figures (see setWindowState and setWindowOnTop in FEX) I still see a need to be able to get at this stuff.

There are a whole host of features and properties of the underlying Java objects that the JavaFrame gives you a hook into. They are not for the newbie but when you are developing deployed commercial apps they can be a life saver.

I'm interested in any comments on this

Matt W.

Subject: JavaFrame being deprecated in future release

From: Yair Altman

Date: 12 Mar, 2009 06:35:05

Message: 2 of 3

"Matthew Whitaker" <mattlwhitaker@REMOVEgmail.com> wrote in message <gp9gad$sle$1@fred.mathworks.com>...
> Hello,
>
> I just updated from R2006b to R2009a. I have some critical functions in my code that rely on being able to interact with the underlying Java API for handle graphics objects.
>
> I see that the Mathworks folks have decided to start warning that the JavaFrame property of the figure object is going to be obsoleted in a future release. I gave them my feedback at their site but I'm interested in who else out there will be greatly inconvenienced by this. Also does anyone have any insight into any replacements for this.
>
> I do realize that it is an undocumented feature and can change any time (so I need no lectures on that) but when there still is not a built in method (as far as I can see) to maximize and minimize figures (see setWindowState and setWindowOnTop in FEX) I still see a need to be able to get at this stuff.
>
> There are a whole host of features and properties of the underlying Java objects that the JavaFrame gives you a hook into. They are not for the newbie but when you are developing deployed commercial apps they can be a life saver.
>
> I'm interested in any comments on this
>
> Matt W.

I believe the warning started in 2008a or 2008b and I too have been much inconvenienced with it. There are several important features that can only be done using the underlying Java objects, and (at least today) these can only be accessed via the figure's JavaFrame property.

Another example to the one you gave is setting some unexposed properties of uicontrols like continuous slider movement callbacks, editbox typing callbacks, focus gained/lost callbacks (for a nice rollover/highlighting effect) etc. If TMW plan to enable direct access to the Java controls via their HG container then ok, but if that does not happen then it would be cause shameful degradation in Matlab GUI effectiveness.

There are several workaround that you could use even then. I won't post them here (I don't want to give TMW any bad ideas...), but if and when the crisis does arrive I will surely post and try my best to scream them out loud wherever I can.

Until then, simply turn the warning off by:
warning off MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame

Yair Altman
http://Undocumented-Matlab.com (one of the places where I'll post...)

Subject: JavaFrame being deprecated in future release

From: Qun HAN

Date: 13 Jun, 2009 04:28:01

Message: 3 of 3

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <gpaaep$ard$1@fred.mathworks.com>...
> "Matthew Whitaker" <mattlwhitaker@REMOVEgmail.com> wrote in message <gp9gad$sle$1@fred.mathworks.com>...
> > Hello,
> >
> > I just updated from R2006b to R2009a. I have some critical functions in my code that rely on being able to interact with the underlying Java API for handle graphics objects.
> >
> > I see that the Mathworks folks have decided to start warning that the JavaFrame property of the figure object is going to be obsoleted in a future release. I gave them my feedback at their site but I'm interested in who else out there will be greatly inconvenienced by this. Also does anyone have any insight into any replacements for this.
> >
> > I do realize that it is an undocumented feature and can change any time (so I need no lectures on that) but when there still is not a built in method (as far as I can see) to maximize and minimize figures (see setWindowState and setWindowOnTop in FEX) I still see a need to be able to get at this stuff.
> >
> > There are a whole host of features and properties of the underlying Java objects that the JavaFrame gives you a hook into. They are not for the newbie but when you are developing deployed commercial apps they can be a life saver.
> >
> > I'm interested in any comments on this
> >
> > Matt W.
>
> I believe the warning started in 2008a or 2008b and I too have been much inconvenienced with it. There are several important features that can only be done using the underlying Java objects, and (at least today) these can only be accessed via the figure's JavaFrame property.
>
> Another example to the one you gave is setting some unexposed properties of uicontrols like continuous slider movement callbacks, editbox typing callbacks, focus gained/lost callbacks (for a nice rollover/highlighting effect) etc. If TMW plan to enable direct access to the Java controls via their HG container then ok, but if that does not happen then it would be cause shameful degradation in Matlab GUI effectiveness.
>
> There are several workaround that you could use even then. I won't post them here (I don't want to give TMW any bad ideas...), but if and when the crisis does arrive I will surely post and try my best to scream them out loud wherever I can.
>
> Until then, simply turn the warning off by:
> warning off MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame
>
> Yair Altman
> http://Undocumented-Matlab.com (one of the places where I'll post...)

I have tried to get the JavaFrame another way(inspired by Yair). But till now I can only get a com.mathworks.hg.peer.FigureFrameProxy$FigureFrame object insted of the com.mathworks.hg.peer.FigurePeer object from get(hfig,'JavaFrame'). But with this object I can setAlwaysOnTop,setMaximized,setMinimized, etc. just like I usually do with the obsoleting JavaFrame object.

Vist http://cid-909609e321d6e37a.skydrive.live.com/self.aspx/.Public/getJFrame.m for the detailed code.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us