currentROI = roi; currentShape = s; Rectangle r = s.getBounds(); xControl = r.x; yControl = r.y; view.setIndexSelected(roi.getIndex()); if (clickCount == 2) { dragging = false; control.annotateROI(roi); }
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);
    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;        if (state == ROIAgt.MOVING) setCursor(HAND_CURSOR);        else setCursor(DEFAULT_CURSOR);        while (i.hasNext()) {            roi = (ROIShape) (i.next());            s = roi.getShape();            if (s.contains(p)) {                currentROI = roi;                currentShape = s;                Rectangle r = s.getBounds();                xControl = r.x;                yControl = r.y;                view.setIndexSelected(roi.getIndex());                if (clickCount == 2) {                    dragging = false;                    control.annotateROI(roi);                }            }        }    }