diff --git a/ij/ImageJ.java b/ij/ImageJ.java index ce2a24ec..20ed6848 100644 --- a/ij/ImageJ.java +++ b/ij/ImageJ.java @@ -79,7 +79,7 @@ public class ImageJ extends Frame implements ActionListener, /** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */ public static final String VERSION = "1.54k"; - public static final String BUILD = "10"; + public static final String BUILD = "11"; public static Color backgroundColor = new Color(237,237,237); /** SansSerif, 12-point, plain font. */ public static final Font SansSerif12 = new Font("SansSerif", Font.PLAIN, 12); diff --git a/ij/plugin/frame/Recorder.java b/ij/plugin/frame/Recorder.java index ab54f47a..72481338 100644 --- a/ij/plugin/frame/Recorder.java +++ b/ij/plugin/frame/Recorder.java @@ -30,7 +30,7 @@ public class Recorder extends PlugInFrame implements PlugIn, ActionListener, Ima private TextField fileName; private static Vector notRecordingThreads = new Vector(); private String fitTypeStr = CurveFitter.fitList[0]; - private static TextArea textArea = new TextArea(); //recorded code goes here (start with dummy to avoid NullPointerException) + private static TextArea textArea; private static Recorder instance; private static String commandName; private static String commandOptions; @@ -135,7 +135,8 @@ public static void resumeRecording() { * whether the Macro Recorder is open and recording is not suspended * for the current thread.*/ private static boolean recordingEnabled() { - if (getInstance() == null) return false; + if (getInstance()==null || textArea==null) + return false; return !notRecordingThreads.contains(Thread.currentThread()); } @@ -279,7 +280,8 @@ public static void record(String method, int a1, int a2, int a3) { } public static void record(String method, String a1, int a2) { - textArea.append(method+"(\""+a1+"\", "+a2+");\n"); + if (recordingEnabled()) + textArea.append(method+"(\""+a1+"\", "+a2+");\n"); } public static void record(String method, String args, int a1, int a2) { @@ -786,6 +788,8 @@ public static void resetCommandOptions() { } void createMacro() { + if (!recordingEnabled()) + return; String text = textArea.getText(); if (text==null || text.equals("")) { IJ.showMessage("Recorder", "A macro cannot be created until at least\none command has been recorded."); @@ -918,7 +922,7 @@ public void imageOpened(ImagePlus imp) { } public void imageClosed(ImagePlus imp) { } void runCode() { - if (instance==null) + if (instance==null || !recordingEnabled()) return; String name = fileName.getText(); if (name==null) @@ -991,7 +995,7 @@ record = false; } public String getText() { - return textArea.getText(); + return recordingEnabled()?textArea.getText():""; } public static Recorder getInstance() { diff --git a/release-notes.html b/release-notes.html index 48ec8008..c5ade1d7 100644 --- a/release-notes.html +++ b/release-notes.html @@ -5,7 +5,7 @@ -
  • 1.54k10 2 July 2024 +
  • 1.54k11 2 July 2024
    • Thanks to Bram van den Broek, the Image>Duplicate command enables the "Ignore Selection" option when the ROI is