called when escape pressed
(ImagePlus imp)
| 735 | |
| 736 | /** called when escape pressed */ |
| 737 | void abortPluginOrMacro(ImagePlus imp) { |
| 738 | if (imp!=null) { |
| 739 | ImageWindow win = imp.getWindow(); |
| 740 | if (win!=null) { |
| 741 | Roi roi = imp.getRoi(); |
| 742 | if (roi!=null && roi.getState()!=Roi.NORMAL) { |
| 743 | roi.abortModification(imp); |
| 744 | return; |
| 745 | } else { |
| 746 | win.running = false; |
| 747 | win.running2 = false; |
| 748 | } |
| 749 | } |
| 750 | } |
| 751 | Macro.abort(); |
| 752 | Interpreter.abort(); |
| 753 | if (Interpreter.getInstance()!=null) |
| 754 | IJ.beep(); |
| 755 | } |
| 756 | |
| 757 | public void windowClosing(WindowEvent e) { |
| 758 | if (Executer.getListenerCount()>0) |
no test coverage detected