import javax.swing.KeyStroke;
import javax.swing.WindowConstants;
-import com.install4j.api.launcher.StartupNotification;
import com.samskivert.swing.util.SwingUtil;
import com.threerings.getdown.data.Application;
import com.threerings.getdown.data.EnvConfig;
import com.threerings.getdown.util.LaunchUtil;
import com.threerings.getdown.util.StringUtil;
import static com.threerings.getdown.Log.log;
+import jalview.bin.StartupNotificationListener;
/**
* The main application entry point for Getdown.
}
if (abort) System.exit(-1);
+ log.info("Starting ....");
try
{
- StartupNotification.registerStartupListener(
- new StartupNotification.Listener() {
- @Override
- public void startupPerformed(String parameters)
- {
- log.warning("startupPerformed: '"+parameters+"'");
- setStartupFilesParameterString(parameters);
- }
- });
+ jalview.bin.StartupNotificationListener.setListener();
} catch (Exception e)
{
e.printStackTrace();
+ } catch (NoClassDefFoundError e)
+ {
+ log.warning("Starting without install4j classes");
+ } catch (Throwable t)
+ {
+ t.printStackTrace();
}
- //Thread.sleep(200);
-
// record a few things for posterity
log.info("------------------ VM Info ------------------");
log.info("-- OS Name: " + System.getProperty("os.name"));
log.warning("Failed to set background", "bg", _ifc.background, e);
}
- if (_ifc.iconImages != null) {
+ if (_ifc.iconImages != null && _ifc.iconImages.size() > 0) {
ArrayList<Image> icons = new ArrayList<>();
for (String path : _ifc.iconImages) {
Image img = loadImage(path);
protected JFrame _frame;
};
- /*
- log.warning("Startup file?",
- "paramstring", '"'+getStartupFilesParameterString()+'"',
- "isWindows", LaunchUtil.isWindows(),
- "argv.length", argv.length,
- "argv[0]", argv.length>0?argv[0]:"NULL",
- "argv[1]", argv.length>1?argv[1]:"NULL",
- "argv[2]", argv.length>2?argv[2]:"NULL",
- "argv[3]", argv.length>3?argv[3]:"NULL"
- );
- */
- if (getStartupFilesParameterString() != null && getStartupFilesParameterString().length() > 0) {
- app.setStartupFilesFromParameterString(getStartupFilesParameterString());
- } else if (
- getStartupFilesParameterString().length() == 0
- && LaunchUtil.isWindows()
- && argv.length >= 3
- && argv[0].equals(".")
- && argv[1].equals("noappid")
- && argv[2].endsWith("."+Application.locatorFileExtension)
- ) {
- log.info("Jalview Version Locator in args: "+argv[2]);
- app.setStartupFilesFromParameterString(argv[2]);
- String[] newArgv = new String[argv.length - 1];
- System.arraycopy(argv, 0, newArgv, 0, 2);
- System.arraycopy(argv, 3, newArgv, 2, argv.length - 3);
- argv = newArgv;
+
+ String startupFile = getStartupFilesParameterString();
+ if (!StringUtil.isBlank(startupFile)) {
+ Application.setStartupFilesFromParameterString(startupFile);
}
+
app.start();
return app;
}