OSDN Git Service

オプションファイルに誤りがあった場合はエラーを送出する。
[coroid/inqubus.git] / frontend / src / saccubus / Saccubus.java
1 package saccubus;
2
3 import java.io.IOException;
4 import javax.swing.SwingUtilities;
5 import javax.swing.UIManager;
6
7 import saccubus.prompt.Prompt;
8
9 /**
10  * <p>
11  * \83^\83C\83g\83\8b\82³\82«\82ã\82Î\82·
12  * </p>
13  * 
14  * <p>
15  * \90à\96¾: \83j\83R\83j\83R\93®\89æ\82Ì\93®\89æ\82ð\83R\83\81\83\93\83g\82Â\82«\82Å\95Û\91
16  * </p>
17  * 
18  * <p>
19  * \92\98\8dì\8c : Copyright (c) 2007 PSI
20  * </p>
21  * 
22  * <p>
23  * \89ï\8eÐ\96¼:
24  * </p>
25  * 
26  * @author \96¢\93ü\97Í
27  * @version 1.0
28  */
29 public class Saccubus {
30         boolean packFrame = false;
31
32         /**
33          * \83A\83v\83\8a\83P\81[\83V\83\87\83\93\82Ì\8d\\92z\82Æ\95\\8e¦\81B
34          */
35         public Saccubus() {
36                 // \83\81\83C\83\93\83t\83\8c\81[\83\80\82Ì\8f\80\94õ
37                 MainFrame frame = new MainFrame();
38                 // validate() \82Í\83T\83C\83Y\82ð\92²\90®\82·\82é
39                 // pack() \82Í\97L\8cø\82È\83T\83C\83Y\8fî\95ñ\82ð\83\8c\83C\83A\83E\83g\82È\82Ç\82©\82ç\8eæ\93¾\82·\82é
40                 if (packFrame) {
41                         frame.pack();
42                 } else {
43                         frame.validate();
44                 }
45
46                 // \83E\83B\83\93\83h\83E\82ð\92\86\89\9b\82É\94z\92u
47                 frame.setLocationByPlatform(true);
48
49                 // \83X\83v\83\89\83b\83V\83\85\82Í\89B\82·
50                 // \83\81\83C\83\93\83t\83\8c\81[\83\80\95\\8e¦
51                 frame.setVisible(true);
52         }
53
54         /**
55          * \83A\83v\83\8a\83P\81[\83V\83\87\83\93\83G\83\93\83g\83\8a\83|\83C\83\93\83g\81B
56          * 
57          * @param args
58          *            String[]
59          */
60         public static void main(String[] args) throws IOException {
61                 //\88ø\90\94\82ª\97L\82é\8fê\8d\87\82ÍCUI\82Å\8bN\93®
62                 if (args.length > 0) {
63                         Prompt prompt = new Prompt();
64                         prompt.main(args);
65                         return;
66                 }
67                 //\88ø\90\94\82ª\96³\82¢\8fê\8d\87\82ÍGUI\82Å\8bN\93®
68                 SwingUtilities.invokeLater(new Runnable() {
69                         public void run() {
70                                 try {
71                                         UIManager.setLookAndFeel(UIManager
72                                                         .getSystemLookAndFeelClassName());
73                                 } catch (Exception exception) {
74                                         exception.printStackTrace();
75                                 }
76
77                                 new Saccubus();
78                         }
79                 });
80         }
81 }