From 85256a7793885d5c258c5fa33003ba8e8b362648 Mon Sep 17 00:00:00 2001 From: Tiago Date: Wed, 30 Nov 2016 14:14:40 -0500 Subject: [PATCH] UI tweaks: - Reword menu entries - Move Sholl Analysis offline help to Analysis menu - Disable "Arrange plane" command when tracing with a single canvas --- .../tracing/NeuriteTracerResultsDialog.java | 61 ++++++++++++------- 1 file changed, 40 insertions(+), 21 deletions(-) diff --git a/src/main/java/tracing/NeuriteTracerResultsDialog.java b/src/main/java/tracing/NeuriteTracerResultsDialog.java index 76e96e617..1031c7c46 100644 --- a/src/main/java/tracing/NeuriteTracerResultsDialog.java +++ b/src/main/java/tracing/NeuriteTracerResultsDialog.java @@ -28,6 +28,7 @@ package tracing; import sc.fiji.skeletonize3D.Skeletonize3D_; +import sholl.Sholl_Analysis; import stacks.ThreePanes; import features.SigmaPalette; import ij.IJ; @@ -36,6 +37,7 @@ import ij.Prefs; import ij.WindowManager; import ij.gui.GenericDialog; +import ij.gui.HTMLDialog; import ij.gui.StackWindow; import ij.gui.WaitForUserDialog; import ij.gui.YesNoCancelDialog; @@ -786,7 +788,7 @@ public NeuriteTracerResultsDialog( String title, analysisMenu.add(makeLineStackMenuItem); analysisMenu.addSeparator(); - addPathsToOverlayMenuItem = new JMenuItem("Add paths to canvas(es) overlay..."); + addPathsToOverlayMenuItem = new JMenuItem("Add paths to overlay..."); addPathsToOverlayMenuItem.addActionListener(this); analysisMenu.add(addPathsToOverlayMenuItem); addPathsToManagerMenuItem = new JMenuItem("Export paths to ROI Manager"); @@ -794,6 +796,8 @@ public NeuriteTracerResultsDialog( String title, analysisMenu.add(addPathsToManagerMenuItem); analysisMenu.addSeparator(); + analysisMenu.add(shollAnalysisHelpMenuItem()); + analysisMenu.addSeparator(); exportCSVMenuItemAgain = new JMenuItem("Export as CSV..."); exportCSVMenuItemAgain.addActionListener(this); analysisMenu.add(exportCSVMenuItemAgain); @@ -810,19 +814,20 @@ public NeuriteTracerResultsDialog( String title, viewMenu.add(drawDiametersXYMenuItem); viewMenu.addSeparator(); - xyCanvasMenuItem = new JCheckBoxMenuItem("Hide XY pane"); + xyCanvasMenuItem = new JCheckBoxMenuItem("Hide XY plane"); xyCanvasMenuItem.addItemListener(this); viewMenu.add(xyCanvasMenuItem); - zyCanvasMenuItem = new JCheckBoxMenuItem("Hide ZY pane"); + zyCanvasMenuItem = new JCheckBoxMenuItem("Hide ZY plane"); zyCanvasMenuItem.setEnabled(!plugin.getSinglePane()); zyCanvasMenuItem.addItemListener(this); viewMenu.add(zyCanvasMenuItem); - xzCanvasMenuItem = new JCheckBoxMenuItem("Hide XZ pane"); + xzCanvasMenuItem = new JCheckBoxMenuItem("Hide XZ plane"); xzCanvasMenuItem.setEnabled(!plugin.getSinglePane()); xzCanvasMenuItem.addItemListener(this); viewMenu.add(xzCanvasMenuItem); viewMenu.addSeparator(); arrangeWindowsMenuItem = new JMenuItem("Arrange planes"); + arrangeWindowsMenuItem.setEnabled(!plugin.getSinglePane()); arrangeWindowsMenuItem.addActionListener(this); viewMenu.add(arrangeWindowsMenuItem); @@ -1696,9 +1701,20 @@ private JMenu helpMenu() { mi = menuItemTrigerringURL("List of shortcuts", URL + ":_Key_Shortcuts"); helpMenu.add(mi); helpMenu.addSeparator(); - mi = menuItemTrigerringURL("Sholl analysis: Online help", URL + ":_Sholl_analysis"); + mi = menuItemTrigerringURL("Sholl analysis walkthrough", URL + ":_Sholl_analysis"); + helpMenu.add(mi); + helpMenu.addSeparator(); + mi = menuItemTrigerringURL("Ask a question", "http://forum.imagej.net"); + helpMenu.add(mi); + helpMenu.addSeparator(); + mi = menuItemTrigerringURL("Citing SNT...", URL + "#Citing_Simple_Neurite_Tracer"); helpMenu.add(mi); - mi = new JMenuItem("Sholl analysis: Offline help"); + return helpMenu; + } + + private JMenuItem shollAnalysisHelpMenuItem() { + JMenuItem mi; + mi = new JMenuItem("Sholl Analysis..."); mi.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { @@ -1707,26 +1723,29 @@ public void actionPerformed(final ActionEvent e) { public void run() { String modKey = IJ.isMacOSX() ? "Alt" : "Ctrl"; modKey += "+Shift"; - final String instructions = "To manually select the center of analysis:\n" - + " 1. Mouse over the path of interest and press \"G\" to activate it\n" - + " 2. Press \"" + modKey + "\" to select a point along the path\n" - + " 3. Press \"" + modKey + "+A\" to initiate Sholl analysis\n \n" - + "For batch processing run \"Sholl Analysis (Tracings)...\"."; - final WaitForUserDialog wd = new WaitForUserDialog("Sholl Analysis Cheat Sheet", instructions); - wd.show(); + final String url1 = Sholl_Analysis.URL + "#Analysis_of_Traced_Cells"; + final String url2 = "http://imagej.net/Simple_Neurite_Tracer/:_Sholl_analysis"; + final StringBuilder sb = new StringBuilder(); + sb.append(""); + sb.append("
"); + sb.append("To initiate Sholl Analysis, "); + sb.append("you must first select a focal point:"); + sb.append("
    "); + sb.append("
  1. Mouse over the path of interest. Press \"G\" to activate it
  2. "); + sb.append("
  3. Press \"").append(modKey).append("\" to select a point along the path
  4. "); + sb.append("
  5. Press \"").append(modKey).append("+A\" to start analysis
  6. "); + sb.append("
"); + sb.append("A detailed walkthrough is also available online. "); + sb.append("For batch processing, run Analyze>Sholl>Sholl Analysis (Tracings).... "); + new HTMLDialog("Sholl Analysis How-to", sb.toString(), false); } }); newThread.start(); } }); - helpMenu.add(mi); - helpMenu.addSeparator(); - mi = menuItemTrigerringURL("Ask a question", "http://forum.imagej.net"); - helpMenu.add(mi); - helpMenu.addSeparator(); - mi = menuItemTrigerringURL("Citing SNT...", URL + "#Citing_Simple_Neurite_Tracer"); - helpMenu.add(mi); - return helpMenu; + return mi; } public static JMenuItem menuItemTrigerringURL(final String label, final String URL) {