Skip to content

Commit 6037ff7

Browse files
committed
2020.08.30 (1.53e8; Added module-info.java)
1 parent ffa061f commit 6037ff7

9 files changed

+61
-14
lines changed

ij/ImageJ.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class ImageJ extends Frame implements ActionListener,
7878

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

ij/Prefs.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class Prefs {
7272
/** Open images at 100% magnification*/
7373
public static boolean open100Percent;
7474
/** Backgound is black in binary images*/
75-
public static boolean blackBackground;
75+
public static boolean blackBackground = true;
7676
/** Use JFileChooser instead of FileDialog to open and save files. */
7777
public static boolean useJFileChooser;
7878
/** Color to grayscale conversion is weighted (0.299, 0.587, 0.114) if the variable is true. */
@@ -491,7 +491,7 @@ static void loadOptions() {
491491
antialiasedText = false;
492492
interpolateScaledImages = (options&INTERPOLATE)!=0;
493493
open100Percent = (options&ONE_HUNDRED_PERCENT)!=0;
494-
blackBackground = (options&BLACK_BACKGROUND)!=0;
494+
//blackBackground = (options&BLACK_BACKGROUND)!=0;
495495
useJFileChooser = (options&JFILE_CHOOSER)!=0;
496496
weightedColor = (options&WEIGHTED)!=0;
497497
if (weightedColor)

ij/macro/Functions.java

+3
Original file line numberDiff line numberDiff line change
@@ -7811,6 +7811,9 @@ private Variable doRoiManager() {
78117811
if (name.equals("size")) {
78127812
interp.getParens();
78137813
return new Variable(rm.getCount());
7814+
} else if (name.equals("selected")) {
7815+
interp.getParens();
7816+
return new Variable(rm.selected());
78147817
} else if (name.equals("select")) {
78157818
rm.select((int)getArg());
78167819
return null;

ij/macro/MacroRunner.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ public MacroRunner(String macro, Editor editor) {
3737
thread.start();
3838
}
3939

40-
/** Create a new object that interprets macro source in a
41-
separate thread, and also passing a string argument. */
40+
/** Interprets macro source in a separate thread using a string argument. */
4241
public MacroRunner(String macro, String argument) {
4342
this.macro = macro;
4443
this.argument = argument;
@@ -47,7 +46,7 @@ public MacroRunner(String macro, String argument) {
4746
thread.start();
4847
}
4948

50-
/** Create a new object that interprets a macro file using a separate thread. */
49+
/** Interprets a macro file in a separate thread. */
5150
public MacroRunner(File file) {
5251
int size = (int)file.length();
5352
if (size<=0)
@@ -74,12 +73,12 @@ public MacroRunner(File file) {
7473
thread.start();
7574
}
7675

77-
/** Create a new object that runs a tokenized macro in a separate thread. */
76+
/** Runs a tokenized macro in a separate thread. */
7877
public MacroRunner(Program pgm, int address, String name) {
7978
this(pgm, address, name, (String)null);
8079
}
8180

82-
/** Create a new object that runs a tokenized macro in a separate thread,
81+
/** Runs a tokenized macro in a separate thread,
8382
passing a string argument. */
8483
public MacroRunner(Program pgm, int address, String name, String argument) {
8584
this.pgm = pgm;
@@ -91,7 +90,7 @@ public MacroRunner(Program pgm, int address, String name, String argument) {
9190
thread.start();
9291
}
9392

94-
/** Create a new object that runs a tokenized macro in debug mode if 'editor' is not null. */
93+
/** Runs a tokenized macro in debug mode if 'editor' is not null. */
9594
public MacroRunner(Program pgm, int address, String name, Editor editor) {
9695
this.pgm = pgm;
9796
this.address = address;
@@ -129,6 +128,7 @@ public Thread getThread() {
129128
return thread;
130129
}
131130

131+
/** Used to run the macro code in 'macro' on a separate thread. */
132132
public void run() {
133133
Interpreter interp = new Interpreter();
134134
interp.argument = argument;

ij/plugin/PointToolOptions.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) {
136136
Prefs.showAllPoints = showAllPoints;
137137
if (multipointTool) {
138138
int counter = gd.getNextChoiceIndex();
139-
if (counter!=getCounter()) {
139+
if (counter==0 || counter!=getCounter()) {
140140
setCounter(counter);
141141
redraw = true;
142142
}

ij/plugin/frame/Editor.java

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public class Editor extends PlugInFrame implements ActionListener, ItemListener,
2727
"importPackage(Packages.ij.process);"+
2828
"importPackage(Packages.ij.measure);"+
2929
"importPackage(Packages.ij.util);"+
30+
"importPackage(Packages.ij.macro);"+
3031
"importPackage(Packages.ij.plugin);"+
3132
"importPackage(Packages.ij.io);"+
3233
"importPackage(Packages.ij.plugin.filter);"+

ij/plugin/frame/RoiManager.java

+15-3
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,8 @@ boolean delete(boolean replacing) {
601601
}
602602
}
603603
ImagePlus imp = WindowManager.getCurrentImage();
604-
if (count>1 && index.length==1 && imp!=null)
605-
imp.deleteRoi();
604+
//if (count>1 && index.length==1 && imp!=null)
605+
// imp.deleteRoi();
606606
updateShowAll();
607607
if (record())
608608
Recorder.record("roiManager", "Delete");
@@ -1601,7 +1601,7 @@ private void combine() {
16011601
if (imp==null)
16021602
return;
16031603
Roi[] rois = getSelectedRoisAsArray();
1604-
if (rois.length==1) {
1604+
if (rois.length==1 && !IJ.isMacro()) {
16051605
error("More than one item must be selected, or none");
16061606
return;
16071607
}
@@ -1620,6 +1620,13 @@ private int countPointRois(Roi[] rois) {
16201620
}
16211621

16221622
private void combineRois(ImagePlus imp, Roi[] rois) {
1623+
if (rois.length==1) {
1624+
Roi roi2 = (Roi)rois[0].clone();
1625+
roi2.setPosition(0);
1626+
roi2.setGroup(0);
1627+
imp.setRoi(roi2);
1628+
return;
1629+
}
16231630
IJ.resetEscape();
16241631
ShapeRoi s1=null, s2=null;
16251632
for (int i=0; i<rois.length; i++) {
@@ -2078,6 +2085,11 @@ public int getCount() {
20782085
return listModel!=null?listModel.getSize():0;
20792086
}
20802087

2088+
/** Returns the count of selected ROIs. */
2089+
public int selected() {
2090+
return getSelectedIndexes().length;
2091+
}
2092+
20812093
/** Returns the index of the specified Roi, or -1 if it is not found. */
20822094
public int getRoiIndex(Roi roi) {
20832095
int n = getCount();

module-info.java

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module ij {
2+
requires java.desktop;
3+
requires java.rmi;
4+
requires java.compiler;
5+
requires java.scripting;
6+
exports ij;
7+
exports ij.gui;
8+
exports ij.io;
9+
exports ij.macro;
10+
exports ij.measure;
11+
exports ij.plugin;
12+
exports ij.plugin.filter;
13+
exports ij.plugin.frame;
14+
exports ij.plugin.tool;
15+
exports ij.process;
16+
exports ij.text;
17+
exports ij.util;
18+
}

release-notes.html

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,27 @@
55
</head>
66
<body>x
77

8-
<li> <u>1.53e4 23 August 2020</u>
8+
<li> <u>1.53e8 30 August 2020</u>
99
<ul>
10+
<li> The "Black background" option is set 'true' on startup and
11+
is not saved in the preferences file. Add
12+
setOption("BlackBackground", false) to Edit>Options>Startup
13+
to have it set to 'false' on startup.
1014
<li> Thanks to Kees Straatman, improved recording of the
1115
<i>Edit&gt;Selection&gt;Add to Manager</i> command.
16+
<li> Thanks to Michael Ellis, added a module-info.java file,
17+
used by the Java Module System, to the ImageJ source.
18+
<li> Thanks to 'mkhapp', added the RoiManager.selected macro DOCUMENT
19+
function, which returns the number of selected ROIs in the
20+
ROI Manager
21+
(<a href="http://wsr.imagej.net/macros/SetGroupDemo.txt">example</a>).
1222
<li> Thanks to Philippe Carl, fixed a bug that allowed multiple copies
1323
of the Color Picker to be opened.
1424
<li> Thanks to 'Ben', fixed a bug that caused the Table.get()
1525
macro function to return strings instead of numbers.
26+
<li> Thanks to Martin Hohne, fixed a 1.53c regression that caused
27+
the Counter popup menu in the Point Tool options Dialog
28+
to not work as expected .after switching to a different image.
1629
</ul>
1730

1831
<li> <u>1.53d 20 August 2020</u>

0 commit comments

Comments
 (0)