forked from fiji/SNT
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GUI: Add (minor) convenience access to Spot Spine
- Loading branch information
Showing
5 changed files
with
57 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/sc/fiji/snt/gui/cmds/SpotSpineLoaderCmd.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package sc.fiji.snt.gui.cmds; | ||
|
||
import net.imagej.legacy.LegacyService; | ||
import org.scijava.command.Command; | ||
import org.scijava.plugin.Parameter; | ||
import org.scijava.plugin.Plugin; | ||
import org.scijava.util.Types; | ||
import sc.fiji.snt.gui.GuiUtils; | ||
|
||
/** | ||
* Implements the 'Open Spot Spine...' command. | ||
* | ||
* @author Tiago Ferreira | ||
*/ | ||
@Plugin(type = Command.class, visible = false) | ||
public class SpotSpineLoaderCmd implements Command { | ||
|
||
private static final String DOC_PAGE = "https://imagej.net/plugins/spot-spine#installation"; | ||
private static final String CLASS = "spine_sources.Spine3D_All"; | ||
|
||
@Parameter | ||
LegacyService legacyService; | ||
|
||
@Override | ||
public void run() { | ||
if (Types.load(CLASS) != null) { | ||
legacyService.runLegacyCommand(CLASS, ""); | ||
return; | ||
} | ||
final boolean openDoc = new GuiUtils().getConfirmation("Spot Spine does not seem to be available. Please " + | ||
"install it by following the installation details on imagej.net. Open documentation page now?", | ||
"Spot Spine Not Installed", "Yes. Open In Browser", "No. Dismiss"); | ||
if (openDoc) | ||
legacyService.runLegacyCommand("ij.plugin.BrowserLauncher", DOC_PAGE); | ||
} | ||
|
||
} |