import com.threerings.getdown.util.StringUtil;
import static com.threerings.getdown.Log.log;
import jalview.bin.StartupNotificationListener;
+import jalview.util.HttpUtils;
/**
* The main application entry point for Getdown.
*/
public class GetdownApp
{
- public static String startupFilesParameterString = "";
+ public static List<String> startupFilesParameters = new ArrayList<>();
/**
* The main entry point of the Getdown launcher application.
*/
log.info("-- OS Vers: " + System.getProperty("os.version"));
log.info("-- Java Vers: " + System.getProperty("java.version"));
log.info("-- Java Home: " + System.getProperty("java.home"));
+ log.info("-- Install4j Vers: " + Application.i4jVersion);
+ log.info("-- Install4j Template Vers: " + System.getProperty("installer_template_version"));
log.info("-- User Name: " + System.getProperty("user.name"));
log.info("-- User Home: " + System.getProperty("user.home"));
log.info("-- Cur dir: " + System.getProperty("user.dir"));
- log.info("-- launcher version: "+Build.version());
- log.info("-- startupFilesParameterString: " + startupFilesParameterString);
+ log.info("-- Launcher version: "+Build.version());
+ log.info("-- startupFilesParameterString: " + getStartupFilesParameterString(getStartupFilesParameters(), false));
+ log.info("-- getStartupFilesParameterString(): " + getStartupFilesParameterString(getStartupFilesParameters(), true));
log.info("---------------------------------------------");
Getdown app = new Getdown(envc) {
SwingUtil.centerWindow(_frame);
_frame.setVisible(true);
}
+ _shownContainer = true;
}
@Override
protected JFrame _frame;
};
- String startupFile = getStartupFilesParameterString();
- if (!StringUtil.isBlank(startupFile)) {
- Application.setStartupFilesFromParameterString(startupFile);
+ if (getStartupFilesParameters().size() > 0) {
+ Application.setStartupFilesFromParameters(getStartupFilesParameters());
}
app.start();
return app;
}
- public static void setStartupFilesParameterString(String parameters) {
- startupFilesParameterString = parameters;
+ public static void addStartupFilesParameter(String parameter) {
+ startupFilesParameters.add(parameter);
}
- public static String getStartupFilesParameterString() {
- return startupFilesParameterString;
+ public static List<String> getStartupFilesParameters() {
+ return startupFilesParameters;
+ }
+
+ public static String getStartupFilesParameterString(List<String> parameters, boolean changeJalviewSchemeUris) {
+ StringBuilder sb = new StringBuilder();
+ boolean first = true;
+ for(String f : parameters) {
+ if (first) {
+ first = false;
+ } else {
+ sb.append(' ');
+ }
+ String p = changeJalviewSchemeUris && HttpUtils.isJalviewSchemeUri(f) ? HttpUtils.equivalentJalviewUrl(f) : f;
+ if (p.contains(" ")) {
+ sb.append('"');
+ sb.append(p);
+ sb.append('"');
+ } else {
+ sb.append(p);
+ }
+ }
+ return sb.toString();
}
}