OSDN Git Service

MAVEN構成
[importpicture/importpicture.git] / src / main / java / osm / jp / gpx / matchtime / gui / CardGpxFile.java
1 package osm.jp.gpx.matchtime.gui;
2
3 import java.awt.BorderLayout;
4 import java.awt.Dimension;
5 import javax.swing.BoxLayout;
6 import javax.swing.JLabel;
7 import javax.swing.JPanel;
8 import javax.swing.JTabbedPane;
9 import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n;
10
11 /**
12  * [GPXファイル]選択パネル
13  * @author yuu
14  */
15 public class CardGpxFile extends Card  implements PanelAction {
16     ParameterPanelGpx arg_gpxFile;
17     
18     /**
19      * コンストラクタ
20      * @param tabbe parent panel
21      * @param arg_gpxFile               // 開始画像の基準時刻:
22      * @param text
23      * @param pre
24      * @param next
25      */
26     public CardGpxFile(
27             JTabbedPane tabbe, 
28             ParameterPanelGpx arg_gpxFile,
29             String text,
30             int pre, int next
31     ) {
32         super(tabbe, text, pre, next);
33         this.arg_gpxFile = arg_gpxFile;
34         
35         // 4. ヒモ付を行うGPXファイルを選択してください。
36         //    - フォルダを指定すると、フォルダ内のすべてのGPXファイルを対象とします。
37         JPanel argsPanel = new JPanel();
38         argsPanel.setLayout(new BoxLayout(argsPanel, BoxLayout.PAGE_AXIS));
39         argsPanel.add(packLine(new JLabel(i18n.getString("label.400")), new JPanel()));
40         argsPanel.add(arg_gpxFile);
41         
42         // "セグメント'trkseg'の最初の1ノードは無視する。"
43         if (arg_gpxFile.noFirstNode != null) {
44             argsPanel.add(arg_gpxFile.noFirstNode);
45         }
46
47         // "生成されたGPXファイル(ファイル名が'_.gpx'で終わるもの)も変換の対象にする"
48         if (arg_gpxFile.gpxReuse != null) {
49             argsPanel.add(arg_gpxFile.gpxReuse);
50         }
51         
52         JPanel space = new JPanel();
53         space.setMinimumSize(new Dimension(40, 20));
54         space.setMaximumSize(new Dimension(40, Short.MAX_VALUE));
55         argsPanel.add(space);
56         
57         this.mainPanel.add(argsPanel, BorderLayout.CENTER);
58     }
59
60     /**
61      *  入力条件が満たされているかどうか
62      * @return
63      */
64     @Override
65     public boolean isEnable() {
66        return (arg_gpxFile.isEnable());
67     }
68     
69     @Override
70     @SuppressWarnings("empty-statement")
71     public void openAction() {
72        ; // 何もしない
73     }
74 }