@param method "size" or "fullScreen" @param args parameters passed to the function so we can show the user @return true if safely inside the settings() method
(String method, Object... args)
| 934 | * @return true if safely inside the settings() method |
| 935 | */ |
| 936 | boolean insideSettings(String method, Object... args) { |
| 937 | if (insideSettings) { |
| 938 | return true; |
| 939 | } |
| 940 | final String url = "https://processing.org/reference/" + method + "_.html"; |
| 941 | if (!external) { // post a warning for users of Eclipse and other IDEs |
| 942 | StringList argList = new StringList(args); |
| 943 | System.err.println("When not using the PDE, " + method + "() can only be used inside settings()."); |
| 944 | System.err.println("Remove the " + method + "() method from setup(), and add the following:"); |
| 945 | System.err.println("public void settings() {"); |
| 946 | System.err.println(" " + method + "(" + argList.join(", ") + ");"); |
| 947 | System.err.println("}"); |
| 948 | } |
| 949 | throw new IllegalStateException(method + "() cannot be used here, see " + url); |
| 950 | } |
| 951 | |
| 952 | |
| 953 | void handleSettings() { |
no test coverage detected