/** The application core. */
private final Core core;
-
+
/** The configuration directory. */
- private String configDirectory;
+ private final String configDirectory;
/** The main window. */
private MainWindow mainWindow;
*
* @param core
* The core to operate on
+ * @param configDirectory
+ * The directory the configuration is stored in
*/
- public SwingInterface(Core core) {
+ public SwingInterface(Core core, String configDirectory) {
this.core = core;
+ this.configDirectory = configDirectory;
I18n.setLocale(Locale.ENGLISH); /* TODO - load config */
loadConfig();
if (beautify) {
return addProjectAction;
}
- /**
- * Sets the configuration directory.
- *
- * @param configDirectory
- * The directory the configuration is stored in
- */
- public void setConfigDirectory(String configDirectory) {
- this.configDirectory = configDirectory;
- }
-
//
// ACTIONS
//
/* initialize default stuff. */
beautify = false;
/* now read config. */
+ System.out.println("configDirectory: “" + configDirectory + "”");
File configFile = new File(configDirectory, "swing-interface.properties");
if (!configFile.exists() || !configFile.canRead() || !configFile.isFile()) {
System.err.println("could not find “" + configFile.getAbsolutePath() + "”!");
ProjectManager projectManager = new ProjectManager(configDirectory);
core.setProjectManager(projectManager);
- SwingInterface swingInterface = new SwingInterface(core);
+ SwingInterface swingInterface = new SwingInterface(core, configDirectory);
core.addCoreListener(swingInterface);
- swingInterface.setConfigDirectory(configDirectory);
swingInterface.start();
core.start();