OSDN Git Service

add a little program 'chartool'
[sawarabi-fonts/sawarabi-fonts.git] / chartool / src / jp / sourceforge / sawarabifonts / chartool / MainPanel.java
1 /*
2  * Copyright (C) 2010, mshio <mshio@users.sourceforge.jp>
3  *
4  * This program is free software: you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  * ---
17  * Require JDK 1.5 (or later)
18  */
19 package jp.sourceforge.sawarabifonts.chartool;
20
21 import java.awt.BorderLayout;
22
23 import javax.swing.JPanel;
24 import javax.swing.SwingUtilities;
25 import javax.swing.border.EmptyBorder;
26
27 class MainPanel extends JPanel {
28         private static final long serialVersionUID = 7520947148504510083L;
29
30         public MainPanel(Main m) {
31                 GuiController c = new GuiController(m);
32                 final SearchPanel sp = new SearchPanel(c);
33                 PropertyPanel pp = new PropertyPanel(c);
34                 GlyphViewer gv = new GlyphViewer(c);
35
36                 EmptyBorder b = new EmptyBorder(10, 10, 10, 10);
37                 this.setBorder(b);
38                 this.setLayout(new BorderLayout());
39
40                 JPanel p = new JPanel();
41                 EmptyBorder e = new EmptyBorder(0, 10, 0, 0);
42                 p.setBorder(e);
43                 p.setLayout(new BorderLayout());
44                 p.add(sp, BorderLayout.NORTH);
45                 p.add(pp, BorderLayout.CENTER);
46                 this.add(p, BorderLayout.CENTER);
47
48                 this.add(gv, BorderLayout.WEST);
49
50                 SwingUtilities.invokeLater(new Runnable() {
51                         public void run() { sp.setFocus(); }
52                 });
53         }
54 }