Revision | 17012335c6fe9d90392ef306ba05a43c97ad6736 (tree) |
---|---|
Time | 2019-10-14 10:13:18 |
Author | ![]() |
Commiter | haya4 |
issue: Restampからダイアログが表示できない
@@ -12,6 +12,7 @@ button.next=Next | ||
12 | 12 | button.previous=Previous |
13 | 13 | button.execute=Execute |
14 | 14 | button.select=Selection... |
15 | +button.update=Update... | |
15 | 16 | |
16 | 17 | tab.100=1. Source image Folder |
17 | 18 | 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>. | ||
59 | 60 | msg.230=[error] <baseFile1> is not a file. |
60 | 61 | msg.240=[error] Not exists <baseFile2>. |
61 | 62 | msg.250=[error] <baseFile2> is not a file. |
63 | +IMAGES/FIT16.GIF=images/Fit16.gif |
@@ -12,6 +12,7 @@ button.next=\u6b21\u3078 | ||
12 | 12 | button.previous=\u623b\u308b |
13 | 13 | button.execute=\u51e6\u7406\u5b9f\u884c |
14 | 14 | button.select=\u9078\u629e... |
15 | +button.update=\u5909\u66f4... | |
15 | 16 | |
16 | 17 | tab.100=1. \u753b\u50cf\u5143\u306e\u30d5\u30a1\u30a4\u30eb\u30d5\u30a9\u30eb\u30c0 |
17 | 18 | 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 | ||
60 | 61 | msg.230=[error] <baseFile1>\u304c\u30d5\u30a1\u30a4\u30eb\u3058\u3083\u306a\u3044 |
61 | 62 | msg.240=[error] <baseFile1>\u304c\u5b58\u5728\u3057\u307e\u305b\u3093 |
62 | 63 | msg.250=[error] <baseFile1>\u304c\u30d5\u30a1\u30a4\u30eb\u3058\u3083\u306a\u3044 |
64 | +IMAGES/FIT16.GIF=images/Fit16.gif |
@@ -11,7 +11,7 @@ import javax.swing.JFileChooser; | ||
11 | 11 | public class ParameterPanelFolder extends ParameterPanel implements ActionListener |
12 | 12 | { |
13 | 13 | JFileChooser fc; |
14 | - JButton openButton; | |
14 | + JButton selectButton; | |
15 | 15 | int chooser; |
16 | 16 | |
17 | 17 | @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) |
@@ -22,12 +22,12 @@ public class ParameterPanelFolder extends ParameterPanel implements ActionListen | ||
22 | 22 | this.chooser = chooser; |
23 | 23 | |
24 | 24 | // "選択..." |
25 | - openButton = new JButton( | |
25 | + selectButton = new JButton( | |
26 | 26 | i18n.getString("button.select"), |
27 | 27 | AdjustTime.createImageIcon("images/Open16.gif") |
28 | 28 | ); |
29 | - openButton.addActionListener(this); | |
30 | - this.add(openButton); | |
29 | + selectButton.addActionListener(this); | |
30 | + this.add(selectButton); | |
31 | 31 | } |
32 | 32 | |
33 | 33 | public ParameterPanelFolder(String label, String text) { |
@@ -36,7 +36,7 @@ public class ParameterPanelFolder extends ParameterPanel implements ActionListen | ||
36 | 36 | |
37 | 37 | public void setEnable(boolean f) { |
38 | 38 | super.setEnabled(f); |
39 | - openButton.setEnabled(f); | |
39 | + selectButton.setEnabled(f); | |
40 | 40 | } |
41 | 41 | |
42 | 42 | public File getDirectory() throws FileNotFoundException { |
@@ -56,7 +56,7 @@ public class ParameterPanelFolder extends ParameterPanel implements ActionListen | ||
56 | 56 | |
57 | 57 | @Override |
58 | 58 | public void actionPerformed(ActionEvent e) { |
59 | - if (e.getSource() == openButton){ | |
59 | + if (e.getSource() == selectButton){ | |
60 | 60 | System.out.println("ParameterPanelFolder.actionPerformed(openButton)"); |
61 | 61 | File sdir; |
62 | 62 | try { |
@@ -61,6 +61,25 @@ public class ParameterPanelImageFile extends ParameterPanel { | ||
61 | 61 | fc.setSelectedFile(null); |
62 | 62 | } |
63 | 63 | |
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 | + | |
64 | 83 | /** |
65 | 84 | * |
66 | 85 | * @return |
@@ -1,17 +1,21 @@ | ||
1 | 1 | package osm.jp.gpx.matchtime.gui; |
2 | 2 | |
3 | +import java.awt.Dialog; | |
3 | 4 | import java.awt.event.ActionEvent; |
4 | -import java.awt.event.ActionListener; | |
5 | 5 | import java.text.DateFormat; |
6 | 6 | import java.text.SimpleDateFormat; |
7 | +import javax.swing.JButton; | |
8 | +import osm.jp.gpx.matchtime.gui.restamp.DialogCorectTime; | |
7 | 9 | |
8 | 10 | /** |
9 | 11 | * パラメータを設定する為のパネル。 |
10 | 12 | * この1インスタンスで、1パラメータをあらわす。 |
11 | 13 | */ |
12 | -public class ParameterPanelTime extends ParameterPanel implements ActionListener { | |
14 | +public class ParameterPanelTime extends ParameterPanel { | |
13 | 15 | SimpleDateFormat sdf = (SimpleDateFormat)DateFormat.getDateTimeInstance(); |
14 | 16 | ParameterPanelImageFile imageFile; |
17 | + public JButton updateButton; | |
18 | + Dialog owner; | |
15 | 19 | |
16 | 20 | @SuppressWarnings("OverridableMethodCallInConstructor") |
17 | 21 | public ParameterPanelTime( |
@@ -21,6 +25,34 @@ public class ParameterPanelTime extends ParameterPanel implements ActionListener | ||
21 | 25 | ) { |
22 | 26 | super(label, text); |
23 | 27 | 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 | + } | |
24 | 56 | } |
25 | 57 | |
26 | 58 | public ParameterPanelImageFile getImageFile() { |
@@ -28,11 +60,6 @@ public class ParameterPanelTime extends ParameterPanel implements ActionListener | ||
28 | 60 | } |
29 | 61 | |
30 | 62 | @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 | |
36 | 63 | public boolean isEnable() { |
37 | 64 | if (this.imageFile.isEnable()) { |
38 | 65 | String text = this.argField.getText(); |
@@ -2,6 +2,7 @@ package osm.jp.gpx.matchtime.gui.restamp; | ||
2 | 2 | |
3 | 3 | import java.awt.BorderLayout; |
4 | 4 | import java.awt.Dimension; |
5 | +import java.awt.Dialog; | |
5 | 6 | import javax.swing.BoxLayout; |
6 | 7 | import javax.swing.JLabel; |
7 | 8 | import javax.swing.JPanel; |
@@ -26,12 +27,15 @@ public class CardFirstFile extends Card implements PanelAction { | ||
26 | 27 | * コンストラクタ |
27 | 28 | * @param tabbe parent panel |
28 | 29 | * @param arg_basetime // 開始画像の基準時刻: |
30 | + * @param owner | |
29 | 31 | */ |
30 | 32 | public CardFirstFile( |
31 | 33 | JTabbedPane tabbe, |
32 | - ParameterPanelTime arg_basetime | |
34 | + ParameterPanelTime arg_basetime, | |
35 | + Dialog owner | |
33 | 36 | ) { |
34 | 37 | super(tabbe, AdjustTime.i18n.getString("tab.restamp.200"), 0, 2); |
38 | + arg_basetime.setOwner(owner); | |
35 | 39 | this.arg_baseTimeImg = arg_basetime.getImageFile(); |
36 | 40 | this.arg_basetime = arg_basetime; |
37 | 41 |
@@ -1,18 +1,17 @@ | ||
1 | 1 | package osm.jp.gpx.matchtime.gui.restamp; |
2 | 2 | |
3 | 3 | import java.awt.BorderLayout; |
4 | +import java.awt.Dialog; | |
4 | 5 | import java.awt.GridLayout; |
5 | 6 | import javax.swing.BoxLayout; |
6 | 7 | import javax.swing.JButton; |
8 | +import javax.swing.JDialog; | |
7 | 9 | import javax.swing.JLabel; |
8 | 10 | import javax.swing.JPanel; |
9 | 11 | import javax.swing.JScrollPane; |
10 | -import javax.swing.JTabbedPane; | |
11 | -import osm.jp.gpx.ImportPicture; | |
12 | 12 | import osm.jp.gpx.matchtime.gui.AdjustTime; |
13 | 13 | import static osm.jp.gpx.matchtime.gui.AdjustTime.createImageIcon; |
14 | 14 | import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n; |
15 | -import osm.jp.gpx.matchtime.gui.Card; | |
16 | 15 | import osm.jp.gpx.matchtime.gui.PanelAction; |
17 | 16 | import osm.jp.gpx.matchtime.gui.ParameterPanelTime; |
18 | 17 |
@@ -20,24 +19,26 @@ import osm.jp.gpx.matchtime.gui.ParameterPanelTime; | ||
20 | 19 | * [基準画像(開始)]選択パネル |
21 | 20 | * @author yuu |
22 | 21 | */ |
23 | -public class CardCorectTime extends Card implements PanelAction { | |
22 | +public class DialogCorectTime extends JDialog implements PanelAction { | |
23 | + public JPanel mainPanel; | |
24 | 24 | JPanel argsPanel; // パラメータ設定パネル (上部) |
25 | 25 | ParameterPanelTime arg_basetime; // 開始画像の基準時刻: |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * コンストラクタ |
29 | - * @param tabbe parent panel | |
30 | 29 | * @param arg3_basetime 開始画像の基準時刻: |
30 | + * @param owner | |
31 | 31 | */ |
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); | |
34 | 34 | |
35 | 35 | argsPanel = new JPanel(); |
36 | 36 | argsPanel.setLayout(new GridLayout(2, 1)); |
37 | 37 | |
38 | 38 | //---- 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); | |
41 | 42 | |
42 | 43 | // 3. 正確な撮影時刻を入力してください。 |
43 | 44 | // カメラの時計が正確ならば、設定を変更する必要はありません。 |
@@ -47,26 +48,26 @@ public class CardCorectTime extends Card implements PanelAction { | ||
47 | 48 | |
48 | 49 | // 基準時刻: |
49 | 50 | 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); | |
54 | 55 | |
55 | 56 | // 参考画像 |
56 | 57 | JLabel imageLabel = new JLabel(); |
57 | 58 | JScrollPane imageSPane = new JScrollPane(imageLabel); |
58 | - this.mainPanel.add(imageSPane, BorderLayout.CENTER); | |
59 | + centerPanel.add(imageSPane, BorderLayout.CENTER); | |
59 | 60 | |
60 | 61 | // 画像ファイル選択ダイアログを起動するボタン |
61 | 62 | JPanel buttonPanel = new JPanel(); |
62 | 63 | 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"))); | |
64 | 65 | buttonPanel.add(openButton); |
65 | 66 | JButton zoomInButton = new JButton(createImageIcon("images/ZoomIn16.gif")); |
66 | 67 | buttonPanel.add(zoomInButton); |
67 | 68 | JButton zoomOutButton = new JButton(createImageIcon("images/ZoomOut16.gif")); |
68 | 69 | buttonPanel.add(zoomOutButton); |
69 | - this.mainPanel.add(buttonPanel, BorderLayout.SOUTH); | |
70 | + centerPanel.add(buttonPanel, BorderLayout.SOUTH); | |
70 | 71 | } |
71 | 72 | |
72 | 73 | @Override |
@@ -171,7 +171,7 @@ public class RestampDialog extends Dialog implements Observer | ||
171 | 171 | } |
172 | 172 | ); |
173 | 173 | |
174 | - CardFirstFile card = new CardFirstFile(cardPanel, arg2_basetime); | |
174 | + CardFirstFile card = new CardFirstFile(cardPanel, arg2_basetime, this); | |
175 | 175 | cardPanel.addTab(card.getTitle(), card); |
176 | 176 | cardPanel.setEnabledAt(cardNo, false); |
177 | 177 | cards[cardNo] = card; |