OSDN Git Service

対象フォルダが入力されたら次のパネルを有効にする
[importpicture/importpicture.git] / src / osm / jp / gpx / matchtime / gui / ParameterPanelTime.java
1 package osm.jp.gpx.matchtime.gui;
2
3 import java.awt.event.ActionEvent;
4 import java.awt.event.ActionListener;
5 import java.text.DateFormat;
6 import java.text.SimpleDateFormat;
7
8 /**
9  * パラメータを設定する為のパネル。
10  * この1インスタンスで、1パラメータをあらわす。
11  */
12 public class ParameterPanelTime extends ParameterPanel implements ActionListener {
13     SimpleDateFormat sdf = (SimpleDateFormat)DateFormat.getDateTimeInstance();
14     ParameterPanelImageFile imageFile;
15
16     @SuppressWarnings("OverridableMethodCallInConstructor")
17     public ParameterPanelTime(
18             String label, 
19             String text, 
20             ParameterPanelImageFile imageFile
21     ) {
22         super(label, text);
23         this.imageFile = imageFile;
24     }
25
26     @Override
27     public void actionPerformed(ActionEvent arg0) {
28         throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
29     }
30
31     @Override
32     public boolean isEnable() {
33         if (this.imageFile.isEnable()) {
34             String text = this.argField.getText();
35             if (text != null) {
36                 try {
37                     sdf.applyPattern("yyyy.MM.dd HH:mm:ss z");
38                     sdf.parse(text);
39                     return true;
40                 }
41                 catch (Exception e) {
42                     return false;
43                 }
44             }
45         }
46         return false;
47     }
48 }