function aObj = domove(aObj, pointX, pointY, refresh);
%CELLLINE/DOMOVE

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.5 $  $Date: 1997/12/06 00:40:16 $

savedState = get(aObj, 'SavedState');

lowerChild = aObj.LowerChild;
upperChild = aObj.UpperChild;

switch get(aObj,'DragConstraint')
% case ''
case 'fixX'
   minY = get(lowerChild,'MinY') + get(lowerChild,'MinWidth');
   maxY = get(upperChild,'MaxY') - get(upperChild,'MinWidth');
   newY = pointY - savedState.OffsetY;
   newY = max(newY, minY);
   newY = min(newY, maxY);
   aObj = set(aObj,'YData', [newY newY]);
   set(lowerChild, 'MaxY', newY);
   set(upperChild, 'MinY', newY);
case 'fixY'
   minX = get(lowerChild,'MinX') + get(lowerChild,'MinWidth');
   maxX = get(upperChild,'MaxX') - get(upperChild,'MinWidth');
   newX = pointX - savedState.OffsetX;
   newX = max(newX, minX);
   newX = min(newX, maxX);
   aObj = set(aObj,'XData', [newX newX]);
   set(lowerChild, 'MaxX', newX);
   set(upperChild, 'MinX', newX);
end

