www.gusucode.com > mbcview 工具箱matlab源码程序 > mbcview/@cgtradeoffgui/@listCentricUI/changeTradeoff.m

    function changeTradeoff(obj, pTO, pTbl)
%CHANGETRADEOFF Switch tradeoff being viewed
%
%  CHANGETRADEOFF(OBJ, PTO, PT) changes the display to show the given
%  tradeoff and the given table within this tradeoff.

%  Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc.


hTO = pTO.info;
if numPoints(hTO)>0
    obj.MessageService.setTradeoff(pTO, pTbl, 'list', 1);
else
    obj.MessageService.setTradeoff(pTO, pTbl, 'list', 0);
end

% Check the appropriate items in the view menu
if ~isempty(obj.ViewMenu)
    checks = {'off';'off';'off'};
    if getGraphError(hTO)
        checks{1} = 'on';
    end
    if getGraphSameY(hTO)
        checks{2} = 'on';
    end
    if getGraphConstraints(hTO)
        checks{3} = 'on';
    end
    set([obj.DisplayErrorMenu; obj.DisplayCommonYMenu; obj.DisplayConstraintsMenu], ...
        {'Checked'}, checks)
end