www.gusucode.com > sloptim工具箱matlab源码程序 > sloptim/sloptguis/@srosisotoolgui/@tunedparameterpnl/selectionChanged.m

    function selectionChanged(this) 
% SELECTIONCHANGED manage table row selection changes
%
 
% Author(s): A. Stothert 14-May-2008
% Copyright 2008 The MathWorks, Inc.

hJava  = this.JavaHandle;
hTable = hJava.getTable;

%Find compensator rows and selected rows
CompIdx    = double(hJava.getCompensatorIndices);
RowIdx     = hTable.getSelectedRows;

%Check if there's at least one row selected that is not a compensator,
%enable/disable 'use value as initial guess' button based on this
nonComp = setdiff(RowIdx,CompIdx);
if isempty(nonComp)
   awtinvoke(hJava.getValueToInitialButton,'setEnabled(Z)',false);
else
   awtinvoke(hJava.getValueToInitialButton,'setEnabled(Z)',true);
end