function junk = apply(h)
%APPLY  Apply property change in Response Property Editor to target response object

%   Author(s): A. DiVergilio
%   Copyright 1986-2000 The MathWorks, Inc. 
%   $Revision: 1.7 $  $Date: 2000/06/14 20:15:12 $

junk = []; %---Temporary fix

%---Last changed property stored in LastChange
Property = h.Data.LastChange;

%---Return if no Property is given (clearing h.Data.LastChange)
if isempty(Property), return; end

%---Change cursor to stopwatch
 oldcursor = h.GUI.getCursor;
 h.GUI.setCursor(com.mathworks.mwt.MWFrame.WAIT_CURSOR);

%---Disable Response Object listener
 h.enable_readprops = 0;

%---Get Response Object to receive property change
 RespObj = h.Target.UserData;

%---Apply property change
 if findstr('Font',Property)
    idx = findstr('Font',Property);
    head = Property(1:idx-1);
    foot = Property(idx:end);
    if strcmpi(head,'xylabels')
       head1 = 'xlabel';
       head2 = 'ylabel';
       setfont(RespObj,head1,foot,get(h.Data,Property));
       setfont(RespObj,head2,foot,get(h.Data,Property));
    else
       setfont(RespObj,head,foot,get(h.Data,Property));
    end
 elseif findstr('Scale',Property)
    setscale(RespObj,Property,get(h.Data,Property));
 elseif strcmp('AxesForegroundColor',Property)
    setcolor(RespObj,Property,get(h.Data,Property));
 else
    WarnState = warning; warning off;  %---Hide warning for latex interpreter
    set(RespObj,Property,get(h.Data,Property))
    warning(WarnState);
 end

%---If Title was changed, update frame title of Property Editor
 if strcmpi(Property,'Title')
    h.GUI.setTitle(sprintf('Property Editor: %s',h.Data.Title));
 end

%---Re-enable Response Object listener
 h.Data.LastChange = '';
 h.enable_readprops = 1;

%---Force full-update for certain property changes (these properties can affect others)
 plist = {'FrequencyUnits';'MagnitudeUnits';'PhaseUnits';...
          'FrequencyScale';'MagnitudeScale';...
          'StabilityMargin';'AllStabilityMargin';...
          'XlimMode';'YlimMode';...
          'Xlim';'Ylim'};
 if any(strcmpi(Property,plist))
    h.readprops;
 end

%---Redraw plot selection-line
 h.refresh;

%---Restore original cursor
 h.GUI.setCursor(oldcursor);
