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