|
3 | 3 | import picocli.CommandLine; |
4 | 4 | import picocli.CommandLine.Command; |
5 | 5 |
|
| 6 | +import java.awt.HeadlessException; |
6 | 7 | import java.util.concurrent.Callable; |
7 | 8 |
|
8 | 9 | import scriptmanager.objects.ToolDescriptions; |
| 10 | + |
9 | 11 | import scriptmanager.cli.BAM_Format_Converter.BAMtoBEDCLI; |
10 | 12 | import scriptmanager.cli.BAM_Format_Converter.BAMtobedGraphCLI; |
11 | 13 | import scriptmanager.cli.BAM_Format_Converter.BAMtoGFFCLI; |
|
96 | 98 | public class ScriptManager implements Callable<Integer> { |
97 | 99 |
|
98 | 100 | @Override |
99 | | - public Integer call(){ |
100 | | - System.out.println( "Use '-h' or '--help' for command-line usage guide" ); |
101 | | - ScriptManagerGUI gui = new ScriptManagerGUI(); |
102 | | - gui.launchApplication(); |
103 | | - return(0); |
| 101 | + public Integer call() { |
| 102 | + try { |
| 103 | + ScriptManagerGUI gui = new ScriptManagerGUI(); |
| 104 | + System.out.println( "Use '-h' or '--help' for command-line usage guide" ); |
| 105 | + gui.launchApplication(); |
| 106 | + return(0); |
| 107 | + } catch (HeadlessException he) { |
| 108 | + he.printStackTrace(); |
| 109 | + System.out.println("\n" |
| 110 | + + "(ERROR!) Caught \"java.awt.HeadlessException\"" |
| 111 | + + "\n\n" |
| 112 | + + "====What does this mean?====\n" |
| 113 | + + "This usually means you attempted to access ScriptManager's GUI on a machine that does not have a graphical interface." |
| 114 | + + "\n\n" |
| 115 | + + "Please confirm you are working on a system that supports graphical interfaces and if it does not, you can...\n" |
| 116 | + + " 1. set up X11 forwarding or\n" |
| 117 | + + " 2. switch to using the command line interface (CLI):\n" |
| 118 | + + " - https://pughlab.mbg.cornell.edu/scriptmanager-docs/docs/Guides/Getting-Started/command-line" |
| 119 | + + "\n\n" |
| 120 | + ); |
| 121 | + } |
| 122 | + return(1); |
104 | 123 | } |
105 | 124 |
|
106 | 125 | public static void main(String[] args) { |
|
0 commit comments