(Runnable run)
| 3587 | } |
| 3588 | |
| 3589 | @AstroImageJ(reason = "Ensure actions that effect the GUI occur on the proper thread to prevent blocking the macro") |
| 3590 | private void eventCallWait(Runnable run) { |
| 3591 | try { |
| 3592 | if (SwingUtilities.isEventDispatchThread()) { |
| 3593 | run.run(); |
| 3594 | } else { |
| 3595 | SwingUtilities.invokeAndWait(run); |
| 3596 | } |
| 3597 | } catch (InterruptedException | InvocationTargetException e) { |
| 3598 | throw new RuntimeException(e); |
| 3599 | } |
| 3600 | } |
| 3601 | |
| 3602 | void setBatchMode() { |
| 3603 | boolean enterBatchMode = false; |