Code covered by the BSD License  

Highlights from
blurFigure - blurs and prevents interaction on a figure window

5.0

5.0 | 1 rating Rate this file 17 Downloads (last 30 days) File Size: 5.38 KB File ID: #30666
image thumbnail

blurFigure - blurs and prevents interaction on a figure window

by Yair Altman

 

07 Mar 2011 (Updated 13 Oct 2011)

blurs a specified figure window and prevents interaction with it until the figure is un-blurred

| Watch this File

File Information
Description

Syntax:
     hFigBlur = blurFigure(hFig, state)
 
  
Description:
     blurFigure(hFig) blurs figure hFig and prevents interaction with it. The only interaction possible is with user-created controls on the blurring panel (see below).
 
     hFigBlur = blurFigure(hFig) returns the overlaid blurred figure pane. This is useful to present a progress bar or other GUI controls, for user interaction during the blur phase.
 
     blurFigure(hFig,STATE) sets the blur status of figure hFig to STATE, where state is 'on','off',true or false (default='on'/true).
 
     blurFigure(hFig,'on') or blurFigure(hFig,true) is the same as: blurFigure(hFig).
 
     blurFigure(hFig,'off') or blurFigure(hFig,false) is the same as: close(hFigBlur).
 
     blurFigure('demo') displays a simple demo of the blurring (see attached screenshot).
 
  
Input parameters: (all parameters are optional)
 
     hFig - (default=gcf) Handle(s) of the modified figure(s). If component handle(s) is/are specified, then the containing figure(s) will be inferred and used.
 
     state - (default='on'/true) blurring flag: 'on','off',true or false
 
  
Examples:
     hFigBlur = blurFigure(hFig); % blur hFig (alternative #1)
     hFigBlur = blurFigure(hFig,true); % blur hFig (alternative #2)
 
     hFigBlur = blurFigure(hFig,false); % un-blur hFig (alternative #1)
     hFigBlur = blurFigure(hFig,'off'); % un-blur hFig (alternative #2)
     close(hFigBlur); % un-blur hFig (alternative #3)
     delete(hFigBlur); % un-blur hFig (alternative #4)
 
     blurFigure('demo'); % blur demo with progress bar etc.
 
  
Technical Description:
     http://UndocumentedMatlab.com/blog/blurred-matlab-figure-window

Bugs and suggestions:
     Please send to Yair Altman (altmany at gmail dot com)
 
  
Warning:
     This code heavily relies on undocumented and unsupported Matlab functionality. It works on Matlab 7.9 (R2009b) and higher, but use at your own risk!

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
GetJFrame - Retrieves a figure's underlying Java frame, enable/disable figure, setFigTransparency - set figure transparency / fading

MATLAB release MATLAB 7.11 (2010b)
Other requirements Matlab 7.9 (R2009b) and higher (or a retrofit of JRE 1.6.0_10 and higher in any previous Matlab release)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (7)
08 Mar 2011 Jan Simon

What is a "retrofit of JRE 1.6.0_10"?

09 Mar 2011 Yair Altman

@Jan - a retrofit of JRE means installing JRE 1.6.0_10 (also called "Java 6 update 10"), or any later version (e.g., the latest available version today is 1.6 update 24). The JRE can be downloaded from http://java.com/en/download/manual.jsp and you can configure Matlab to use it according to the instructions in http://www.mathworks.com/support/solutions/en/data/1-1812J/

All of this is only necessary in Matlab releases R2009a (7.8) and earlier, which pre-bundle an earlier JRE version that does not support window frame transparency/opacity used in this submission.

Matlab R2009b (7.9) and onward, at least on Microsoft Windows, pre-bundle a JRE version that does support transparency/opacity and so do not require a retrofit.

06 Apr 2011 Matthew Whitaker

Hi Yair,
Very nice utility. Why not add a parameter to allow the user to set the opacity instead of just fixing it at 0.8?
Matt W

22 Apr 2011 Patrick Lee

good sfuff O(∩_∩)O

13 Oct 2011 Charles

This is exactly what I need. However, it does not work for me. I am using 2011b, which may be the problem. Here is the error I get:

Error using blurFigure (line 135)
Cannot retrieve the Java Frame reference for figure 190.0016

Error in mirror>characterize_Callback (line 3356)
blurFigure(hObject, true)

Error in gui_mainfcn (line 96)
        feval(varargin{:});

Error in mirror (line 43)
    gui_mainfcn(gui_State, varargin{:});

Error in
guidemfile/@(hObject,eventdata)mirror('characterize_Callback',hObject,eventdata,guidata(hObject))

 
Error while evaluating uicontrol Callback

Any ideas?

thanks
Chuck

13 Oct 2011 Yair Altman

@Charles - I uploaded a fix for R2011b. It should be available here shortly (maybe tomorrow)

14 Oct 2011 Charles

OK, I'll keep an eye out for it, don't see it yet. Thanks for the quick response.

Chuck

Please login to add a comment or rating.
Updates
08 Mar 2011

Fixed the demo code

13 Oct 2011

Fix for R2011a; fixed description;

Tag Activity for this File
Tag Applied By Date/Time
gui Yair Altman 08 Mar 2011 10:45:16
java Yair Altman 08 Mar 2011 10:45:16
undocumented Yair Altman 08 Mar 2011 10:45:16

Contact us at files@mathworks.com