1 package yukihane.inqubus;
3 import yukihane.inqubus.config.Config;
4 import java.nio.file.Path;
5 import java.nio.file.Paths;
6 import java.util.logging.Level;
7 import java.util.logging.Logger;
8 import javax.swing.JOptionPane;
9 import javax.swing.UIManager;
10 import javax.swing.UIManager.LookAndFeelInfo;
11 import javax.swing.UnsupportedLookAndFeelException;
12 import org.apache.commons.configuration.ConfigurationException;
13 import yukihane.inqubus.gui.MainFrame;
21 private static final Logger logger = Logger.getLogger(Main.class.getName());
23 public static void main(String args[]) {
24 final Path path = Paths.get("inqubus.xml");
27 Config.INSTANCE.load(path.toString());
29 } catch (ConfigurationException ex) {
31 logger.log(Level.FINER, "コンフィグファイルが無いためデフォルト値で起動", ex);
33 final RunWindow invoke = new RunWindow(showWelcome);
34 java.awt.EventQueue.invokeLater(invoke);
37 private static class RunWindow implements Runnable {
38 private final boolean showWelcome;
39 private RunWindow(boolean showWelcome) {
40 this.showWelcome = showWelcome;
46 final MainFrame frame = new MainFrame();
48 frame.setVisible(true);
50 JOptionPane.showMessageDialog(frame, "<html>設定はメニューの <b>ツール > オプション</b> から行えます</html>", "いんきゅばすへようこそ", JOptionPane.INFORMATION_MESSAGE);
55 private static void setLookAndFeel() {
57 for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
58 if ("Nimbus".equals(info.getName())) {
59 UIManager.setLookAndFeel(info.getClassName());
63 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
65 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
66 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
67 // System Look & Feel も無いことは無いだろう