1 package osm.jp.gpx.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.jp.gpx.matchtime.gui.AdjustTime;
12 import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n;
13 import osm.jp.gpx.matchtime.gui.Card;
14 import osm.jp.gpx.matchtime.gui.PanelAction;
15 import osm.jp.gpx.matchtime.gui.ParameterPanelTime;
21 public class CardPerformFile extends Card implements PanelAction {
22 //JPanel argsPanel; // パラメータ設定パネル (上部)
23 ParameterPanelTime arg1_basetime;
24 ParameterPanelTime arg2_basetime;
25 JButton doButton; // [処理実行]ボタン
29 * @param tabbe parent panel
30 * @param arg1_basetime // 開始画像の基準時刻:
31 * @param arg2_basetime // 開始画像の基準時刻:
33 public CardPerformFile(
35 ParameterPanelTime arg1_basetime,
36 ParameterPanelTime arg2_basetime
38 super(tabbe, AdjustTime.i18n.getString("tab.restamp.400"), 2, 4);
39 this.arg1_basetime = arg1_basetime;
40 this.arg2_basetime = arg2_basetime;
42 JPanel argsPanel = new JPanel();
43 argsPanel.setLayout(new BoxLayout(argsPanel, BoxLayout.PAGE_AXIS));
44 argsPanel.add(packLine(new JLabel(i18n.getString("label.200")), new JPanel()));
47 doButton = new JButton(
48 i18n.getString("button.execute"),
49 AdjustTime.createImageIcon("images/media_playback_start.png")
51 argsPanel.add(doButton);
53 this.mainPanel.add(argsPanel, BorderLayout.CENTER);
55 //{{REGISTER_LISTENERS
56 SymAction lSymAction = new SymAction();
57 doButton.addActionListener(lSymAction);
61 class SymAction implements java.awt.event.ActionListener {
63 public void actionPerformed(java.awt.event.ActionEvent event) {
64 Object object = event.getSource();
65 if (object == doButton) {
66 doButton_Action(event);
75 @SuppressWarnings("UseSpecificCatch")
76 void doButton_Action(java.awt.event.ActionEvent event) {
77 ArrayList<String> arry = new ArrayList<>();
78 File file = arg1_basetime.getImageFile().getImageFile();
79 File dir = file.getParentFile();
80 arry.add(dir.getAbsolutePath());
81 arry.add(file.getName());
82 arry.add(arg1_basetime.argField.getText());
83 file = arg2_basetime.getImageFile().getImageFile();
84 arry.add(file.getName());
85 arry.add(arg2_basetime.argField.getText());
86 String[] argv = arry.toArray(new String[arry.size()]);
87 (new DoRestamp(argv)).setVisible(true);
95 public boolean isEnable() {
96 return (arg1_basetime.isEnable() && arg2_basetime.isEnable());
100 @SuppressWarnings("empty-statement")
101 public void openAction() {