function schema
% Defines properties for @designconstr superclass.
%
%   Specifics about @designconstr subclasses:
%     * Changes in data properties have no immediate effect and  
%       require an explicit call to UPDATE to refresh the graphics

%   Copyright 1986-2002 The MathWorks, Inc. 
%   $Revision: 1.1.6.3 $ $Date: 2004/12/26 21:51:08 $

pk = findpackage('plotconstr');
pkHG = findpackage('hg');

% Register class 
c = schema.class(pk,'designconstr',findclass(pkHG,'hggroup'));

% Constraint data
p = schema.prop(c,'Data','handle');                     % Data object used for undo/redo and load/save
p.AccessFlag.PublicGet = 'off';
p.AccessFlag.PublicSet = 'off';
p.AccessFlag.PrivateGet = 'on';
p.AccessFlag.PrivateSet = 'on';

schema.prop(c, 'ButtonDownFcn', 'MATLAB callback');     % Button Down on marker/patch
schema.prop(c, 'EventManager','handle');                % Event coordinator (@eventmgr object)
schema.prop(c, 'TextEditor', 'handle');                 % Constraint editor handle

p = schema.prop(c, 'Selected', 'on/off');               % Selection flag 
p.FactoryValue = 'off';

p = schema.prop(c, 'Type', 'string');                   % Bound type [upper|lower]
p.FactoryValue = '';
p.SetFunction = {@localSet 'Type'};                     % Map to data object
p.GetFunction = {@localGet 'Type'};
p = schema.prop(c, 'Weight', 'mxArray');                % Bound weight [0 1]
p.FactoryValue = 1;
p.SetFunction = {@localSet 'Weight'};                   % Map to data object
p.GetFunction = {@localGet 'Weight'};

p = schema.prop(c, 'Zlevel', 'double');                 % Z coordinate for layering (default=0)
p.FactoryValue = 0;

P = schema.prop(c, 'ConstraintOverlap', 'bool');        % Flag, does constraint create infeasible region
p.FactoryValue = false;

p = schema.prop(c, 'PatchColor', 'mxArray');            % Color of patch
p.FactoryValue = [1 0.5 0.5];

p = schema.prop(c, 'EdgeColor', 'mxArray');             % Color of patch edge
p.FactoryValue = [0 0 0];

% Private properties 
schema.prop(c, 'Activated', 'bool');              % Needed to mitigate limitation of undo add
schema.prop(c, 'Listeners', 'handle vector');     % Listeners
schema.prop(c, 'AppData', 'MATLAB array');        % Storage area
p = schema.prop(c,'xDisplayUnits','mxArray');     % x-coord units used when displaying constraint
p.AccessFlag.PublicGet = 'off';
p.AccessFlag.PublicSet = 'off';
p.AccessFlag.PrivateGet = 'on';
p.AccessFlag.PrivateSet = 'on';
p = schema.prop(c,'yDisplayUnits','mxArray');     % y-coord units used when displaying constraint
p.AccessFlag.PublicGet = 'off';
p.AccessFlag.PublicSet = 'off';
p.AccessFlag.PrivateGet = 'on';
p.AccessFlag.PrivateSet = 'on';
 
% Events
% DataChanged: notifies environment that constraint data has changed 
%              (no listeners on individual data properties)
schema.event(c, 'DataChanged');
schema.event(c, 'DataChangeFinished');
%--------------------------------------------------------------------------
function valueStored = localSet(this, Value, fld)

this.setData(fld,Value);
if ischar(Value)
   valueStored = '';
else
   valueStored = [];
end

%--------------------------------------------------------------------------
function valueReturned = localGet(this, Value, fld)

valueReturned = this.getData(fld);


