1 package osm.surveyor.matchtime.gui.restamp;
3 import java.awt.BorderLayout;
5 import java.util.ArrayList;
6 import javax.swing.BoxLayout;
7 import javax.swing.JButton;
8 import javax.swing.JLabel;
9 import javax.swing.JPanel;
10 import javax.swing.JTabbedPane;
11 import osm.surveyor.matchtime.gui.ReStamp;
12 import static osm.surveyor.matchtime.gui.ReStamp.i18n;
13 import osm.surveyor.matchtime.gui.Card;
14 import osm.surveyor.matchtime.gui.PanelAction;
15 import osm.surveyor.matchtime.gui.ParameterPanelOutput;
16 import osm.surveyor.matchtime.gui.ParameterPanelTime;
22 public class CardPerformFile extends Card implements PanelAction {
23 private static final long serialVersionUID = 4781494884268871662L;
24 ParameterPanelTime arg1_basetime;
25 ParameterPanelTime arg2_basetime;
26 ParameterPanelOutput arg_output; // EXIF & 書き出しフォルダ
27 JButton doButton; // [処理実行]ボタン
31 * @param tabbe parent panel
32 * @param arg1_basetime // 開始画像の基準時刻:
33 * @param arg2_basetime // 開始画像の基準時刻:
34 * @param arg_output // EXIF & 書き出しフォルダ
39 public CardPerformFile(
41 ParameterPanelTime arg1_basetime,
42 ParameterPanelTime arg2_basetime,
43 ParameterPanelOutput arg_output,
47 super(tabbe, text, pre, next);
48 this.arg1_basetime = arg1_basetime;
49 this.arg2_basetime = arg2_basetime;
50 this.arg_output = arg_output;
52 JPanel argsPanel = new JPanel();
53 argsPanel.setLayout(new BoxLayout(argsPanel, BoxLayout.PAGE_AXIS));
56 // 5. 変換先のフォルダを選択してください。
57 // - 変換先フォルダには、書き込み権限と、十分な空き容量が必要です。
58 JLabel label5 = new JLabel();
61 "<html><p>%s</p><ul><li>%s</li></ul>",
62 i18n.getString("label.restamp.500"),
63 i18n.getString("label.restamp.501")
66 argsPanel.add(packLine(label5, new JPanel()));
67 argsPanel.add(arg_output);
68 argsPanel.add(arg_output.outputOverwite);
71 doButton = new JButton(
72 i18n.getString("button.execute"),
73 ReStamp.createImageIcon("/images/media_playback_start.png")
75 argsPanel.add(doButton);
77 this.mainPanel.add(argsPanel, BorderLayout.CENTER);
79 //{{REGISTER_LISTENERS
80 SymAction lSymAction = new SymAction();
81 doButton.addActionListener(lSymAction);
85 class SymAction implements java.awt.event.ActionListener {
87 public void actionPerformed(java.awt.event.ActionEvent event) {
88 Object object = event.getSource();
89 if (object == doButton) {
90 doButton_Action(event);
99 void doButton_Action(java.awt.event.ActionEvent event) {
100 doButton.setEnabled(false);
102 ArrayList<String> arry = new ArrayList<>();
103 File file = arg1_basetime.getImageFile().getImageFile();
104 File dir = file.getParentFile();
105 arry.add(dir.getAbsolutePath());
106 arry.add(file.getName());
107 arry.add(arg1_basetime.argField.getText());
108 file = arg2_basetime.getImageFile().getImageFile();
109 arry.add(file.getName());
110 arry.add(arg2_basetime.argField.getText());
111 arry.add(arg_output.getText());
113 String[] argv = arry.toArray(new String[arry.size()]);
114 (new DoRestamp(argv)).setVisible(true);
116 doButton.setEnabled(true);
124 public boolean isEnable() {
125 return (arg1_basetime.isEnable() && arg2_basetime.isEnable());
129 public void openAction() {