Skip to content

Commit 22920b4

Browse files
committed
2025.10.02 (1.54s6; Macro error messages)
1 parent 62db90a commit 22920b4

6 files changed

Lines changed: 31 additions & 10 deletions

File tree

ij/ImageJ.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public class ImageJ extends Frame implements ActionListener,
7878
MouseListener, KeyListener, WindowListener, ItemListener, Runnable {
7979

8080
/** Plugins should call IJ.getVersion() or IJ.getFullVersion() to get the version string. */
81-
public static final String VERSION = "1.54r";
82-
public static final String BUILD = ""; //8
81+
public static final String VERSION = "1.54s";
82+
public static final String BUILD = "6";
8383
public static Color backgroundColor = new Color(237,237,237);
8484
/** SansSerif, 12-point, plain font. */
8585
public static final Font SansSerif12 = new Font("SansSerif", Font.PLAIN, 12);

ij/gui/ImageCanvas.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ private void drawOverlay(Overlay overlay, Graphics g) {
342342
else if (t==0)
343343
t = position;
344344
}
345-
//IJ.log("drawOverlay: i="+i+", pos="+roi.getPosition()+" "+c+" "+z+" "+t);
345+
//IJ.log("drawOverlay: i="+i+", pos="+roi.getPosition()+" "+c+" "+z+" "+t+" "+roiManagerShowAllMode);
346346
if (((c==0||c==channel) && (z==0||z==slice) && (t==0||t==frame)) || roiManagerShowAllMode || position == PointRoi.POINTWISE_POSITION)
347347
drawRoi(g, roi, drawLabels?i+LIST_OFFSET:-1);
348348
} else {

ij/macro/Functions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ final double getFunctionValue(int type) {
239239
case MATCHES: value = matches(null); break;
240240
case GET_STRING_WIDTH: value = getStringWidth(); break;
241241
case FIT: value = fit(); break;
242-
case OVERLAY: value = overlay(); break;
242+
case OVERLAY: value = doOverlay(); break;
243243
case SELECTION_CONTAINS: value = selectionContains(); break;
244244
case PLOT: value = doPlot(); break;
245245
default:
@@ -6776,7 +6776,7 @@ private void renameResults() {
67766776
IJ.renameResults(arg1);
67776777
}
67786778

6779-
double overlay() {
6779+
double doOverlay() {
67806780
interp.getToken();
67816781
if (interp.token!='.')
67826782
interp.error("'.' expected");

ij/macro/Interpreter.java

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ final void getComma() {
13541354
}
13551355
}
13561356

1357-
void error (String message) {
1357+
void error(String message) {
13581358
errorMessage = message;
13591359
if (ignoreErrors)
13601360
return;
@@ -1373,9 +1373,23 @@ void error (String message) {
13731373
instance = null;
13741374
if (showMessage && message!=null) {
13751375
String line = getErrorLine();
1376+
String originalLine = line;
13761377
done = true;
1377-
if (line.length()>120)
1378-
line = line.substring(0,119)+"...";
1378+
int max = 90;
1379+
int len = line.length();
1380+
if (len>max) {
1381+
StringBuilder sb = new StringBuilder(len+50);
1382+
int count = 0;
1383+
for (int i=0; i<len; i++){
1384+
sb.append(line.charAt(i));
1385+
count++;
1386+
if (count>=max && i<len-7) {
1387+
sb.append("\n ");
1388+
count = 0;
1389+
}
1390+
}
1391+
line = sb.toString();
1392+
}
13791393
Frame f = WindowManager.getFrame("Debug");
13801394
TextPanel panel = null;
13811395
if (showVariables && f!=null && (f instanceof TextWindow)) { //clear previous content
@@ -1398,7 +1412,7 @@ void error (String message) {
13981412
TextWindow debugWindow = (TextWindow)f;
13991413
debugWindow.append("\n---\t\t---\nError:\t\t" + message + " in line "+lineNumber + ":");
14001414
debugWindow.append(calledFrom + "\t\t");
1401-
debugWindow.append("\t\t"+line);
1415+
debugWindow.append("\t\t"+originalLine);
14021416
}
14031417
throw new RuntimeException(Macro.MACRO_CANCELED);
14041418
}

ij/plugin/filter/ParticleAnalyzer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public class ParticleAnalyzer implements PlugInFilter, Measurements {
6868
/** Display image containing binary masks of measured particles. */
6969
public static final int SHOW_MASKS = 4096;
7070

71-
/** Use 4-connected particle tracing. */
71+
/** Use 4-connected particle tracing. In a macro, add "four" to the options string. */
7272
public static final int FOUR_CONNECTED = 8192;
7373

7474
/** Replace original image with masks. */

release-notes.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@
55
</head>
66
<body>
77

8+
<li> <u>1.54s6 2 October 2025</u>
9+
<ul>
10+
<li> Thanks to Bram van den Broek, macro error messages longer
11+
than 90 characters are displayed on multiple lines and the full
12+
message is displayed in the Debug window.
13+
</ul>
14+
815
<li> <u>1.54r 25 September 2025</u>
916
<ul>
1017
<li> The <i>File&gt;New&gt;Text Window</i> command now

0 commit comments

Comments
 (0)