OSDN Git Service

リファクタリング: メソッド導入
authoryukihane <yukihane.feather@gmail.com>
Wed, 24 Aug 2011 01:33:26 +0000 (10:33 +0900)
committeryukihane <yukihane.feather@gmail.com>
Wed, 24 Aug 2011 01:37:42 +0000 (10:37 +0900)
frontend/src/yukihane/inqubus/Main.java

index 9f18be9..16ef44f 100644 (file)
@@ -3,6 +3,7 @@ package yukihane.inqubus;
 import java.nio.file.FileSystem;
 import java.nio.file.FileSystems;
 import java.nio.file.Path;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.swing.UIManager;
 import javax.swing.UIManager.LookAndFeelInfo;
@@ -19,34 +20,24 @@ public class Main {
 
     private static final Logger logger = Logger.getLogger(Main.class.getName());
 
-//    public static void main(String[] args) {
-//        final FileSystem fileSystem = FileSystems.getDefault();
-//        final Path path = fileSystem.getPath("inqubus.xml");
-//        try {
-//            Properties.INSTANCE.load(path.toString());
-//        } catch (ConfigurationException ex) {
-//            logger.info("コンフィグファイルが無いためデフォルト値で起動");
-//        }
-//
-//        SwingUtilities.invokeLater(new Runnable() {
-//
-//            @Override
-//            public void run() {
-//                final MainFrame frame = new MainFrame();
-//                frame.setVisible(true);
-//            }
-//        });
-//
-//    }
     public static void main(String args[]) {
         final FileSystem fileSystem = FileSystems.getDefault();
         final Path path = fileSystem.getPath("inqubus.xml");
         try {
             Properties.INSTANCE.load(path.toString());
         } catch (ConfigurationException ex) {
-            logger.info("コンフィグファイルが無いためデフォルト値で起動");
+            logger.log(Level.FINE, "コンフィグファイルが無いためデフォルト値で起動", ex);
         }
+        setLookAndFeel();
+        java.awt.EventQueue.invokeLater(new Runnable() {
+
+            public void run() {
+                new MainFrame().setVisible(true);
+            }
+        });
+    }
 
+    private static void setLookAndFeel() {
         try {
             for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
                 if ("Nimbus".equals(info.getName())) {
@@ -61,11 +52,5 @@ public class Main {
                 // System Look & Feel も無いことは無いだろう
             }
         }
-        java.awt.EventQueue.invokeLater(new Runnable() {
-
-            public void run() {
-                new MainFrame().setVisible(true);
-            }
-        });
     }
 }