state = ROIAgt.CONSTRUCTING;
    public void mouseReleased(MouseEvent e)    {        dragging = false;        moving = false;        setCursor(DEFAULT_CURSOR);         switch (state) {            case ROIAgt.CONSTRUCTING:                 if (!pressed) saveROI();                break;            case ROIAgt.MOVING:             case ROIAgt.RESIZING:                                 if (currentShape != null) saveShape();           }         pressed = false;    }