* then we create an empty up an empty PtolemyEffigy.
* @return A configuration for when there no command-line arguments.
* @exception Exception If the configuration cannot be opened.
*/
protected Configuration _createEmptyConfiguration() throws Exception {
Configuration configuration = _createDefaultConfiguration();
URL welcomeURL = null;
URL introURL = null;
ModelDirectory directory = configuration.getDirectory();
Parameter applicationBlankPtolemyEffigyAtStartup = (Parameter) configuration
.getAttribute("_applicationBlankPtolemyEffigyAtStartup",
Parameter.class);
if ((applicationBlankPtolemyEffigyAtStartup != null)
&& applicationBlankPtolemyEffigyAtStartup.getExpression()
.equals("true")) {
PtolemyEffigy.Factory factory = new PtolemyEffigy.Factory(
directory, directory.uniqueName("ptolemyEffigy"));
Effigy effigy = factory.createEffigy(directory, null, null);
configuration.createPrimaryTableau(effigy);
}
try {
// First, we see if we can find the welcome window by
// looking at the default configuration.
// FIXME: this seems wrong, we should be able to get
// an attribute from the configuration that names the
// welcome window.
String configurationURLString = _configurationURL.toExternalForm();
String base = configurationURLString.substring(0,
configurationURLString.lastIndexOf("/"));
welcomeURL = specToURL(base + "/welcomeWindow.xml");
introURL = specToURL(base + "/intro.htm");
_parser.reset();
_parser.setContext(configuration);
_parser.parse(welcomeURL, welcomeURL);
} catch (Throwable throwable) {
// OK, that did not work, try a different method.
if (_configurationSubdirectory == null) {
_configurationSubdirectory = "full";
}
// FIXME: This code is Dog slow for some reason.
welcomeURL = specToURL(_basePath + "/" + _configurationSubdirectory
+ "/welcomeWindow.xml");
introURL = specToURL(_basePath + "/" + _configurationSubdirectory
+ "/intro.htm");
_parser.reset();
_parser.setContext(configuration);
_parser.parse(welcomeURL, welcomeURL);
}
Effigy doc = (Effigy) configuration.getEntity("directory.doc");
doc.identifier.setExpression(introURL.toExternalForm());
return configuration;
}