diff --git a/src/i18n.properties b/src/i18n.properties
index ebda465..7bdf409 100644
--- a/src/i18n.properties
+++ b/src/i18n.properties
@@ -12,6 +12,7 @@
button.previous=Previous
button.execute=Execute
button.select=Selection...
+button.update=Update...
tab.100=1. Source image Folder
label.100=
1. Select image source folder.
- If you perform a copy operation, the file update time may be rewritten to the time the copy was executed. It is recommended to directly specify the folder in the camera SD card.
@@ -59,3 +60,4 @@
msg.230=[error] is not a file.
msg.240=[error] Not exists .
msg.250=[error] is not a file.
+IMAGES/FIT16.GIF=images/Fit16.gif
diff --git a/src/i18n_ja_JP.properties b/src/i18n_ja_JP.properties
index 7c93dba..e0cb33c 100644
--- a/src/i18n_ja_JP.properties
+++ b/src/i18n_ja_JP.properties
@@ -12,6 +12,7 @@
button.previous=\u623b\u308b
button.execute=\u51e6\u7406\u5b9f\u884c
button.select=\u9078\u629e...
+button.update=\u5909\u66f4...
tab.100=1. \u753b\u50cf\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u30d5\u30a9\u30eb\u30c0
label.100=1. \u4f4d\u7f6e\u60c5\u5831\u3092\u4ed8\u52a0\u3057\u305f\u3044\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u30d5\u30a9\u30eb\u30c0\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002
- \u30b3\u30d4\u30fc\u52d5\u4f5c\u3092\u884c\u3046\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u66f4\u65b0\u6642\u523b\u304c\u30b3\u30d4\u30fc\u3092\u5b9f\u884c\u3057\u305f\u6642\u523b\u306b\u66f8\u304d\u63db\u308f\u3063\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u30ab\u30e1\u30e9SD\u30ab\u30fc\u30c9\u5185\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u76f4\u63a5\u6307\u5b9a\u3059\u308b\u3053\u3068\u3092\u304a\u3059\u3059\u3081\u3057\u307e\u3059\u3002
@@ -60,3 +61,4 @@
msg.230=[error] \u304c\u30d5\u30a1\u30a4\u30eb\u3058\u3083\u306a\u3044
msg.240=[error] \u304c\u5b58\u5728\u3057\u307e\u305b\u3093
msg.250=[error] \u304c\u30d5\u30a1\u30a4\u30eb\u3058\u3083\u306a\u3044
+IMAGES/FIT16.GIF=images/Fit16.gif
diff --git a/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java b/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java
index 6b18464..8365f92 100644
--- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java
+++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java
@@ -11,7 +11,7 @@
public class ParameterPanelFolder extends ParameterPanel implements ActionListener
{
JFileChooser fc;
- JButton openButton;
+ JButton selectButton;
int chooser;
@SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"})
@@ -22,12 +22,12 @@
this.chooser = chooser;
// "選択..."
- openButton = new JButton(
+ selectButton = new JButton(
i18n.getString("button.select"),
AdjustTime.createImageIcon("images/Open16.gif")
);
- openButton.addActionListener(this);
- this.add(openButton);
+ selectButton.addActionListener(this);
+ this.add(selectButton);
}
public ParameterPanelFolder(String label, String text) {
@@ -36,7 +36,7 @@
public void setEnable(boolean f) {
super.setEnabled(f);
- openButton.setEnabled(f);
+ selectButton.setEnabled(f);
}
public File getDirectory() throws FileNotFoundException {
@@ -56,7 +56,7 @@
@Override
public void actionPerformed(ActionEvent e) {
- if (e.getSource() == openButton){
+ if (e.getSource() == selectButton){
System.out.println("ParameterPanelFolder.actionPerformed(openButton)");
File sdir;
try {
diff --git a/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java b/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java
index 1cb8853..84e40e7 100644
--- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java
+++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java
@@ -61,6 +61,25 @@
fc.setSelectedFile(null);
}
+ public File getImageFile() {
+ if (this.paramDir.isEnable()) {
+ String text = this.argField.getText();
+ if (text != null) {
+ try {
+ File dir = this.paramDir.getDirectory();
+ File file = new File(dir, text);
+ if (file.exists() && file.isFile()) {
+ return file;
+ }
+ }
+ catch (FileNotFoundException e) {
+ return null;
+ }
+ }
+ }
+ return null;
+ }
+
/**
*
* @return
diff --git a/src/osm/jp/gpx/matchtime/gui/ParameterPanelTime.java b/src/osm/jp/gpx/matchtime/gui/ParameterPanelTime.java
index 8c27aeb..100db25 100644
--- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelTime.java
+++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelTime.java
@@ -1,17 +1,21 @@
package osm.jp.gpx.matchtime.gui;
+import java.awt.Dialog;
import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
+import javax.swing.JButton;
+import osm.jp.gpx.matchtime.gui.restamp.DialogCorectTime;
/**
* パラメータを設定する為のパネル。
* この1インスタンスで、1パラメータをあらわす。
*/
-public class ParameterPanelTime extends ParameterPanel implements ActionListener {
+public class ParameterPanelTime extends ParameterPanel {
SimpleDateFormat sdf = (SimpleDateFormat)DateFormat.getDateTimeInstance();
ParameterPanelImageFile imageFile;
+ public JButton updateButton;
+ Dialog owner;
@SuppressWarnings("OverridableMethodCallInConstructor")
public ParameterPanelTime(
@@ -21,6 +25,34 @@
) {
super(label, text);
this.imageFile = imageFile;
+
+ // "ボタン[変更...]"
+ UpdateButtonAction buttonAction = new UpdateButtonAction(this);
+ updateButton = new JButton(i18n.getString("button.update"));
+ updateButton.addActionListener(buttonAction);
+ this.add(updateButton);
+ }
+
+ public ParameterPanelTime setOwner(Dialog owner) {
+ this.owner = owner;
+ return this;
+ }
+
+ /**
+ * ボタンのアクション
+ */
+ class UpdateButtonAction implements java.awt.event.ActionListener
+ {
+ ParameterPanelTime param;
+
+ public UpdateButtonAction(ParameterPanelTime param) {
+ this.param = param;
+ }
+
+ @SuppressWarnings("override")
+ public void actionPerformed(ActionEvent e) {
+ (new DialogCorectTime(param, owner)).setVisible(true);
+ }
}
public ParameterPanelImageFile getImageFile() {
@@ -28,11 +60,6 @@
}
@Override
- public void actionPerformed(ActionEvent arg0) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
public boolean isEnable() {
if (this.imageFile.isEnable()) {
String text = this.argField.getText();
diff --git a/src/osm/jp/gpx/matchtime/gui/restamp/CardCorectTime.java b/src/osm/jp/gpx/matchtime/gui/restamp/CardCorectTime.java
deleted file mode 100644
index e0c4160..0000000
--- a/src/osm/jp/gpx/matchtime/gui/restamp/CardCorectTime.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package osm.jp.gpx.matchtime.gui.restamp;
-
-import java.awt.BorderLayout;
-import java.awt.GridLayout;
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTabbedPane;
-import osm.jp.gpx.ImportPicture;
-import osm.jp.gpx.matchtime.gui.AdjustTime;
-import static osm.jp.gpx.matchtime.gui.AdjustTime.createImageIcon;
-import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n;
-import osm.jp.gpx.matchtime.gui.Card;
-import osm.jp.gpx.matchtime.gui.PanelAction;
-import osm.jp.gpx.matchtime.gui.ParameterPanelTime;
-
-/**
- * [基準画像(開始)]選択パネル
- * @author yuu
- */
-public class CardCorectTime extends Card implements PanelAction {
- JPanel argsPanel; // パラメータ設定パネル (上部)
- ParameterPanelTime arg_basetime; // 開始画像の基準時刻:
-
- /**
- * コンストラクタ
- * @param tabbe parent panel
- * @param arg3_basetime 開始画像の基準時刻:
- */
- public CardCorectTime(JTabbedPane tabbe, ParameterPanelTime arg3_basetime) {
- super(tabbe, AdjustTime.i18n.getString("tab.restamp.300"), 1, 3);
-
- argsPanel = new JPanel();
- argsPanel.setLayout(new GridLayout(2, 1));
-
- //---- CENTER -----
- this.mainPanel.setLayout(new BorderLayout());
- this.add(mainPanel, BorderLayout.CENTER);
-
- // 3. 正確な撮影時刻を入力してください。
- // カメラの時計が正確ならば、設定を変更する必要はありません。
- JLabel label3 = new JLabel();
- label3.setText(i18n.getString("label.300"));
- argsPanel.add(label3);
-
- // 基準時刻:
- this.arg_basetime = arg3_basetime;
- arg3_basetime.setLabel(String.format(" %s: ", i18n.getString("label.310")));
- arg3_basetime.setLabel(ImportPicture.TIME_FORMAT_STRING);
- argsPanel.add(arg3_basetime);
- this.mainPanel.add(argsPanel, BorderLayout.NORTH);
-
- // 参考画像
- JLabel imageLabel = new JLabel();
- JScrollPane imageSPane = new JScrollPane(imageLabel);
- this.mainPanel.add(imageSPane, BorderLayout.CENTER);
-
- // 画像ファイル選択ダイアログを起動するボタン
- JPanel buttonPanel = new JPanel();
- buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
- JButton openButton = new JButton(createImageIcon("images/Fit16.gif"));
- buttonPanel.add(openButton);
- JButton zoomInButton = new JButton(createImageIcon("images/ZoomIn16.gif"));
- buttonPanel.add(zoomInButton);
- JButton zoomOutButton = new JButton(createImageIcon("images/ZoomOut16.gif"));
- buttonPanel.add(zoomOutButton);
- this.mainPanel.add(buttonPanel, BorderLayout.SOUTH);
- }
-
- @Override
- @SuppressWarnings("empty-statement")
- public void openAction() {
- ; // 何もしない
- }
-
- /**
- * 入力条件が満たされているかどうか
- * @return
- */
- @Override
- public boolean isEnable() {
- return this.arg_basetime.isEnable();
- }
-}
diff --git a/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java b/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java
index 1376423..9913029 100644
--- a/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java
+++ b/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java
@@ -2,6 +2,7 @@
import java.awt.BorderLayout;
import java.awt.Dimension;
+import java.awt.Dialog;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
@@ -26,12 +27,15 @@
* コンストラクタ
* @param tabbe parent panel
* @param arg_basetime // 開始画像の基準時刻:
+ * @param owner
*/
public CardFirstFile(
JTabbedPane tabbe,
- ParameterPanelTime arg_basetime
+ ParameterPanelTime arg_basetime,
+ Dialog owner
) {
super(tabbe, AdjustTime.i18n.getString("tab.restamp.200"), 0, 2);
+ arg_basetime.setOwner(owner);
this.arg_baseTimeImg = arg_basetime.getImageFile();
this.arg_basetime = arg_basetime;
diff --git a/src/osm/jp/gpx/matchtime/gui/restamp/DialogCorectTime.java b/src/osm/jp/gpx/matchtime/gui/restamp/DialogCorectTime.java
new file mode 100644
index 0000000..95f107c
--- /dev/null
+++ b/src/osm/jp/gpx/matchtime/gui/restamp/DialogCorectTime.java
@@ -0,0 +1,87 @@
+package osm.jp.gpx.matchtime.gui.restamp;
+
+import java.awt.BorderLayout;
+import java.awt.Dialog;
+import java.awt.GridLayout;
+import javax.swing.BoxLayout;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import osm.jp.gpx.matchtime.gui.AdjustTime;
+import static osm.jp.gpx.matchtime.gui.AdjustTime.createImageIcon;
+import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n;
+import osm.jp.gpx.matchtime.gui.PanelAction;
+import osm.jp.gpx.matchtime.gui.ParameterPanelTime;
+
+/**
+ * [基準画像(開始)]選択パネル
+ * @author yuu
+ */
+public class DialogCorectTime extends JDialog implements PanelAction {
+ public JPanel mainPanel;
+ JPanel argsPanel; // パラメータ設定パネル (上部)
+ ParameterPanelTime arg_basetime; // 開始画像の基準時刻:
+
+ /**
+ * コンストラクタ
+ * @param arg3_basetime 開始画像の基準時刻:
+ * @param owner
+ */
+ public DialogCorectTime(ParameterPanelTime arg3_basetime, Dialog owner) {
+ super(owner, AdjustTime.i18n.getString("tab.restamp.300"), false);
+
+ argsPanel = new JPanel();
+ argsPanel.setLayout(new GridLayout(2, 1));
+
+ //---- CENTER -----
+ JPanel centerPanel = new JPanel();
+ centerPanel.setLayout(new BorderLayout());
+ add(centerPanel, BorderLayout.CENTER);
+
+ // 3. 正確な撮影時刻を入力してください。
+ // カメラの時計が正確ならば、設定を変更する必要はありません。
+ JLabel label3 = new JLabel();
+ label3.setText(i18n.getString("label.300"));
+ argsPanel.add(label3);
+
+ // 基準時刻:
+ this.arg_basetime = arg3_basetime;
+ //arg3_basetime.setLabel(String.format(" %s: ", i18n.getString("label.310")));
+ //arg3_basetime.setLabel(ImportPicture.TIME_FORMAT_STRING);
+ //argsPanel.add(arg3_basetime);
+ //centerPanel.add(argsPanel, BorderLayout.NORTH);
+
+ // 参考画像
+ JLabel imageLabel = new JLabel();
+ JScrollPane imageSPane = new JScrollPane(imageLabel);
+ centerPanel.add(imageSPane, BorderLayout.CENTER);
+
+ // 画像ファイル選択ダイアログを起動するボタン
+ JPanel buttonPanel = new JPanel();
+ buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
+ JButton openButton = new JButton(createImageIcon(java.util.ResourceBundle.getBundle("i18n_ja_JP").getString("IMAGES/FIT16.GIF")));
+ buttonPanel.add(openButton);
+ JButton zoomInButton = new JButton(createImageIcon("images/ZoomIn16.gif"));
+ buttonPanel.add(zoomInButton);
+ JButton zoomOutButton = new JButton(createImageIcon("images/ZoomOut16.gif"));
+ buttonPanel.add(zoomOutButton);
+ centerPanel.add(buttonPanel, BorderLayout.SOUTH);
+ }
+
+ @Override
+ @SuppressWarnings("empty-statement")
+ public void openAction() {
+ ; // 何もしない
+ }
+
+ /**
+ * 入力条件が満たされているかどうか
+ * @return
+ */
+ @Override
+ public boolean isEnable() {
+ return this.arg_basetime.isEnable();
+ }
+}
diff --git a/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java b/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java
index 5b00348..bc72d08 100644
--- a/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java
+++ b/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java
@@ -171,7 +171,7 @@
}
);
- CardFirstFile card = new CardFirstFile(cardPanel, arg2_basetime);
+ CardFirstFile card = new CardFirstFile(cardPanel, arg2_basetime, this);
cardPanel.addTab(card.getTitle(), card);
cardPanel.setEnabledAt(cardNo, false);
cards[cardNo] = card;