MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / abortModification

Method abortModification

ij/src/main/java/ij/gui/Roi.java:890–903  ·  view source on GitHub ↗

Aborts constructing or modifying the roi (called by the ImageJ class on escape)

(ImagePlus imp)

Source from the content-addressed store, hash-verified

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;

Callers 1

abortPluginOrMacroMethod · 0.95

Calls 7

setImageMethod · 0.95
getPreviousRoiMethod · 0.95
setPreviousRoiMethod · 0.95
moveMethod · 0.95
moveHandleMethod · 0.95
getImageMethod · 0.65
setRoiMethod · 0.45

Tested by

no test coverage detected