function SyncStateOrder(this,StateOrderList)
% SyncStateOrder - Sync the state order if a user clicks one of the
% operating point buttons.  The variable StateOrderList is a cell array
% of the newly sunk states.

%  Author(s): John Glass
%  Revised:
% Copyright 1986-2004 The MathWorks, Inc.
% $Revision: 1.1.6.1 $ $Date: 2004/08/01 00:12:10 $

%% First check to see if the dialog is up
vis = this.JavaPanel.isVisible;

if vis
    %% Create a new list model
    StateOrderModel = javax.swing.DefaultListModel;
    for ct = 1:length(StateOrderList)
        StateOrderModel.addElement(StateOrderList{ct});
    end
    %% Set the new list model
    awtinvoke(this.JavaHandles.StateOrderList,'setModel',StateOrderModel);
    %% Select the first element
    if ~isempty(StateOrderList)
        awtinvoke(this.JavaHandles.StateOrderList,'setSelectedIndex',0);
    end
end