Skip to content

Commit

Permalink
2024.09.24 (1.54m1; CommandFinder)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasband committed Sep 24, 2024
1 parent 8dc9bdc commit 7d8d18b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 11 deletions.
4 changes: 2 additions & 2 deletions ij/ImageJ.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public class ImageJ extends Frame implements ActionListener,
MouseListener, KeyListener, WindowListener, ItemListener, Runnable {

/** 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 = "";
public static final String VERSION = "1.54m";
public static final String BUILD = "1";
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);
Expand Down
22 changes: 14 additions & 8 deletions ij/plugin/CommandFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,22 @@ protected String[] makeRow(String command, CommandAction ca) {
}

protected void populateList(String matchingSubstring) {
String substring = matchingSubstring.toLowerCase();
String[] words = matchingSubstring.toLowerCase().split("\\s+"); // Split the search string into words
ArrayList list = new ArrayList();
int count = 0;
for (int i = 0; i < commands.length; ++i) {
for (int i = 0; i<commands.length; ++i) {
String commandName = commands[i];
String command = commandName.toLowerCase();
CommandAction ca = (CommandAction) commandsHash.get(commandName);
String menuPath = ca.menuLocation;
if (menuPath == null)
menuPath = "";
menuPath = menuPath.toLowerCase();
if (command.indexOf(substring) >= 0 || menuPath.indexOf(substring) >= 0) {
String menuPath = (ca.menuLocation != null) ? ca.menuLocation.toLowerCase() : "";
// Check if all words match either the command or the menu path
boolean allWordsMatch = true;
for (String word : words) {
if (!(command.contains(word) || menuPath.contains(word))) {
allWordsMatch = false;
break;
}
}
if (allWordsMatch) {
String[] row = makeRow(commandName, ca);
list.add(row);
}
Expand Down Expand Up @@ -160,6 +164,8 @@ public void mouseClicked(MouseEvent e) {
int row = table.getSelectedRow();
int col = table.getSelectedColumn();
// Display cell contents in status bar
if (tableModel==null)
return;
String value = tableModel.getValueAt(row, col).toString();
IJ.showStatus(value);
// Is this fast enough to be a double-click?
Expand Down
2 changes: 2 additions & 0 deletions ij/plugin/Duplicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public void run(String arg) {
ignoreSelection = (staticIgnoreSelection||ignoreNextSelection) && Macro.getOptions()==null;
if (!IJ.altKeyDown()||stackSize>1) {
if (imp.isHyperStack() || imp.isComposite()) {
if (roiOutside)
imp.deleteRoi();
duplicateHyperstack(imp, newTitle);
if (isRotatedRect)
straightenRotatedRect(impA, roiA, IJ.getImage());
Expand Down
13 changes: 12 additions & 1 deletion release-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
</head>
<body>


<li> <u>1.54m1 24 September 2024</u>
<ul>
<li> Thanks to Kevin Terretaz, CommandFinder
(<i>Plugins&gt;Utilities&gt;Find Commands</i>) filtering is more
precise and flexible. It now splits the input into individual words
and returns commands where all words are found in either the command
name or the menu path.
<li> Thanks to Bram van den Broek, fixed bug with duplicating hyperstacks when
the selection was outside the image border.
</ul>

<li> <u>1.54k 15 September 2024</u>
<ul>
<li> Thanks to 'Carlos', added the RoiManager.delete(index) macro function
Expand Down Expand Up @@ -66,7 +78,6 @@
<li> Thanks to Felix Rudolphi and Curtis Rueden, fixed a
1.54i regression that caused FileOpener to throw
HeadlessExceptions in headless environments.

</ul>

<li> <u>1.54j 12 June 2024</u>
Expand Down

0 comments on commit 7d8d18b

Please sign in to comment.