BLOC - Automatic UML class diagram creator

by

 

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

UMLcreator
classdef UMLcreator < handle
    properties
        Panel;
    end
    methods
        function obj = UMLcreator()
            obj.Panel = UMLpanel;
        end        
        
        function UMLstart(obj)
            set(0,'units','pixel');
            p = get(0,'screensize');
            
            loading = figure('units','pixel','position',...
                [(p(3)-300)/2 (p(4)-400)/2 300 400],'color','w',...
                'menubar','none','resize','off','name','BLOC',...
                'numbertitle','off','interruptible','off','busyaction','cancel','color','white');
                
            img = imread('BLOC.png');
            pic = image(img);
            axis off
            axis image
% 
            % fade in / fade out
            for k = [0:0.01:1,ones(1,25),1:-0.01:0,zeros(1,10)]
                pause(0.02);
                set(pic,'alphadata',k);
            end
            
            delete(loading);
            
            f = figure('Name','BLOC','numbertitle','off','menubar','none',...
                'units','pixel','position',[(p(3)-300)/2 (p(4)-400)/2 300 400],'resize','off');
            panel1 = uipanel('parent',f,'units','pixel','position',[0 100 300 300]);
%             panel2 = uipanel('parent',f,'units','pixel','position',[0 80 300 50]);
            panel3 = uipanel('parent',f,'units','pixel','position',[0 0 300 100]);
            
            
            getd = uicontrol('parent',panel3,'style', 'pushbutton','units','pixel',...
                'position', [20 10 90 60],'tag','Open','string','Open','callback',@(h,d)obj.Panel.getinfo);
     
            run = uicontrol('parent',panel3,'position',[130 10 150 60],'style', 'pushbutton',...
                'tag','Start','string','Start','callback',@(h,d)obj.Panel.runUML);
            direction = [{'     1. All of your code files should be in one folder'} {''}...
                {'     2. Click "Open" to choose the immediate directory of your code'} {''}...
                {'     3. If you want to change the directory, click "Open" again'} {''}...
                {'     4. Click "Start" to generate the UML class diagram of your code'} {''}...
                {'     5. To create another diagram, repeat the process'}];
            text = uicontrol('parent',panel1,'style','text','horizontalalignment','left','fontsize',10.2,'position',[0 0 300 235],'string',direction);
            text = uicontrol('parent',panel1,'style','text','horizontalalignment','left',...
                'fontsize',12,'fontweight','bold','position',[0 250 300 20],'string','Directions:');
        
            addlistener(obj.Panel,'NoDirSelected',@(h,d)obj.Panel.Nodir);
            addlistener(obj.Panel,'NoDirSelected',@(h,d)obj.Panel.Nodir);
        
        end
        
        
    end
    

    
end

Contact us