• R/O
  • HTTP
  • SSH
  • HTTPS

importpicture: Commit


Commit MetaInfo

Revision17012335c6fe9d90392ef306ba05a43c97ad6736 (tree)
Time2019-10-14 10:13:18
Authorhaya4 <hayashi.yuu@gmai...>
Commiterhaya4

Log Message

issue: Restampからダイアログが表示できない

Change Summary

Incremental Difference

--- a/src/i18n.properties
+++ b/src/i18n.properties
@@ -12,6 +12,7 @@ button.next=Next
1212 button.previous=Previous
1313 button.execute=Execute
1414 button.select=Selection...
15+button.update=Update...
1516
1617 tab.100=1. Source image Folder
1718 label.100=<html><p>1. Select image source folder.</p><ul><li>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.</li></ul>
@@ -59,3 +60,4 @@ msg.220=[error] Not exists <baseFile1>.
5960 msg.230=[error] <baseFile1> is not a file.
6061 msg.240=[error] Not exists <baseFile2>.
6162 msg.250=[error] <baseFile2> is not a file.
63+IMAGES/FIT16.GIF=images/Fit16.gif
--- a/src/i18n_ja_JP.properties
+++ b/src/i18n_ja_JP.properties
@@ -12,6 +12,7 @@ button.next=\u6b21\u3078
1212 button.previous=\u623b\u308b
1313 button.execute=\u51e6\u7406\u5b9f\u884c
1414 button.select=\u9078\u629e...
15+button.update=\u5909\u66f4...
1516
1617 tab.100=1. \u753b\u50cf\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u30d5\u30a9\u30eb\u30c0
1718 label.100=<html><p>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</p><ul><li>\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</li></ul>
@@ -60,3 +61,4 @@ msg.220=[error] <baseFile1>\u304c\u5b58\u5728\u3057\u307e\u305b\u3093
6061 msg.230=[error] <baseFile1>\u304c\u30d5\u30a1\u30a4\u30eb\u3058\u3083\u306a\u3044
6162 msg.240=[error] <baseFile1>\u304c\u5b58\u5728\u3057\u307e\u305b\u3093
6263 msg.250=[error] <baseFile1>\u304c\u30d5\u30a1\u30a4\u30eb\u3058\u3083\u306a\u3044
64+IMAGES/FIT16.GIF=images/Fit16.gif
--- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java
+++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java
@@ -11,7 +11,7 @@ import javax.swing.JFileChooser;
1111 public class ParameterPanelFolder extends ParameterPanel implements ActionListener
1212 {
1313 JFileChooser fc;
14- JButton openButton;
14+ JButton selectButton;
1515 int chooser;
1616
1717 @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"})
@@ -22,12 +22,12 @@ public class ParameterPanelFolder extends ParameterPanel implements ActionListen
2222 this.chooser = chooser;
2323
2424 // "選択..."
25- openButton = new JButton(
25+ selectButton = new JButton(
2626 i18n.getString("button.select"),
2727 AdjustTime.createImageIcon("images/Open16.gif")
2828 );
29- openButton.addActionListener(this);
30- this.add(openButton);
29+ selectButton.addActionListener(this);
30+ this.add(selectButton);
3131 }
3232
3333 public ParameterPanelFolder(String label, String text) {
@@ -36,7 +36,7 @@ public class ParameterPanelFolder extends ParameterPanel implements ActionListen
3636
3737 public void setEnable(boolean f) {
3838 super.setEnabled(f);
39- openButton.setEnabled(f);
39+ selectButton.setEnabled(f);
4040 }
4141
4242 public File getDirectory() throws FileNotFoundException {
@@ -56,7 +56,7 @@ public class ParameterPanelFolder extends ParameterPanel implements ActionListen
5656
5757 @Override
5858 public void actionPerformed(ActionEvent e) {
59- if (e.getSource() == openButton){
59+ if (e.getSource() == selectButton){
6060 System.out.println("ParameterPanelFolder.actionPerformed(openButton)");
6161 File sdir;
6262 try {
--- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java
+++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java
@@ -61,6 +61,25 @@ public class ParameterPanelImageFile extends ParameterPanel {
6161 fc.setSelectedFile(null);
6262 }
6363
64+ public File getImageFile() {
65+ if (this.paramDir.isEnable()) {
66+ String text = this.argField.getText();
67+ if (text != null) {
68+ try {
69+ File dir = this.paramDir.getDirectory();
70+ File file = new File(dir, text);
71+ if (file.exists() && file.isFile()) {
72+ return file;
73+ }
74+ }
75+ catch (FileNotFoundException e) {
76+ return null;
77+ }
78+ }
79+ }
80+ return null;
81+ }
82+
6483 /**
6584 *
6685 * @return
--- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelTime.java
+++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelTime.java
@@ -1,17 +1,21 @@
11 package osm.jp.gpx.matchtime.gui;
22
3+import java.awt.Dialog;
34 import java.awt.event.ActionEvent;
4-import java.awt.event.ActionListener;
55 import java.text.DateFormat;
66 import java.text.SimpleDateFormat;
7+import javax.swing.JButton;
8+import osm.jp.gpx.matchtime.gui.restamp.DialogCorectTime;
79
810 /**
911 * パラメータを設定する為のパネル。
1012 * この1インスタンスで、1パラメータをあらわす。
1113 */
12-public class ParameterPanelTime extends ParameterPanel implements ActionListener {
14+public class ParameterPanelTime extends ParameterPanel {
1315 SimpleDateFormat sdf = (SimpleDateFormat)DateFormat.getDateTimeInstance();
1416 ParameterPanelImageFile imageFile;
17+ public JButton updateButton;
18+ Dialog owner;
1519
1620 @SuppressWarnings("OverridableMethodCallInConstructor")
1721 public ParameterPanelTime(
@@ -21,6 +25,34 @@ public class ParameterPanelTime extends ParameterPanel implements ActionListener
2125 ) {
2226 super(label, text);
2327 this.imageFile = imageFile;
28+
29+ // "ボタン[変更...]"
30+ UpdateButtonAction buttonAction = new UpdateButtonAction(this);
31+ updateButton = new JButton(i18n.getString("button.update"));
32+ updateButton.addActionListener(buttonAction);
33+ this.add(updateButton);
34+ }
35+
36+ public ParameterPanelTime setOwner(Dialog owner) {
37+ this.owner = owner;
38+ return this;
39+ }
40+
41+ /**
42+ * ボタンのアクション
43+ */
44+ class UpdateButtonAction implements java.awt.event.ActionListener
45+ {
46+ ParameterPanelTime param;
47+
48+ public UpdateButtonAction(ParameterPanelTime param) {
49+ this.param = param;
50+ }
51+
52+ @SuppressWarnings("override")
53+ public void actionPerformed(ActionEvent e) {
54+ (new DialogCorectTime(param, owner)).setVisible(true);
55+ }
2456 }
2557
2658 public ParameterPanelImageFile getImageFile() {
@@ -28,11 +60,6 @@ public class ParameterPanelTime extends ParameterPanel implements ActionListener
2860 }
2961
3062 @Override
31- public void actionPerformed(ActionEvent arg0) {
32- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
33- }
34-
35- @Override
3663 public boolean isEnable() {
3764 if (this.imageFile.isEnable()) {
3865 String text = this.argField.getText();
--- a/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java
+++ b/src/osm/jp/gpx/matchtime/gui/restamp/CardFirstFile.java
@@ -2,6 +2,7 @@ package osm.jp.gpx.matchtime.gui.restamp;
22
33 import java.awt.BorderLayout;
44 import java.awt.Dimension;
5+import java.awt.Dialog;
56 import javax.swing.BoxLayout;
67 import javax.swing.JLabel;
78 import javax.swing.JPanel;
@@ -26,12 +27,15 @@ public class CardFirstFile extends Card implements PanelAction {
2627 * コンストラクタ
2728 * @param tabbe parent panel
2829 * @param arg_basetime // 開始画像の基準時刻:
30+ * @param owner
2931 */
3032 public CardFirstFile(
3133 JTabbedPane tabbe,
32- ParameterPanelTime arg_basetime
34+ ParameterPanelTime arg_basetime,
35+ Dialog owner
3336 ) {
3437 super(tabbe, AdjustTime.i18n.getString("tab.restamp.200"), 0, 2);
38+ arg_basetime.setOwner(owner);
3539 this.arg_baseTimeImg = arg_basetime.getImageFile();
3640 this.arg_basetime = arg_basetime;
3741
--- a/src/osm/jp/gpx/matchtime/gui/restamp/CardCorectTime.java
+++ b/src/osm/jp/gpx/matchtime/gui/restamp/DialogCorectTime.java
@@ -1,18 +1,17 @@
11 package osm.jp.gpx.matchtime.gui.restamp;
22
33 import java.awt.BorderLayout;
4+import java.awt.Dialog;
45 import java.awt.GridLayout;
56 import javax.swing.BoxLayout;
67 import javax.swing.JButton;
8+import javax.swing.JDialog;
79 import javax.swing.JLabel;
810 import javax.swing.JPanel;
911 import javax.swing.JScrollPane;
10-import javax.swing.JTabbedPane;
11-import osm.jp.gpx.ImportPicture;
1212 import osm.jp.gpx.matchtime.gui.AdjustTime;
1313 import static osm.jp.gpx.matchtime.gui.AdjustTime.createImageIcon;
1414 import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n;
15-import osm.jp.gpx.matchtime.gui.Card;
1615 import osm.jp.gpx.matchtime.gui.PanelAction;
1716 import osm.jp.gpx.matchtime.gui.ParameterPanelTime;
1817
@@ -20,24 +19,26 @@ import osm.jp.gpx.matchtime.gui.ParameterPanelTime;
2019 * [基準画像(開始)]選択パネル
2120 * @author yuu
2221 */
23-public class CardCorectTime extends Card implements PanelAction {
22+public class DialogCorectTime extends JDialog implements PanelAction {
23+ public JPanel mainPanel;
2424 JPanel argsPanel; // パラメータ設定パネル (上部)
2525 ParameterPanelTime arg_basetime; // 開始画像の基準時刻:
2626
2727 /**
2828 * コンストラクタ
29- * @param tabbe parent panel
3029 * @param arg3_basetime 開始画像の基準時刻:
30+ * @param owner
3131 */
32- public CardCorectTime(JTabbedPane tabbe, ParameterPanelTime arg3_basetime) {
33- super(tabbe, AdjustTime.i18n.getString("tab.restamp.300"), 1, 3);
32+ public DialogCorectTime(ParameterPanelTime arg3_basetime, Dialog owner) {
33+ super(owner, AdjustTime.i18n.getString("tab.restamp.300"), false);
3434
3535 argsPanel = new JPanel();
3636 argsPanel.setLayout(new GridLayout(2, 1));
3737
3838 //---- CENTER -----
39- this.mainPanel.setLayout(new BorderLayout());
40- this.add(mainPanel, BorderLayout.CENTER);
39+ JPanel centerPanel = new JPanel();
40+ centerPanel.setLayout(new BorderLayout());
41+ add(centerPanel, BorderLayout.CENTER);
4142
4243 // 3. 正確な撮影時刻を入力してください。
4344 // カメラの時計が正確ならば、設定を変更する必要はありません。
@@ -47,26 +48,26 @@ public class CardCorectTime extends Card implements PanelAction {
4748
4849 // 基準時刻:
4950 this.arg_basetime = arg3_basetime;
50- arg3_basetime.setLabel(String.format("  %s: ", i18n.getString("label.310")));
51- arg3_basetime.setLabel(ImportPicture.TIME_FORMAT_STRING);
52- argsPanel.add(arg3_basetime);
53- this.mainPanel.add(argsPanel, BorderLayout.NORTH);
51+ //arg3_basetime.setLabel(String.format("  %s: ", i18n.getString("label.310")));
52+ //arg3_basetime.setLabel(ImportPicture.TIME_FORMAT_STRING);
53+ //argsPanel.add(arg3_basetime);
54+ //centerPanel.add(argsPanel, BorderLayout.NORTH);
5455
5556 // 参考画像
5657 JLabel imageLabel = new JLabel();
5758 JScrollPane imageSPane = new JScrollPane(imageLabel);
58- this.mainPanel.add(imageSPane, BorderLayout.CENTER);
59+ centerPanel.add(imageSPane, BorderLayout.CENTER);
5960
6061 // 画像ファイル選択ダイアログを起動するボタン
6162 JPanel buttonPanel = new JPanel();
6263 buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));
63- JButton openButton = new JButton(createImageIcon("images/Fit16.gif"));
64+ JButton openButton = new JButton(createImageIcon(java.util.ResourceBundle.getBundle("i18n_ja_JP").getString("IMAGES/FIT16.GIF")));
6465 buttonPanel.add(openButton);
6566 JButton zoomInButton = new JButton(createImageIcon("images/ZoomIn16.gif"));
6667 buttonPanel.add(zoomInButton);
6768 JButton zoomOutButton = new JButton(createImageIcon("images/ZoomOut16.gif"));
6869 buttonPanel.add(zoomOutButton);
69- this.mainPanel.add(buttonPanel, BorderLayout.SOUTH);
70+ centerPanel.add(buttonPanel, BorderLayout.SOUTH);
7071 }
7172
7273 @Override
--- a/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java
+++ b/src/osm/jp/gpx/matchtime/gui/restamp/RestampDialog.java
@@ -171,7 +171,7 @@ public class RestampDialog extends Dialog implements Observer
171171 }
172172 );
173173
174- CardFirstFile card = new CardFirstFile(cardPanel, arg2_basetime);
174+ CardFirstFile card = new CardFirstFile(cardPanel, arg2_basetime, this);
175175 cardPanel.addTab(card.getTitle(), card);
176176 cardPanel.setEnabledAt(cardNo, false);
177177 cards[cardNo] = card;
Show on old repository browser