diff --git a/src/main/java/bdv/BigDataViewer.java b/src/main/java/bdv/BigDataViewer.java index 7e05d08e..3c284bdd 100644 --- a/src/main/java/bdv/BigDataViewer.java +++ b/src/main/java/bdv/BigDataViewer.java @@ -773,22 +773,22 @@ public void collapseCardPanel() viewer.requestFocusInWindow(); } - public static void main( final String[] args ) - { - final String fn = "/Users/pietzsch/workspace/data/111010_weber_resave.xml"; - try - { - System.setProperty( "apple.laf.useScreenMenuBar", "true" ); + public static void main(final String[] args) { +// final String fn = "/Users/pietzsch/workspace/data/111010_weber_resave.xml"; + try { + System.setProperty("apple.laf.useScreenMenuBar", "true"); // System.setProperty( "apple.awt.application.appearance", "system" ); UIUtils.installFlatLafInfos(); - System.out.println( "reading config files from \"" + configDir + "\"" ); - final BigDataViewer bdv = open( fn, new File( fn ).getName(), new ProgressWriterConsole(), ViewerOptions.options() ); - + System.out.println("reading config files from \"" + configDir + "\""); + if (args.length > 0) { + final String fn = args[0]; + final BigDataViewer bdv = open(fn, new File(fn).getName(), new ProgressWriterConsole(), ViewerOptions.options()); // DumpInputConfig.writeToYaml( System.getProperty( "user.home" ) + "/.bdv/bdvkeyconfig.yaml", bdv.getViewerFrame() ); - } - catch ( final Exception e ) - { + } else { + throw new IOException("No input file selected !"); + } + } catch (final Exception e) { e.printStackTrace(); } }