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

Method waitForUser

ij/src/main/java/ij/macro/Functions.java:5839–5863  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5837 }
5838
5839 void waitForUser() {
5840 IJ.wait(50);
5841 if (waitForUserDialog!=null && waitForUserDialog.isShowing())
5842 interp.error("Duplicate call");
5843 String title = "Action Required";
5844 String text = " Click \"OK\" to continue ";
5845 if (interp.nextToken()=='(') {
5846 title = getFirstString();
5847 if (interp.nextToken()==',')
5848 text = getLastString();
5849 else {
5850 text = title;
5851 title = "Action Required";
5852 interp.getRightParen();
5853 }
5854 }
5855 waitForUserDialog = new WaitForUserDialog(title, text);
5856 Interpreter instance = Interpreter.getInstance();
5857 interp.waitingForUser = true;
5858 waitForUserDialog.show();
5859 interp.waitingForUser = false;
5860 Interpreter.setInstance(instance); // works around bug caused by use of drawing tools
5861 if (waitForUserDialog.escPressed() || IJ.escapePressed())
5862 throw new RuntimeException(Macro.MACRO_CANCELED);
5863 }
5864
5865 void abortDialog() {
5866 if (waitForUserDialog!=null && waitForUserDialog.isVisible())

Callers 1

doFunctionMethod · 0.95

Calls 12

waitMethod · 0.95
getFirstStringMethod · 0.95
getLastStringMethod · 0.95
getInstanceMethod · 0.95
setInstanceMethod · 0.95
escapePressedMethod · 0.95
isShowingMethod · 0.80
getRightParenMethod · 0.80
escPressedMethod · 0.80
errorMethod · 0.45
nextTokenMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected