int bestArea= Integer.MIN_VALUE;
Anchor bestAnchor= null;
do {
upperLeft= computeLocation(subjectArea, controlSize, testAnchor);
Monitor monitor= getClosestMonitor(subjectAreaDisplayRelative, testAnchor);
if (updateLocation(upperLeft, controlSize, monitor.getClientArea(), testAnchor))
return upperLeft;
// compute available area for this anchor and update if better than best
Rectangle available= computeAvailableArea(subjectAreaDisplayRelative, monitor.getClientArea(), testAnchor);
Rectangle proposed= new Rectangle(upperLeft.x, upperLeft.y, controlSize.x, controlSize.y);
available.intersect(proposed);
int area= available.width * available.height;
if (area > bestArea) {
bestArea= area;