Aborts constructing or modifying the roi (called by the ImageJ class on escape)
(ImagePlus imp)
| 888 | |
| 889 | /** Aborts constructing or modifying the roi (called by the ImageJ class on escape) */ |
| 890 | public void abortModification(ImagePlus imp) { |
| 891 | if (state == CONSTRUCTING) { |
| 892 | setImage(null); |
| 893 | if (imp!=null) { |
| 894 | Roi savedPreviousRoi = getPreviousRoi(); |
| 895 | imp.setRoi(previousRoi!=null && previousRoi.getImage() == imp ? previousRoi : null); |
| 896 | setPreviousRoi(savedPreviousRoi); //(overrule saving this aborted roi as previousRoi) |
| 897 | } |
| 898 | } else if (state==MOVING) |
| 899 | move(previousSX, previousSY); //move back to starting point |
| 900 | else if (state == MOVING_HANDLE) |
| 901 | moveHandle(previousSX, previousSY); //move handle back to starting point |
| 902 | state = NORMAL; |
| 903 | } |
| 904 | |
| 905 | protected void grow(int sx, int sy) { |
| 906 | if (clipboard!=null) return; |
no test coverage detected