Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Front to back positioning in GUI
Date: Wed, 16 Dec 2009 22:47:05 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 21
Message-ID: <hgbo19$q9i$1@fred.mathworks.com>
References: <hgb1ha$39l$1@fred.mathworks.com> <hgb3dd$6i7$1@fred.mathworks.com> <hgb50c$kkl$1@fred.mathworks.com> <hgb677$9dv$1@fred.mathworks.com> <hgbavo$ifd$1@fred.mathworks.com> <hgbe6a$gp1$1@fred.mathworks.com> <hgbm5d$rvm$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1261003625 26930 172.30.248.35 (16 Dec 2009 22:47:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 16 Dec 2009 22:47:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:593259

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message <hgbm5d$rvm$1@fred.mathworks.com>...
> "Matt Fig" <spamanon@yahoo.com> wrote in message 
> [snip]
> > There might be a way to set the objects to transparent using JAVA, but I think I will leave that one to Yair Altman.  
> > 
> > Calling Yair Altman!
> 
> 
> Unfortunately, Matlab uicontrols are encased within heavyweight java.awt.Panel containers, which cannot be made transparent. I don't know why MathWorks chose to use heavyweight Panels instead of lightweight javax.swing.JPanels that would have enabled transparent controls and used less resources. I have suggested this improvement a year or two ago to the relevant people, but received no feedback. Maybe the reason is that when Java-based figures were first developed a decade ago, Swing was not yet available, and today nobody really wants to touch this code ("don't fix it if it ain't broke...").
> 
> A more technical description: http://java.sun.com/products/jfc/tsc/articles/mixing/index.html
> 
> BTW, this is also the reason uicontrols always appear on top of axes, regardless of their Java z-order or Matlab stack order. It is also the reason Matlab controls are all Java Peers instead of regular Swing components.
> 
> Yair Altman
> http://UndocumentedMatlab.com


Strike the sentence about uicontrols always appearing on top of axes because of the lightweight/heavyweight issue - it's not exactly correct: axes also use an opaque AxisCanvas and you can actually hide uicontrols beneath axes if you switch their parent containers' z-order. Sorry if this addendum doesn't clarify things - sometimes an attempt to simplify and be concise causes inadvertent inaccuracies.

Yair