package net.pterodactylus.jsite.main;
+import java.io.File;
+
+import net.pterodactylus.jsite.core.CoreImpl;
+import net.pterodactylus.jsite.core.NodeManager;
+import net.pterodactylus.jsite.core.ProjectManager;
+import net.pterodactylus.jsite.gui.SwingInterface;
+
/**
* Main class that is called by the VM.
- *
+ *
* @author David ‘Bombe’ Roden <bombe@freenetproject.org>
* @version $Id$
*/
/**
* Main entry method for the VM.
- *
+ *
* @param args
* The command-line arguments
*/
public static void main(String[] args) {
+ new Main().start();
+ }
+
+ /**
+ * Starts the core and the default {@link SwingInterface}.
+ */
+ private void start() {
+ CoreImpl core = new CoreImpl();
+
+ String configDirectory = System.getProperty("user.home") + File.separator + ".jSite";
+
+ ProjectManager projectManager = new ProjectManager(configDirectory);
+ core.setProjectManager(projectManager);
+
+ NodeManager nodeManager = new NodeManager("jSite-" + Version.getVersion(), configDirectory);
+ core.setNodeManager(nodeManager);
+
+ SwingInterface swingInterface = new SwingInterface(core, configDirectory);
+ core.addCoreListener(swingInterface);
+ swingInterface.start();
+
+ core.start();
}
}