diff --git a/compile-js-dev.sh b/compile-js-dev.sh
index 70ae2eac6..19d16c53a 100644
--- a/compile-js-dev.sh
+++ b/compile-js-dev.sh
@@ -3,11 +3,12 @@
set -e
-IJ_JAR="ij-1.53e.jar"
+IJ_JAR="ij-1.53f.jar"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+mvn clean
mvn install:install-file -Dfile=${CHEERPJ_DIR}/cheerpj-dom.jar -DgroupId=com.learningtech -DartifactId=cheerpj-dom -Dversion=1.0 -Dpackaging=jar
-mvn -Pdeps package
+mvn package
cp target/${IJ_JAR} ${IJ_DIR}/
cd ${IJ_DIR}
diff --git a/compile-js.sh b/compile-js.sh
index b764a86db..75a662258 100644
--- a/compile-js.sh
+++ b/compile-js.sh
@@ -17,7 +17,7 @@ fi
# compile imagej
mvn install:install-file -Dfile=${CHEERPJ_DIR}/cheerpj-dom.jar -DgroupId=com.learningtech -DartifactId=cheerpj-dom -Dversion=1.0 -Dpackaging=jar
-mvn -Pdeps package
+mvn package
mkdir -p imagej-js-dist
@@ -25,7 +25,7 @@ cd imagej-js-dist
# download ij153 from imagej.net
export IJ1_VERSION=ij153
-export IJ_JAR=ij-1.53e.jar
+export IJ_JAR=ij-1.53f.jar
curl http://wsr.imagej.net/distros/cross-platform/${IJ1_VERSION}.zip -LO
unzip -q -o ${IJ1_VERSION}.zip
diff --git a/pom.xml b/pom.xml
index e76851f5c..1487c0f0a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -118,13 +118,12 @@
- 9
+ 8
**/MacAdapter.java
- 9
diff --git a/src/main/java/ij/IJ.java b/src/main/java/ij/IJ.java
index 563bcbe58..c7c792919 100644
--- a/src/main/java/ij/IJ.java
+++ b/src/main/java/ij/IJ.java
@@ -155,7 +155,7 @@ retrieved in the called macro using the getArgument() macro
function. Returns any string value returned by the macro, null
if the macro does not return a value, or "[aborted]" if the
macro was aborted due to an error. */
- public static String runMacro(String macro, String arg) {
+ public static String runMacro(final String macro, final String arg) {
if(EventQueue.isDispatchThread()){
Macro_Runner mr = new Macro_Runner();
return mr.runMacro(macro, arg);
diff --git a/src/main/java/ij/ImagePlus.java b/src/main/java/ij/ImagePlus.java
index 096585975..00de50d56 100644
--- a/src/main/java/ij/ImagePlus.java
+++ b/src/main/java/ij/ImagePlus.java
@@ -1089,7 +1089,7 @@ public void setTitle(String title) {
if (title==null)
return;
if (win!=null) {
- if (ij!=null)
+ if (ij!=null && !title.equals(this.title))
Menus.updateWindowMenuItem(this, this.title, title);
String virtual = stack!=null && stack.isVirtual()?" (V)":"";
String global = getGlobalCalibration()!=null?" (G)":"";
diff --git a/src/main/java/ij/Menus.java b/src/main/java/ij/Menus.java
index 2b42448ab..265d7542f 100644
--- a/src/main/java/ij/Menus.java
+++ b/src/main/java/ij/Menus.java
@@ -1423,12 +1423,13 @@ public static synchronized void updateWindowMenuItem(ImagePlus imp, String oldLa
for (int i=first; i-1)
label = label.substring(0, index);
}
- if (item!=null && label.equals(oldLabel)) {
+ if (item!=null && label.equals(oldLabel) && (imp==null||(""+imp.getID()).equals(cmd))) {
String size = "";
if (imp!=null)
size = " " + ImageWindow.getImageSize(imp);
diff --git a/src/main/java/ij/gui/ImageCanvas.java b/src/main/java/ij/gui/ImageCanvas.java
index d1ee0f4b2..290b17a5d 100644
--- a/src/main/java/ij/gui/ImageCanvas.java
+++ b/src/main/java/ij/gui/ImageCanvas.java
@@ -23,7 +23,7 @@
/** This is a Canvas used to display images in a Window. */
public class ImageCanvas extends Canvas implements MouseListener, MouseMotionListener, Cloneable {
- private static final int LONG_PRESS_THRESHOLD = 750; //ms
+ private static final int LONG_CLICK_THRESHOLD = 750; //ms
protected static Cursor defaultCursor = new Cursor(Cursor.DEFAULT_CURSOR);
protected static Cursor handCursor = new Cursor(Cursor.HAND_CURSOR);
protected static Cursor moveCursor = new Cursor(Cursor.MOVE_CURSOR);
@@ -1230,7 +1230,8 @@ else if (!e.isAltDown()) {
}
if (pressTimer==null)
- pressTimer = new java.util.Timer();
+ pressTimer = new java.util.Timer();
+ final Point cursorLoc = getCursorLoc();
pressTimer.schedule(new TimerTask() {
public void run() {
if (pressTimer != null) {
@@ -1245,13 +1246,14 @@ public void run() {
boolean unchanged = state!=Roi.MOVING_HANDLE && r1!=null && r2!=null && r2.x==r1.x
&& r2.y==r1.y && r2.width==r1.width && r2.height==r1.height && size2==size1
&& !(size2>1&&state==Roi.CONSTRUCTING);
+ boolean cursorMoved = !getCursorLoc().equals(cursorLoc);
//IJ.log(size2+" "+empty+" "+unchanged+" "+state+" "+roi1+" "+roi2);
if ((roi1==null && (size2<=1||empty)) || unchanged) {
if (roi1==null) imp.deleteRoi();
- handlePopupMenu(e);
+ if (!cursorMoved) handlePopupMenu(e);
}
}
- }, LONG_PRESS_THRESHOLD);
+ }, LONG_CLICK_THRESHOLD);
}
diff --git a/src/main/java/ij/gui/Toolbar.java b/src/main/java/ij/gui/Toolbar.java
index ce481d547..86d32629f 100644
--- a/src/main/java/ij/gui/Toolbar.java
+++ b/src/main/java/ij/gui/Toolbar.java
@@ -4,7 +4,9 @@
import java.awt.event.*;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
-import javax.swing.*;
+import javax.swing.JPopupMenu;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JMenuItem;
import java.io.File;
import java.util.*;
import ij.*;
@@ -42,7 +44,7 @@ public class Toolbar extends Canvas implements MouseListener, MouseMotionListene
public static final int CUSTOM7 = 21;
public static final int DOUBLE_CLICK_THRESHOLD = 650; //ms
- private static final int LONG_PRESS_THRESHOLD = 500; //ms
+ private static final int LONG_CLICK_THRESHOLD = 500; //ms
public static final int RECT_ROI=0, ROUNDED_RECT_ROI=1, ROTATED_RECT_ROI=2;
public static final int OVAL_ROI=0, ELLIPSE_ROI=1, BRUSH_ROI=2;
@@ -626,8 +628,8 @@ private void showMessage(int tool) {
IJ.showStatus(name);
return;
}
- String hint = " (long press to switch)";
- String hint2 = " (long press to switch; double click to configure)";
+ String hint = " (alt or long click to switch)";
+ String hint2 = " (alt or long click to switch; double click to configure)";
switch (tool) {
case RECTANGLE:
if (rectType==ROUNDED_RECT_ROI)
@@ -676,7 +678,7 @@ else if (ovalType==ELLIPSE_ROI)
IJ.showStatus("Text tool (double-click to configure)");
return;
case MAGNIFIER:
- IJ.showStatus("Magnifying glass (or \"+\" and \"-\" keys; long press for menu)");
+ IJ.showStatus("Magnifying glass (or \"+\" and \"-\" keys; alt or long click for menu)");
return;
case HAND:
IJ.showStatus("Scrolling tool (or press space bar and drag)");
@@ -684,7 +686,7 @@ else if (ovalType==ELLIPSE_ROI)
case DROPPER:
String fg = foregroundColor.getRed() + "," + foregroundColor.getGreen() + "," + foregroundColor.getBlue();
String bg = backgroundColor.getRed() + "," + backgroundColor.getGreen() + "," + backgroundColor.getBlue();
- IJ.showStatus("Color picker " + fg + "/"+ bg + " (long press for menu)");
+ IJ.showStatus("Color picker " + fg + "/"+ bg + " (long click for menu)");
return;
case ANGLE:
IJ.showStatus("Angle tool");
@@ -1249,7 +1251,7 @@ public void run() {
}
triggerPopupMenu(newTool, e, true, true);
}
- }, LONG_PRESS_THRESHOLD);
+ }, LONG_CLICK_THRESHOLD);
}
}
diff --git a/src/main/java/ij/io/Opener.java b/src/main/java/ij/io/Opener.java
index ac7080ff2..dccc544e1 100644
--- a/src/main/java/ij/io/Opener.java
+++ b/src/main/java/ij/io/Opener.java
@@ -89,7 +89,7 @@ public void open() {
* @see ij.IJ#open(String)
* @see ij.IJ#openImage(String)
*/
- public void open(String path) {
+ public void open(final String path) {
if(!path.startsWith("http") || EventQueue.isDispatchThread()){
openPath(path);
}
diff --git a/src/main/java/ij/module-info.java b/src/main/java/ij/module-info.java
deleted file mode 100644
index f1218bc26..000000000
--- a/src/main/java/ij/module-info.java
+++ /dev/null
@@ -1,18 +0,0 @@
-module ij {
- requires java.desktop;
- requires java.rmi;
- requires java.compiler;
- requires java.scripting;
- exports ij;
- exports ij.gui;
- exports ij.io;
- exports ij.macro;
- exports ij.measure;
- exports ij.plugin;
- exports ij.plugin.filter;
- exports ij.plugin.frame;
- exports ij.plugin.tool;
- exports ij.process;
- exports ij.text;
- exports ij.util;
-}
\ No newline at end of file
diff --git a/src/main/java/ij/plugin/SimpleCommands.java b/src/main/java/ij/plugin/SimpleCommands.java
index 02b0b45ec..0552b9552 100644
--- a/src/main/java/ij/plugin/SimpleCommands.java
+++ b/src/main/java/ij/plugin/SimpleCommands.java
@@ -233,8 +233,8 @@ private void showDirectory(String arg) {
IJ.error("Folder not found: " + arg);
return;
}
- if (arg.equals("image")&& IJ.getImage() != null) {
- File imgPath = new File(dir + File.separator + IJ.getImage().getTitle());
+ if (arg.equals("image")&& IJ.getImage()!=null) {
+ File imgPath = new File(IJ.getDir("image"));
if (!imgPath.exists()) {
IJ.error("Image not found");
return;