OSDN Git Service

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