()
| 43 | |
| 44 | // Miscellaneous Options |
| 45 | void miscOptions() { |
| 46 | String key = IJ.isMacintosh()?"command":"control"; |
| 47 | GenericDialog gd = new GenericDialog("Miscellaneous Options"); |
| 48 | gd.addStringField("Divide by zero value:", ""+FloatBlitter.divideByZeroValue, 10); |
| 49 | gd.addCheckbox("Use pointer cursor", Prefs.usePointerCursor); |
| 50 | gd.addCheckbox("Hide \"Process Stack?\" dialog", IJ.hideProcessStackDialog); |
| 51 | gd.addCheckbox("Require "+key+" key for shortcuts", Prefs.requireControlKey); |
| 52 | gd.addCheckbox("Move isolated plugins to Misc. menu", Prefs.moveToMisc); |
| 53 | if (!IJ.isMacOSX()) |
| 54 | gd.addCheckbox("Run single instance listener", Prefs.runSocketListener); |
| 55 | gd.addCheckbox("Enhanced line tool", Prefs.enhancedLineTool); |
| 56 | gd.addCheckbox("Reverse CZT order of \">\" and \"<\"", Prefs.reverseNextPreviousOrder); |
| 57 | if (IJ.isMacOSX()) |
| 58 | gd.addCheckbox("Don't set Mac menu bar", !Prefs.setIJMenuBar); |
| 59 | if (IJ.isLinux()) |
| 60 | gd.addCheckbox("Save window locations", !Prefs.doNotSaveWindowLocations); |
| 61 | gd.addCheckbox("Non-blocking filter dialogs", Prefs.nonBlockingFilterDialogs); |
| 62 | gd.addCheckbox("Debug mode", IJ.debugMode); |
| 63 | //gd.addCheckbox("Modern mode", Prefs.modernMode); |
| 64 | gd.addHelp(IJ.URL2+"/docs/menus/edit.html#misc"); |
| 65 | gd.showDialog(); |
| 66 | if (gd.wasCanceled()) |
| 67 | return; |
| 68 | |
| 69 | String divValue = gd.getNextString(); |
| 70 | if (divValue.equalsIgnoreCase("infinity") || divValue.equalsIgnoreCase("infinite")) |
| 71 | FloatBlitter.divideByZeroValue = Float.POSITIVE_INFINITY; |
| 72 | else if (divValue.equalsIgnoreCase("NaN")) |
| 73 | FloatBlitter.divideByZeroValue = Float.NaN; |
| 74 | else if (divValue.equalsIgnoreCase("max")) |
| 75 | FloatBlitter.divideByZeroValue = Float.MAX_VALUE; |
| 76 | else { |
| 77 | Float f; |
| 78 | try {f = Float.valueOf(divValue);} |
| 79 | catch (NumberFormatException e) {f = null;} |
| 80 | if (f!=null) |
| 81 | FloatBlitter.divideByZeroValue = f.floatValue(); |
| 82 | } |
| 83 | IJ.register(FloatBlitter.class); |
| 84 | |
| 85 | Prefs.usePointerCursor = gd.getNextBoolean(); |
| 86 | IJ.hideProcessStackDialog = gd.getNextBoolean(); |
| 87 | Prefs.requireControlKey = gd.getNextBoolean(); |
| 88 | Prefs.moveToMisc = gd.getNextBoolean(); |
| 89 | if (!IJ.isMacOSX()) |
| 90 | Prefs.runSocketListener = gd.getNextBoolean(); |
| 91 | Prefs.enhancedLineTool = gd.getNextBoolean(); |
| 92 | Prefs.reverseNextPreviousOrder = gd.getNextBoolean(); |
| 93 | if (IJ.isMacOSX()) |
| 94 | Prefs.setIJMenuBar = !gd.getNextBoolean(); |
| 95 | if (IJ.isLinux()) |
| 96 | Prefs.doNotSaveWindowLocations = !gd.getNextBoolean(); |
| 97 | Prefs.nonBlockingFilterDialogs = gd.getNextBoolean(); |
| 98 | IJ.setDebugMode(gd.getNextBoolean()); |
| 99 | if (IJ.recording() && IJ.isMacOSX()) { |
| 100 | if (Recorder.scriptMode()) |
| 101 | Recorder.recordCall("Prefs.setIJMenuBar = "+Prefs.setIJMenuBar+";"); |
| 102 | else |
no test coverage detected