5.0

5.0 | 2 ratings Rate this file 3 Downloads (last 30 days) File Size: 12.6 KB File ID: #4010
image thumbnail

DOTNOT - Dot Notation

by

 

26 Sep 2003 (Updated )

Implements a replacement interface to GET/SET for graphic/gui options.

| Watch this File

File Information
Description

DOTNOT - "Dot Notation" toolbox to replace set/get with simpler syntax.
 
This Toolbox implements a replacement to the calls set/get that make your code easier write and understand. Especially if you write GUIs and advanced plots. The main intention is to show how this kind of notation can look in MATLAB rather than making a proper implementation.
 
What do you think? I will not give any support on this BetaBetaDemoVersion ;-)Some one interested in turning this to a real implementation? Take it!
 
First of all before using this: "addpath" to the .../dotnot/ folder!!!
 
 
====I will explain the differens with some examples===
 
 
Move mouse pointer 10 pixels to the right, Classic and dotnot examples:
 
    set(0,'PointerLocation',get(0,'PointerLocation')+[0 10]);
   
    Root.PointerLocation=Root.PointerLocation + [10 0]
 
 
 
  Move poiner to middle of screen,, Classic and dotnot examples:
 
    si=get(0,'ScreenSize');
    set(0,'PointerLocation',si(3:4)/2);
   
    Root.PointerLocation=Root.ScreenSize(3:4)/2;
 
 
  'Root' corresponds to handle 0 in MATLAB. In this toolbox you must create a 'dotnot' object of the handle first before using 'dotnot' notation. If MathWorks implemented it they could easily make things much better than I can. For example could they make 'Root' to a "auto global" object without need of creating it in every function/workspace. You create a handle object with the object constructor:
       
  Root=dotnot(0); % Its good to always create the Root object.
  dotnot % Or do the same with this syntax.
  Fig123=dotnot(1,2,3); % Create one handle to figure 1, 2 and 3.
 
 
  Root.Children.Color='Green'; % Change color of all figures.
 
  Fig123.Color='Green'; % Change color of figure 1 2 and 3
 
  posmtx=Fig123.vcat.Position % Get nice array of all window position.
  Fig123.Position(4)=160 % Change width of all three figures.
  Fig123.delete; % Delete all windows.
 
  Fig=Root.fig('Test window'); % Open new window and create dotnot object.
  plot(sin(0:0.1:5))
  Fig.findobj('Type','Line').LineWidth=2 %Change all lines to thick.
 
  Root.fig('New')=gca; % Copy axis a new window.
  Root.self=Fig; % Create a copy of figure to Root
 
  Root.Children.delete
 
 
  As you can se I have inserted some functions in the tree-structure
  objects and it setting. This function can be powerfull to copy
  objects, or open a new window.
 
 
(C) 2003 Peter Rydes├Ąter, GPL License, se License file from GNU.

MATLAB release MATLAB 6.5 (R13)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
12 Aug 2011 Diederick

This is indeed a really good idea, and the example in the image thumbnail is very impressive, turning findobj into a selector! Hope this is picked up by Mathworks, it would also make programming publication quality figures much easier. And with a buildin class to provide such support, it would be very easy to use and no problem at all to use concurrently with the old style get/set

21 Dec 2010 Joao Henriques

(Ok the first comment I was referring to was deleted, probably by a MW moderator. I'm posting this so no one thinks I'm talking about Joerg's comment, which is the first one now.)

20 Dec 2010 Joao Henriques

The first comment/rating looks like it was made by a cat stepping on a keyboard! ;) Bad kitty...

This is an excellent idea and I wish MW would take a look at it, it makes so much sense. It saddens me that it's not being actively maintained.

Anyway, the code could use some more comments, and I'm sure there's a smart way of using FEVAL and friends to replace many of the hardcoded function calls in SUBSREF. Still, this small piece of code already makes GUI code much more readable. I hope the author or someone else picks this up and it regains some interest by the community!

19 May 2010 Christoffer

Quite neat, if implemented it would quickly save a few lines in my GUI's.

23 Jul 2009 Francisco Balzarotti

This seems really useful.. I'm going to try it out

18 Jun 2009 Joerg Bretschneider

This seems to be a fine idea, I wonder why nobody has commented so far. I guess the problem is portability of code using this class, the class dotnot must always be delivered, dependencies evolve which restrict usage.
Seems to require deep understanding of the handle graphics package, so this may be another obstacle.
Did The Mathworks relate to this so far? Maybe you should contact them directly

Contact us