www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/+cageview/+project/Summary.m

    classdef Summary < mbcgui.multiview.View
    %Summary  project summary
    
    %  Copyright 2016-2016 The MathWorks, Inc. 

    properties (SetAccess=private)
        %ListView listview for project summary
        ListView
    end
    
    methods
        function obj = Summary(varargin)
        %Summary constructor
        obj@mbcgui.multiview.View(varargin{:})
        create(obj)
        end
        
        function update(obj)
        %update update summary list
        
        p = get(cgbrowser,'RootNode');
        if ~isempty(p)
            CGP = info(p);
            A = getConnections(CGP);
            
            % models, tables, optimization, tradeoff, feature, dataset
            tblData = {'Models', length(find(A,'Type','Model'))
                'Tables',length(find(A,'Type','Table'))
                'Optimization',length(find(A,'Type','Optimization'))
                'Tradeoff',length(find(A,'Type','Tradeoff'))
                'Feature',length(find(A,'Type','Feature'))
                'Datasets',length(find(A,'Type','Dataset'))};
            Icons = { iconfile(xregstatsmodel)
                'cgfulltable.bmp'
                iconfile(cgoptim)
                'cgfulltradeoff.bmp'
                'cgfullfeature.bmp'
                iconfile(cgoppoint) };
            
            obj.ListView.setData(tblData,Icons)
        end
        
        end
    end
    
    methods (Access=private)
        function create(obj)
        %create create summary view
        
        pnl = mbcgui.container.titlebarpanel('Parent',obj.Parent,...
            'BarTitle','Project Summary');
        
        obj.ListView = mbcwidgets.List('Parent',pnl,...
            'IconLocation',cgrespath,...
            'ColumnHeaders',{'Type','Number'},...
            'Tag','ProjectSummary',...
            'ColumnWidths',[180 50]);
        pnl.ContentHandle = obj.ListView;
        
        obj.ContentHandle = pnl;
        
        end
        
    end
    
end