X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fmain%2FMain.java;h=2400250e61f7fe989ff1ed7037dcff84ea6582bb;hb=c9724dfaa5c1aeac0e39243981717c11e66b7f1f;hp=c83dd4652e2e409ecfdec6ebd5eba8b43ce50005;hpb=587428e890799ee0c6d3a3224e4a161a3480811d;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/main/Main.java b/src/net/pterodactylus/jsite/main/Main.java index c83dd46..2400250 100644 --- a/src/net/pterodactylus/jsite/main/Main.java +++ b/src/net/pterodactylus/jsite/main/Main.java @@ -29,22 +29,21 @@ import javax.swing.UIManager.LookAndFeelInfo; import net.pterodactylus.jsite.core.CoreImpl; import net.pterodactylus.jsite.core.NodeManager; +import net.pterodactylus.jsite.core.ProjectManager; import net.pterodactylus.jsite.core.RequestManager; import net.pterodactylus.jsite.gui.SwingInterface; -import net.pterodactylus.jsite.project.ProjectManager; import net.pterodactylus.util.logging.Logging; /** * Main class that is called by the VM. - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> - * @version $Id$ */ public class Main { /** * Main entry method for the VM. - * + * * @param args * The command-line arguments */ @@ -58,7 +57,6 @@ public class Main { private void start() { Logging.setup("jSite"); - addLookAndFeel("NimROD", "com.nilo.plaf.nimrod.NimRODLookAndFeel"); CoreImpl core = new CoreImpl(); String configDirectory = System.getProperty("user.home") + File.separator + ".jSite"; @@ -67,16 +65,14 @@ public class Main { core.setNodeManager(nodeManager); nodeManager.addNodeListener(core); + RequestManager requestManager = new RequestManager(nodeManager); + nodeManager.addNodeListener(requestManager); + core.setRequestManager(requestManager); + ProjectManager projectManager = new ProjectManager(configDirectory); core.setProjectManager(projectManager); projectManager.setNodeManager(nodeManager); - RequestManager requestManager = new RequestManager(); - core.setRequestManager(requestManager); - nodeManager.addNodeListener(requestManager); - requestManager.setNodeManager(nodeManager); - requestManager.addRequestListener(core); - SwingInterface swingInterface = new SwingInterface(core, configDirectory); core.addCoreListener(swingInterface); Logging.addLoggingListener(swingInterface); @@ -87,7 +83,7 @@ public class Main { /** * Tries to load the class with the given name and includes the look & feel * in the UIManager, if it exists. - * + * * @param name * The name of the look & feel * @param className @@ -99,16 +95,16 @@ public class Main { } /** - * Tries to load each look & feel and adds it to the list of installed look & - * feels. - * + * Tries to load each look & feel and adds it to the list of installed look + * & feels. + * * @see UIManager#setInstalledLookAndFeels(LookAndFeelInfo[]) * @param lookAndFeelInfos * The look & feels to add */ private void addLookAndFeels(LookAndFeelInfo... lookAndFeelInfos) { List allLookAndFeelInfos = new ArrayList(Arrays.asList(UIManager.getInstalledLookAndFeels())); - for (LookAndFeelInfo lookAndFeelInfo: lookAndFeelInfos) { + for (LookAndFeelInfo lookAndFeelInfo : lookAndFeelInfos) { try { Class.forName(lookAndFeelInfo.getClassName()); allLookAndFeelInfos.add(lookAndFeelInfo); @@ -116,7 +112,7 @@ public class Main { /* okay, it doesn't exist, ignore. */ } } - UIManager.setInstalledLookAndFeels(allLookAndFeelInfos.toArray(new LookAndFeelInfo[0])); + UIManager.setInstalledLookAndFeels(allLookAndFeelInfos.toArray(new LookAndFeelInfo[allLookAndFeelInfos.size()])); } }