diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/commands/ManageSPIMBenchmark.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/commands/ManageSPIMBenchmark.java index f6e05832b6690660acc1cd696a463de5cb4f9883..ab4c6acc2027595b66a785ac15643b60e39989a5 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/commands/ManageSPIMBenchmark.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/commands/ManageSPIMBenchmark.java @@ -31,7 +31,7 @@ import net.imagej.ImageJ; * @author koz01 * */ -@Plugin(type = Command.class, headless = false, menuPath = "Plugins>SPIM benchmark") +@Plugin(type = Command.class, headless = false, menuPath = "Plugins>" + Constants.MENU_ITEM_NAME + ">" + Constants.SUBMENU_ITEM_NAME) public class ManageSPIMBenchmark implements Command { private static Logger log = LoggerFactory @@ -61,33 +61,33 @@ public class ManageSPIMBenchmark implements Command { @Override public void run() { try { - Path workingDirPath = Paths.get(workingDirectory.getPath()); + final Path workingDirPath = Paths.get(workingDirectory.getPath()); if (!Files.isDirectory(workingDirPath)) { Files.createDirectories(workingDirPath); } - FileLock fl = new FileLock(workingDirPath.resolve(LOCK_FILE_NAME)); + final FileLock fl = new FileLock(workingDirPath.resolve(LOCK_FILE_NAME)); if(!fl.tryLock()) { uiService.showDialog("Working directory is already used by someone else", MessageType.ERROR_MESSAGE); return; } try { - JDialog dialog = new BenchmarkSPIMWindow(null, + final JDialog dialog = new BenchmarkSPIMWindow(null, new BenchmarkSPIMParametersImpl(userName, password, Constants.PHONE, email, workingDirPath)); - dialog.setTitle("SPIM workflow computation manager"); + dialog.setTitle(Constants.MENU_ITEM_NAME + " " + Constants.SUBMENU_ITEM_NAME); dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); dialog.addWindowListener(new WindowAdapter() { @Override - public void windowClosing(WindowEvent e) { + public void windowClosing(final WindowEvent e) { super.windowClosing(e); fl.close(); } }); dialog.setVisible(true); - } catch(IOException e) { + } catch(final IOException e) { fl.close(); throw e; } - } catch (IOException e) { + } catch (final IOException e) { log.error(e.getMessage(), e); } diff --git a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/Constants.java b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/Constants.java index 57dc02e866f93af3c1321bfddba4e3e80c6010dd..abbe2062383515fe603e94bdfc075ba4b19985c0 100644 --- a/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/Constants.java +++ b/haas-spim-benchmark/src/main/java/cz/it4i/fiji/haas_spim_benchmark/core/Constants.java @@ -4,6 +4,10 @@ import java.util.LinkedHashMap; import java.util.Map; public interface Constants { + + String MENU_ITEM_NAME = "Multiview Reconstruction"; + String SUBMENU_ITEM_NAME = "Remote Workflow Manager"; + String PHONE = "123456789"; int HAAS_UPDATE_TIMEOUT = 30000; short UI_TO_HAAS_FREQUENCY_UPDATE_RATIO = 10;