OSDN Git Service

031e00fbf677930efc7b1480370cc057bb315f6f
[restamp/Restamp-gui.git] / src / main / java / osm / surveyor / matchtime / gui / restamp / CardImageFile.java
1 package osm.surveyor.matchtime.gui.restamp;
2
3 import java.awt.BorderLayout;
4 import java.awt.Dimension;
5 import java.awt.Window;
6 import javax.swing.BoxLayout;
7 import javax.swing.JLabel;
8 import javax.swing.JPanel;
9 import javax.swing.JTabbedPane;
10 import static osm.surveyor.matchtime.gui.ReStamp.i18n;
11 import osm.surveyor.matchtime.gui.Card;
12 import osm.surveyor.matchtime.gui.PanelAction;
13 import osm.surveyor.matchtime.gui.ParameterPanelImageFile;
14 import osm.surveyor.matchtime.gui.ParameterPanelTime;
15
16 /**
17  * [基準画像(開始/終了)]選択パネル
18  * @author yuu
19  */
20 public class CardImageFile extends Card  implements PanelAction {
21         private static final long serialVersionUID = 9181841489760243343L;
22         ParameterPanelImageFile arg_baseTimeImg;
23     ParameterPanelTime arg_basetime;
24     
25     /**
26      * コンストラクタ
27      * @param tabbe parent panel
28      * @param arg_basetime              // 開始画像の基準時刻:
29      * @param owner
30      * @param text
31      * @param pre
32      * @param next
33      */
34     public CardImageFile(
35             JTabbedPane tabbe, 
36             ParameterPanelTime arg_basetime,
37             Window owner,
38             String text,
39             int pre, int next
40     ) {
41         super(tabbe, text, pre, next);
42         arg_basetime.setOwner(owner);
43         this.arg_baseTimeImg = arg_basetime.getImageFile();
44         this.arg_basetime = arg_basetime;
45         
46         JPanel argsPanel = new JPanel();
47         argsPanel.setLayout(new BoxLayout(argsPanel, BoxLayout.PAGE_AXIS));
48         argsPanel.add(packLine(new JLabel(i18n.getString("label.200")), new JPanel()));
49         argsPanel.add(arg_baseTimeImg);
50         
51         JPanel separater = new JPanel();
52         separater.setMinimumSize(new Dimension(40, 20));
53         argsPanel.add(separater);
54
55         argsPanel.add(packLine(new JLabel(i18n.getString("label.300")), new JPanel()));
56         argsPanel.add(arg_basetime);
57         
58         // ラジオボタン: 「EXIF日時を基準にする」
59         if (arg_basetime.exifBase != null) {
60             argsPanel.add(arg_basetime.exifBase);
61         }
62         
63         // ラジオボタン: 「File更新日時を基準にする」
64         if (arg_basetime.fupdateBase != null) {
65             argsPanel.add(arg_basetime.fupdateBase);
66         }
67         
68         JPanel space = new JPanel();
69         space.setMinimumSize(new Dimension(40, 20));
70         space.setMaximumSize(new Dimension(40, Short.MAX_VALUE));
71         argsPanel.add(space);
72         
73         this.mainPanel.add(argsPanel, BorderLayout.CENTER);
74     }
75     
76     /**
77      *  入力条件が満たされているかどうか
78      * @return
79      */
80     @Override
81     public boolean isEnable() {
82        return (arg_baseTimeImg.isEnable() && arg_basetime.isEnable());
83     }
84     
85     @Override
86     public void openAction() {
87        ; // 何もしない
88     }
89 }