1 package hayashi.yuu.gpx.gui;
4 import java.awt.event.*;
13 @SuppressWarnings("serial")
14 public class TouchScreen extends JFrame implements Runnable
16 MainPanel mainPanel; // キャビネット内のキータグ状況を表す
24 public TouchScreen(String siteName) throws Exception {
26 this.setUndecorated(true);
28 this.startModePanel = new StartModePanel(this);
30 setLayout(new BorderLayout());
31 this.setVisible(false);
32 this.setSize(800, 600);
36 * 'proxSafe Commander3'のロゴイメージと、ターミナル名称
40 TitlePanel titlePanel = new TitlePanel();
41 add(BorderLayout.NORTH, titlePanel);
50 add(BorderLayout.CENTER, mainPanel);
56 FooterPanel footerPanel = new FooterPanel(siteName);
57 add(BorderLayout.SOUTH, footerPanel);
60 SymWindow aSymWindow = new SymWindow();
61 addWindowListener(aSymWindow);
66 /////////////////////////////////////////////////////////////////////////////////////////////////
73 //Thread threadA = new Thread(this);
77 public void setVisible(boolean b) {
79 // デスクトップ中央にJFrameを配置する
80 Dimension paneSize = this.getSize();
81 Dimension screenSize = this.getToolkit().getScreenSize();
82 this.setLocation((screenSize.width - paneSize.width) / 2, (screenSize.height - paneSize.height) / 2);
87 public void addNotify() {
88 Dimension d = getSize();
90 setSize(getInsets().left + getInsets().right + d.width, getInsets().top + getInsets().bottom + d.height);
91 Component components[] = getComponents();
92 for(int i = 0; i < components.length; i++) {
93 Point p = components[i].getLocation();
94 p.translate(getInsets().left, getInsets().top);
95 components[i].setLocation(p);
103 public void FrameClosing(WindowEvent event) {
109 class SymWindow extends WindowAdapter
111 public void windowClosing(WindowEvent event) {
112 Object object = event.getSource();
113 if(object == TouchScreen.this) {
119 /////////////////////////////////////////////////////////////////////////////////////////////////
123 protected StartModePanel startModePanel;
125 protected UnregisteredModePanel unregisteredModePanel;
126 protected BusyModePanel busyModePanel;
132 public int screenMode = START_MODE; // 現在のスクリーンモードを保持する
133 static final int START_MODE = 0; // ニュートラル
134 static final int USER_MODE = 1; // ユーザー認証済み(キー選択)
135 static final int UNREGISTERED_MODE = 2; // 未登録カードモード
136 static final int BUSY_MODE = 3; // データ更新処理中モード
137 static final int KEYTAG_MODE = 4; // キータグ返却モード(AUTO_RETURN)
142 * new ImageIcon("lib/card.gif"), "IDカードをかざしてください。"
145 public void printStartMessage() {
146 this.screenMode = TouchScreen.START_MODE;
149 if (this.mainPanel != null) {
150 this.remove(this.mainPanel);
153 this.mainPanel = this.startModePanel;
154 this.add(BorderLayout.CENTER, mainPanel);
155 this.setVisible(true);
162 while (this.screenMode == TouchScreen.START_MODE) {
164 if (this.mainPanel != null) {
165 this.remove(this.mainPanel);
166 this.mainPanel = null;
168 this.setVisible(true);
173 } catch (InterruptedException e) {}
176 this.mainPanel = this.startModePanel;
177 this.add(BorderLayout.CENTER, mainPanel);
179 this.setVisible(true);
184 } catch (InterruptedException e) {}