Segment vLeft, vRight, hTop, hBottom; PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner, bottomRightCorner; PlanePoint cPoint;
    private void handleMousePressed(Point p, int clickCount)    {        pressed = true;        dragging = true;        currentROI = null;        currentShape = null;        anchor = p;        Iterator i = listROI.iterator();        ROIShape roi;        Shape s;        Rectangle r;        Segment vLeft, vRight, hTop, hBottom;        PlanePoint topLeftCorner, topRightCorner, bottomLeftCorner,                     bottomRightCorner;        PlanePoint cPoint;        while (i.hasNext()) {            roi = (ROIShape) (i.next());            s = roi.getShape();            r = s.getBounds();            topLeftCorner = new PlanePoint(r.x, r.y);            topRightCorner = new PlanePoint(r.x+r.width-2, r.y);            bottomLeftCorner = new PlanePoint(r.x, r.y+r.height-2);            bottomRightCorner = new PlanePoint(r.x+r.width-2, r.y+r.height-2);            vLeft = new Segment(topLeftCorner, bottomLeftCorner);            vRight = new Segment(topRightCorner, bottomRightCorner);            hTop = new Segment(topLeftCorner, topRightCorner);            hBottom = new Segment(bottomLeftCorner, bottomRightCorner);            cPoint = new PlanePoint(p.x, p.y);            if (s.contains(p)) {                setHandlePressedValues(roi, s, r.x, r.y);                cPoint = new PlanePoint(p.x, p.y);                if (vLeft.lies(cPoint))                    resizeZone = LEFT;                else if (vRight.lies(cPoint))                    resizeZone = RIGHT;                else if (hTop.lies(cPoint))                    resizeZone = TOP;                else if (hBottom.lies(cPoint))                    resizeZone = BOTTOM;                else handlePressedIn(roi, clickCount);            }        }        if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR);        else setCursor(DEFAULT_CURSOR);    }