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

    function pDrawTable(obj)
%PDRAWTABLE Update graphical display of table
%
%  PDRAWTABLE(OBJ) updates the displayed table to match the information
%  contained in the table that is currently selected in the current
%  tradeoff.

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


if ~isempty(obj.MessageService) ...
        && ~isempty(obj.MessageService.CurrentTradeoff)

    hTradeoff = info(obj.MessageService.CurrentTradeoff);
    if numPoints(hTradeoff)>0
        % Ask tradeoff to set input pointers to all saved values
        setInputsAt(hTradeoff, 'all');

        % Get the inputs from MessageService
        pTable = obj.MessageService.TradeoffServices.pTableInputs;
        pOther = obj.MessageService.TradeoffServices.pInputs;

        colnames = pveceval([pTable, pOther], @getname);
        [tablerows, tablecols] = getTableLinkIndices(hTradeoff);
        tableinputs = pveceval(pTable, @getvalue);
        tableinputs = [tableinputs{:}];
        otherinputs = pveceval(pOther, @getvalue);
        otherinputs = [otherinputs{:}];


        obj.hTable.Peer.setNewTradeoffData( ...
            colnames, ...
            tablerows(:), ...
            tablecols(:), ...
            tableinputs, ...
            otherinputs);

        if obj.MessageService.hasValidListIndex
            % Select the current point in the table
            obj.hTable.selectCell(obj.MessageService.CurrentListIndex, 1);
        end
    else
        obj.hTable.Peer.clearTable;
    end
else
    obj.hTable.Peer.clearTable;
end