1 package yukihane.inqubus;
3 import java.nio.file.FileSystem;
4 import java.nio.file.FileSystems;
5 import java.nio.file.Path;
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 FileSystem fileSystem = FileSystems.getDefault();
25 final Path path = fileSystem.getPath("inqubus.xml");
28 Config.INSTANCE.load(path.toString());
30 } catch (ConfigurationException ex) {
32 logger.log(Level.FINER, "コンフィグファイルが無いためデフォルト値で起動", ex);
34 final RunWindow invoke = new RunWindow(showWelcome);
35 java.awt.EventQueue.invokeLater(invoke);
38 private static class RunWindow implements Runnable {
39 private final boolean showWelcome;
40 private RunWindow(boolean showWelcome) {
41 this.showWelcome = showWelcome;
47 final MainFrame frame = new MainFrame();
49 JOptionPane.showMessageDialog(null, "<html>設定はメニューの <b>ツール > オプション</b> から行えます</html>", "いんきゅばすへようこそ", JOptionPane.INFORMATION_MESSAGE);
52 frame.setVisible(true);
56 private static void setLookAndFeel() {
58 for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
59 if ("Nimbus".equals(info.getName())) {
60 UIManager.setLookAndFeel(info.getClassName());
64 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
66 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
67 } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
68 // System Look & Feel も無いことは無いだろう