File Exchange

image thumbnail

BLOC - Automatic UML class diagram creator

version 1.0 (52.1 KB) by

Used to create a UML class diagram from a MATLAB object oriented program.

10 Downloads

Updated

View License

Directions: open up BLOC.m, run the script, then follow the direction on the GUI.

REQUEST: please let me know if you find any bug, or have any suggestion, much appreciated.

NOTE:
the current version only includes inheritance and composition relationship, will update with more relationship later.

Comments and Ratings (15)

Does not work. Even with only class m-files in the directory I open, I get the following error : Cell contents indices must be greater than 0

Error in UMLpanel/getinfo (line 942)
                    ischildof{ind{i}(j)}(end+1) = clssnmpar{i};

Error in UMLcreator>@(h,d)obj.Panel.getinfo (line 40)
                'position', [20 10 90
                60],'tag','Open','string','Open','callback',@(h,d)obj.Panel.getinfo);
 
Error while evaluating UIControl Callback

Undefined function or variable 'nodeList'.

Error in UMLpanel/gettier (line 22)
bottomnode = nodeList(bottomind);

Error in UMLpanel/runUML (line 16)
    gettier(obj);

Error in UMLcreator>@(h,d)obj.Panel.runUML (line 43)
                'tag','Start','string','Start','callback',@(h,d)obj.Panel.runUML);
 
Error while evaluating UIControl Callback

Geoffrey

BLOC
Index exceeds matrix dimensions.

Error in UMLpanel/getinfo (line 160)
                    line1{d} = fcontent{d}{1};
                    %read the first line of each file

Error in UMLcreator>@(h,d)obj.Panel.getinfo (line 40)
                'position', [20 10 90
                60],'tag','Open','string','Open','callback',@(h,d)obj.Panel.getinfo);
Error while evaluating UIControl Callback

Undefined function or variable 'nodeList'.

Error in UMLpanel/gettier (line 22)
bottomnode = nodeList(bottomind);

Error in UMLpanel/runUML (line 16)
    gettier(obj);

Error in UMLcreator>@(h,d)obj.Panel.runUML (line 43)
                'tag','Start','string','Start','callback',@(h,d)obj.Panel.runUML);
Error while evaluating UIControl Callback

Index exceeds matrix dimensions.

Error in UMLpanel/getinfo (line 782)
            obj.Propertylist = supList(:,4);
            %PANEL'S

Error in UMLcreator>@(h,d)obj.Panel.getinfo (line 40)
                'position', [20 10 90
                60],'tag','Open','string','Open','callback',@(h,d)obj.Panel.getinfo);
Error while evaluating UIControl Callback

Undefined function or variable 'nodeList'.

Error in UMLpanel/gettier (line 22)
bottomnode = nodeList(bottomind);

Error in UMLpanel/runUML (line 16)
    gettier(obj);

Error in UMLcreator>@(h,d)obj.Panel.runUML (line 43)
                'tag','Start','string','Start','callback',@(h,d)obj.Panel.runUML);
Error while evaluating UIControl Callback

Works fine with MATLAB R2016a. It is important that in the chosen folder there are m-file classes. Any MATLAB script in this folder may disturb work of the BLOC tool.

sz

sz (view profile)

tried to run but got the following error message

Undefined function or variable "nodeList".

Assignment has more non-singleton rhs dimensions than non-singleton
subscripts

Error in UMLpanel/getinfo (line 243)
            supList(:,2) = Supname;

Error in UMLcreator>@(h,d)obj.Panel.getinfo (line 40)
                'position', [20 10 90
                60],'tag','Open','string','Open','callback',@(h,d)obj.Panel.getinfo);
 
Error while evaluating uicontrol Callback

Gerloi

Gerloi (view profile)

BLOC
Operands to the || and && operators
must be convertible to logical scalar
values.

Error in UMLpanel/getinfo (line 196)
                    if B{i} ~= 0 &&
                    ~isempty(B{i})

Error in
UMLcreator>@(h,d)obj.Panel.getinfo
(line 40)
                'position', [20 10 90
                60],'tag','Open','string','Open','callback',@(h,d)obj.Panel.getinfo);
Error while evaluating uicontrol Callback

Undefined variable or function
nodeList might refer to the function
nodelist.

Error in UMLpanel/gettier (line 22)
bottomnode = nodeList(bottomind);

Error in UMLpanel/runUML (line 16)
    gettier(obj);

Error in
UMLcreator>@(h,d)obj.Panel.runUML
(line 43)
                'tag','Start','string','Start','callback',@(h,d)obj.Panel.runUML);
Error while evaluating uicontrol Callback

student

i'm getting this as error what should i do
"Assignment has more non-singleton rhs dimensions than non-singleton
subscripts"

Tim

Tim (view profile)

Tim

Tim (view profile)

Good work, this saves a lot of time when not having to draw UML diagrams manually.

I have a small wishlist:
- Ability to search in multiple folders and subfolders.
- Maybe something like movable arrows to prevent overlap of arrow ends. When arrow ends overlap, it is not clear which end belongs to which relationship.

Are you still working on this project?

very interesting work...but as you are in development, it seems not to be robust enough.
my feeback :

I have the same bug of Tarek. I have tried to modify your code by putting some piece of code :
   compos1 = Compos(TipPos,TailPos);
   patch(compos1.Shape{1},compos1.Shape{2},'k');
   %create tirangles and diamonds
   patch(compos1.Shape{3},compos1.Shape{4},'k');
inside one of your for block (at line 206).

After that I had another bug :

??? Subscript indices must either be real positive integers or logicals.

Error in ==> UMLpanel.getinfo at 942
                    ischildof{ind{i}(j)}(end+1) = clssnmpar{i};

then I just add a test on the value return by ind{i}(j)

Thinh

Thinh (view profile)

This work is undergoing construction, it is inevitable that there are some (or a lot of) errors in it, thanks for letting me know, I will try and work on it ^^.

Tarek

Tarek (view profile)

Great work, but i had a problem.
??? Undefined function or variable "TipPos".

Error in ==> UMLpanel.runUML at 209
                    compos1 = Compos(TipPos,TailPos);

Error in ==> UMLcreator>@(h,d)obj.Panel.runUML at 43
                'tag','Start','string','Start','callback',@(h,d)obj.Panel.runUML);
 
??? Error while evaluating uicontrol Callback

??? Error using ==> UMLpanel.runUML>arrow_scrolling
Too many input arguments.
 
??? Error while evaluating figure KeyPressFcn

Thinh

Thinh (view profile)

Thx mark, i'll try and work on it.

Mark Mikofski

Mark Mikofski (view profile)

This looks great, but I think some bugs still need to be worked out. I think a lot of people will be very happy when you get this working! Try regexpressions to look for variations of class names instead of ([' ' clsslist{k}]) and (['=' clsslist{k}]), etc. which takes a lot of space and limits the number of variations you can search for.

MATLAB Release
MATLAB 7.9 (R2009b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video