www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/+mbcgui/+widget/@ScrollTable/paintCell.m

    function paintCell(obj, R, C)
%PAINTCELL Refresh specified cell
%
%  PAINTCELL(OBJ, R, C) forces a repaint of the specified cell.  If the
%  cell is not visible, nothing will happen.

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


if ~obj.isCellVisible(R, C)
    return
end

if R==0
    % Paint column header
    obj.paintObjects(obj.ColumnHeaderObjects(C-obj.CurrentColumn+1), ...
        obj.ColumnHeaderData, ...
        -1, C);
elseif C==0
    % Paint row header
    obj.paintObjects(obj.RowHeaderObjects(R-obj.CurrentRow+1), ...
        obj.RowHeaderData, ...
        R, -1);
else
    % Paint cell
    obj.paintObjects(obj.MainObjects(R-obj.CurrentRow+1, C-obj.CurrentColumn+1), ...
        obj.MainData, ...
        R, C);
end