www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/+xregdesgui/ViewerList.m

    classdef ViewerList < mbcgui.multiview.ViewList
%xregdesgui.ViewerList class
%   xregdesgui.ViewerList extends mbcgui.multiview.ViewList.
%
%    xregdesgui.ViewerList properties:
%       ConstructorFcns - Property is of type 'MATLAB array' (read only) 
%       Labels - Property is of type 'MATLAB array' (read only) 
%       IconFiles - Property is of type 'MATLAB array' (read only) 
%       Descriptions - Property is of type 'MATLAB array' (read only) 
%       MaxRecommended - Property is of type 'MATLAB array' (read only) 
%
%    xregdesgui.ViewerList methods:
%       isViewAvailable - Check whether a view is available

%  Copyright 2015 The MathWorks, Inc. and Ford Global Technologies, Inc.

    methods  % constructor block
        function obj = ViewerList
        %VIEWERLIST Constructor for viewerlist object
        %  OBJ = VIEWERLIST creates a new viewerlist object.  This object contains
        %  the information that defines which views are available in the design
        %  editor.
        
        % obj = mbcgui.multiview.ViewList;
        obj@mbcgui.multiview.ViewList(...
            {@xregdesgui.DesignTable, @xregdesgui.DesignView1d, @xregdesgui.DesignView2d, @xregdesgui.DesignView3d, @xregdesgui.DesignView4d, @xregdesgui.PairwiseProj, @xregdesgui.ConView2d, @xregdesgui.ConView3d, @xregdesgui.ModelView}, ...
            {'Design &Table', '&1D Design Projection', '&2D Design Projection', '&3D Design Projection', '&4D Design Projection', '&Pairwise Design Projections', '2D &Constraints', '3D C&onstraints', '&Model Description'}, ...
            {xregrespath('viewTable.bmp') xregrespath('1dscatter.bmp') xregrespath('scatter.bmp') xregrespath('3dscatter.bmp') xregrespath('4dscatter.bmp') xregrespath('scatterPairwise.bmp') xregrespath('bdry.bmp' ) xregrespath('bdry3Dgraph.bmp') xregrespath('viewCube.bmp')},...
            {'Table of design points', '1D projection plot', '2D projection plot', '3D projection plot', '4D projection plot', 'Pairwise projection plots', '2D slice of constraints', '3D slice of constraints', 'Model description pane'},...
            [ 1, inf, inf, inf, inf, 1, inf, inf, 1]); % converted super class constructor call
        end  % ViewerList
        
    end  % constructor block

    methods  % public methods
        %----------------------------------------
       function ret = isViewAvailable(obj, MS, Index)
       %ISVIEWAVAILABLE Check whether a view is available
       %  ISVIEWAVAILABLE(OBJ, MS, INDEX) returns true if a view should be allowed
       %  to be made at the present time.  MS must be a handle to the
       %  MessageService that the view will be displaying data from.
       %
       %  ISVIEWAVAILABLE(OBJ, MS) returns a logical vector containing an entry
       %  for each view that is defined.
       
       BaseViewMinFact = [1 1 2 3 4 2 2 3 1];
       nBase = 9;
       if MS.hasData
           nf = nfactors(MS.getdesign);
       else
           nf = 0;
       end
       
       if nargin<3
           ret = true(1, obj.numViews);
           ret(1:nBase) = (nf>=BaseViewMinFact);
       else
           ret = true(size(Index));
           ret(Index<=nBase) = (nf>=BaseViewMinFact(Index(Index<=nBase)));
       end
       
       end  % isViewAvailable
       
end  % public methods 

end  % classdef