Revision | 959d9bab05bcfcc206dcfa743640b5947d025b60 (tree) |
---|---|
Time | 2019-10-09 19:37:46 |
Author | ![]() |
Commiter | haya4 |
対象フォルダが入力されたら次のパネルを有効にする
@@ -276,7 +276,11 @@ public class AdjustTime extends JFrame | ||
276 | 276 | |
277 | 277 | // 基準時刻: |
278 | 278 | String str310 = String.format(" %s: ", i18n.getString("label.310")); |
279 | - arg3_basetime = new ParameterPanel(str310, ImportPicture.TIME_FORMAT_STRING); | |
279 | + arg3_basetime = new ParameterPanelTime( | |
280 | + str310, | |
281 | + ImportPicture.TIME_FORMAT_STRING, | |
282 | + arg2_baseTimeImg | |
283 | + ); | |
280 | 284 | argsPanel.add(arg3_basetime); |
281 | 285 | card.mainPanel.add(argsPanel, BorderLayout.NORTH); |
282 | 286 |
@@ -463,7 +467,7 @@ public class AdjustTime extends JFrame | ||
463 | 467 | openButton.addActionListener(lSymAction); |
464 | 468 | zoomOutButton.addActionListener(lSymAction); |
465 | 469 | zoomInButton.addActionListener(lSymAction); |
466 | - arg2_baseTimeImg.argField.addActionListener(lSymAction); | |
470 | + //arg2_baseTimeImg.argField.addActionListener(lSymAction); | |
467 | 471 | arg2_baseTimeImg.openButton.addActionListener(lSymAction); |
468 | 472 | doButton.addActionListener(lSymAction); |
469 | 473 | outputIMG_all.addActionListener(lSymAction); |
@@ -2,4 +2,10 @@ package osm.jp.gpx.matchtime.gui; | ||
2 | 2 | |
3 | 3 | public interface PanelAction { |
4 | 4 | void openAction(); |
5 | + | |
6 | + /** | |
7 | + * 入力条件が満たされているかどうか | |
8 | + * @return | |
9 | + */ | |
10 | + boolean isEnable(); | |
5 | 11 | } |
@@ -2,4 +2,6 @@ package osm.jp.gpx.matchtime.gui; | ||
2 | 2 | |
3 | 3 | public interface ParamAction { |
4 | 4 | boolean isEnable(); |
5 | + void setText(String text); | |
6 | + String getText(); | |
5 | 7 | } |
@@ -0,0 +1,23 @@ | ||
1 | +package osm.jp.gpx.matchtime.gui; | |
2 | + | |
3 | +import java.util.Observable; | |
4 | + | |
5 | +public class ParameterData extends Observable { | |
6 | + String content = ""; | |
7 | + | |
8 | + String getContent() { | |
9 | + return content; | |
10 | + } | |
11 | + | |
12 | + void setContent(String content) { | |
13 | + this.content = content; | |
14 | + setChanged(); | |
15 | + super.notifyObservers(content); | |
16 | + clearChanged(); | |
17 | + } | |
18 | + | |
19 | + @Override | |
20 | + public void notifyObservers(Object arg) { | |
21 | + setContent(arg.toString()); | |
22 | + } | |
23 | +} |
@@ -1,7 +1,6 @@ | ||
1 | 1 | package osm.jp.gpx.matchtime.gui; |
2 | 2 | |
3 | 3 | import java.awt.Dimension; |
4 | -import java.awt.event.ActionListener; | |
5 | 4 | import java.util.ResourceBundle; |
6 | 5 | |
7 | 6 | import javax.swing.BoxLayout; |
@@ -13,7 +12,7 @@ import javax.swing.JTextField; | ||
13 | 12 | * パラメータを設定する為のパネル。 |
14 | 13 | * この1インスタンスで、1パラメータをあらわす。 |
15 | 14 | */ |
16 | -public abstract class ParameterPanel extends JPanel implements ActionListener,ParamAction { | |
15 | +public abstract class ParameterPanel extends JPanel implements ParamAction { | |
17 | 16 | private static final long serialVersionUID = 4629824800747170556L; |
18 | 17 | public JTextField argField; |
19 | 18 | public JLabel argLabel; |
@@ -43,11 +42,12 @@ public abstract class ParameterPanel extends JPanel implements ActionListener,Pa | ||
43 | 42 | return this; |
44 | 43 | } |
45 | 44 | |
46 | - public ParameterPanel setText(String text) { | |
45 | + @Override | |
46 | + public void setText(String text) { | |
47 | 47 | this.argField.setText(text); |
48 | - return this; | |
49 | 48 | } |
50 | 49 | |
50 | + @Override | |
51 | 51 | public String getText() { |
52 | 52 | return this.argField.getText(); |
53 | 53 | } |
@@ -1,13 +1,14 @@ | ||
1 | 1 | package osm.jp.gpx.matchtime.gui; |
2 | 2 | |
3 | 3 | import java.awt.event.ActionEvent; |
4 | +import java.awt.event.ActionListener; | |
4 | 5 | import java.io.File; |
5 | 6 | import java.io.FileNotFoundException; |
6 | 7 | import javax.swing.JButton; |
7 | 8 | import javax.swing.JFileChooser; |
8 | 9 | |
9 | 10 | @SuppressWarnings("serial") |
10 | -public class ParameterPanelFolder extends ParameterPanel | |
11 | +public class ParameterPanelFolder extends ParameterPanel implements ActionListener | |
11 | 12 | { |
12 | 13 | JFileChooser fc; |
13 | 14 | JButton openButton; |
@@ -37,7 +38,7 @@ public class ParameterPanelFolder extends ParameterPanel | ||
37 | 38 | super.setEnabled(f); |
38 | 39 | openButton.setEnabled(f); |
39 | 40 | } |
40 | - | |
41 | + | |
41 | 42 | public File getDirectory() throws FileNotFoundException { |
42 | 43 | String path = this.argField.getText(); |
43 | 44 | if (path == null) { |
@@ -79,8 +80,22 @@ public class ParameterPanelFolder extends ParameterPanel | ||
79 | 80 | } |
80 | 81 | } |
81 | 82 | |
83 | + /** | |
84 | + * 有効な値が設定されているかどうか | |
85 | + * @return | |
86 | + */ | |
82 | 87 | @Override |
83 | 88 | public boolean isEnable() { |
84 | - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. | |
89 | + String text = this.argField.getText(); | |
90 | + if (text == null) { | |
91 | + return false; | |
92 | + } | |
93 | + try { | |
94 | + File dir = new File(text); | |
95 | + return (dir.exists() && dir.isDirectory()); | |
96 | + } | |
97 | + catch (Exception e) { | |
98 | + return false; | |
99 | + } | |
85 | 100 | } |
86 | 101 | } |
\ No newline at end of file |
@@ -54,4 +54,13 @@ public class ParameterPanelGpx extends ParameterPanel implements ActionListener | ||
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |
57 | + | |
58 | + /** | |
59 | + * このフィールドに有効な値が設定されているかどうか | |
60 | + * @return | |
61 | + */ | |
62 | + @Override | |
63 | + public boolean isEnable() { | |
64 | + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. | |
65 | + } | |
57 | 66 | } |
@@ -1,12 +1,14 @@ | ||
1 | 1 | package osm.jp.gpx.matchtime.gui; |
2 | 2 | |
3 | 3 | import java.awt.event.ActionEvent; |
4 | +import java.awt.event.ActionListener; | |
4 | 5 | import java.io.File; |
6 | +import java.io.FileNotFoundException; | |
5 | 7 | import javax.swing.JButton; |
6 | 8 | import javax.swing.JFileChooser; |
7 | 9 | |
8 | 10 | @SuppressWarnings("serial") |
9 | -public class ParameterPanelImageFile extends ParameterPanel { | |
11 | +public class ParameterPanelImageFile extends ParameterPanel implements ActionListener { | |
10 | 12 | JFileChooser fc; |
11 | 13 | public JButton openButton; |
12 | 14 | public ParameterPanelFolder paramDir; |
@@ -66,6 +68,24 @@ public class ParameterPanelImageFile extends ParameterPanel { | ||
66 | 68 | */ |
67 | 69 | @Override |
68 | 70 | public boolean isEnable() { |
69 | - throw new UnsupportedOperationException("Not supported yet."); | |
71 | + if (this.paramDir.isEnable()) { | |
72 | + String text = this.argField.getText(); | |
73 | + if (text != null) { | |
74 | + try { | |
75 | + File dir = this.paramDir.getDirectory(); | |
76 | + File file = new File(dir, text); | |
77 | + if (file.exists() && file.isFile()) { | |
78 | + String name = file.getName().toUpperCase(); | |
79 | + if (name.endsWith(".JPG") || name.endsWith(".JPEG")) { | |
80 | + return true; | |
81 | + } | |
82 | + } | |
83 | + } | |
84 | + catch (FileNotFoundException e) { | |
85 | + return false; | |
86 | + } | |
87 | + } | |
88 | + } | |
89 | + return false; | |
70 | 90 | } |
71 | 91 | } |
\ No newline at end of file |
@@ -2,33 +2,47 @@ package osm.jp.gpx.matchtime.gui; | ||
2 | 2 | |
3 | 3 | import java.awt.event.ActionEvent; |
4 | 4 | import java.awt.event.ActionListener; |
5 | -import javax.swing.JButton; | |
6 | -import javax.swing.JFileChooser; | |
5 | +import java.text.DateFormat; | |
6 | +import java.text.SimpleDateFormat; | |
7 | 7 | |
8 | -@SuppressWarnings("serial") | |
8 | +/** | |
9 | + * パラメータを設定する為のパネル。 | |
10 | + * この1インスタンスで、1パラメータをあらわす。 | |
11 | + */ | |
9 | 12 | public class ParameterPanelTime extends ParameterPanel implements ActionListener { |
10 | - JFileChooser fc; | |
11 | - public JButton doButton; | |
13 | + SimpleDateFormat sdf = (SimpleDateFormat)DateFormat.getDateTimeInstance(); | |
14 | + ParameterPanelImageFile imageFile; | |
12 | 15 | |
13 | - @SuppressWarnings({"OverridableMethodCallInConstructor", "LeakingThisInConstructor"}) | |
14 | - public ParameterPanelTime(String label, String text) { | |
16 | + @SuppressWarnings("OverridableMethodCallInConstructor") | |
17 | + public ParameterPanelTime( | |
18 | + String label, | |
19 | + String text, | |
20 | + ParameterPanelImageFile imageFile | |
21 | + ) { | |
15 | 22 | super(label, text); |
16 | - | |
17 | - doButton = new JButton("処理実行", AdjustTime.createImageIcon("images/media_playback_start.png")); | |
18 | - doButton.addActionListener(this); | |
19 | - this.add(doButton); | |
23 | + this.imageFile = imageFile; | |
20 | 24 | } |
21 | - | |
25 | + | |
22 | 26 | @Override |
23 | - public void actionPerformed(ActionEvent e) { | |
27 | + public void actionPerformed(ActionEvent arg0) { | |
28 | + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. | |
24 | 29 | } |
25 | 30 | |
26 | - /** | |
27 | - * このフィールドに有効な値が設定されているかどうか | |
28 | - * @return | |
29 | - */ | |
30 | 31 | @Override |
31 | 32 | public boolean isEnable() { |
32 | - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. | |
33 | + if (this.imageFile.isEnable()) { | |
34 | + String text = this.argField.getText(); | |
35 | + if (text != null) { | |
36 | + try { | |
37 | + sdf.applyPattern("yyyy.MM.dd HH:mm:ss z"); | |
38 | + sdf.parse(text); | |
39 | + return true; | |
40 | + } | |
41 | + catch (Exception e) { | |
42 | + return false; | |
43 | + } | |
44 | + } | |
45 | + } | |
46 | + return false; | |
33 | 47 | } |
34 | -} | |
\ No newline at end of file | ||
48 | +} |
@@ -0,0 +1,25 @@ | ||
1 | +package osm.jp.gpx.matchtime.gui; | |
2 | + | |
3 | +import javax.swing.event.DocumentEvent; | |
4 | +import javax.swing.event.DocumentListener; | |
5 | + | |
6 | +@FunctionalInterface | |
7 | +public interface SimpleDocumentListener extends DocumentListener { | |
8 | + void update(DocumentEvent e); | |
9 | + | |
10 | + @Override | |
11 | + default void insertUpdate(DocumentEvent e) { | |
12 | + update(e); | |
13 | + } | |
14 | + | |
15 | + @Override | |
16 | + default void removeUpdate(DocumentEvent e) { | |
17 | + update(e); | |
18 | + } | |
19 | + | |
20 | + @Override | |
21 | + default void changedUpdate(DocumentEvent e) { | |
22 | + update(e); | |
23 | + } | |
24 | +} | |
25 | + |
@@ -14,22 +14,22 @@ import static osm.jp.gpx.matchtime.gui.AdjustTime.createImageIcon; | ||
14 | 14 | import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n; |
15 | 15 | import osm.jp.gpx.matchtime.gui.Card; |
16 | 16 | import osm.jp.gpx.matchtime.gui.PanelAction; |
17 | -import osm.jp.gpx.matchtime.gui.ParameterPanel; | |
17 | +import osm.jp.gpx.matchtime.gui.ParameterPanelTime; | |
18 | 18 | |
19 | 19 | /** |
20 | 20 | * [基準画像(開始)]選択パネル |
21 | 21 | * @author yuu |
22 | 22 | */ |
23 | -public class CardCorectTime extends Card { | |
23 | +public class CardCorectTime extends Card implements PanelAction { | |
24 | 24 | JPanel argsPanel; // パラメータ設定パネル (上部) |
25 | - ParameterPanel arg3_basetime; // 基準時刻: | |
25 | + ParameterPanelTime arg_basetime; // 開始画像の基準時刻: | |
26 | 26 | |
27 | 27 | /** |
28 | 28 | * コンストラクタ |
29 | 29 | * @param tabbe parent panel |
30 | - * @param arg3_basetime | |
30 | + * @param arg3_basetime 開始画像の基準時刻: | |
31 | 31 | */ |
32 | - public CardCorectTime(JTabbedPane tabbe, ParameterPanel arg3_basetime) { | |
32 | + public CardCorectTime(JTabbedPane tabbe, ParameterPanelTime arg3_basetime) { | |
33 | 33 | super(tabbe, AdjustTime.i18n.getString("tab.restamp.300"), 1, 3); |
34 | 34 | |
35 | 35 | argsPanel = new JPanel(); |
@@ -46,7 +46,7 @@ public class CardCorectTime extends Card { | ||
46 | 46 | argsPanel.add(label3); |
47 | 47 | |
48 | 48 | // 基準時刻: |
49 | - this.arg3_basetime = arg3_basetime; | |
49 | + this.arg_basetime = arg3_basetime; | |
50 | 50 | arg3_basetime.setLabel(String.format(" %s: ", i18n.getString("label.310"))); |
51 | 51 | arg3_basetime.setLabel(ImportPicture.TIME_FORMAT_STRING); |
52 | 52 | argsPanel.add(arg3_basetime); |
@@ -68,4 +68,19 @@ public class CardCorectTime extends Card { | ||
68 | 68 | buttonPanel.add(zoomOutButton); |
69 | 69 | this.mainPanel.add(buttonPanel, BorderLayout.SOUTH); |
70 | 70 | } |
71 | + | |
72 | + @Override | |
73 | + @SuppressWarnings("empty-statement") | |
74 | + public void openAction() { | |
75 | + ; // 何もしない | |
76 | + } | |
77 | + | |
78 | + /** | |
79 | + * 入力条件が満たされているかどうか | |
80 | + * @return | |
81 | + */ | |
82 | + @Override | |
83 | + public boolean isEnable() { | |
84 | + return this.arg_basetime.isEnable(); | |
85 | + } | |
71 | 86 | } |
@@ -19,17 +19,19 @@ import osm.jp.gpx.matchtime.gui.ParameterPanelImageFile; | ||
19 | 19 | */ |
20 | 20 | public class CardFirstFile extends Card implements PanelAction { |
21 | 21 | JPanel argsPanel; // パラメータ設定パネル (上部) |
22 | - ParameterPanelImageFile arg2_baseTimeImg; | |
23 | - | |
22 | + ParameterPanelImageFile arg_baseTimeImg; | |
23 | + | |
24 | 24 | /** |
25 | 25 | * コンストラクタ |
26 | 26 | * @param tabbe parent panel |
27 | 27 | * @param arg2_baseTimeImg |
28 | 28 | */ |
29 | - public CardFirstFile(JTabbedPane tabbe, ParameterPanelImageFile arg2_baseTimeImg) { | |
29 | + public CardFirstFile( | |
30 | + JTabbedPane tabbe, | |
31 | + ParameterPanelImageFile arg2_baseTimeImg | |
32 | + ) { | |
30 | 33 | super(tabbe, AdjustTime.i18n.getString("tab.restamp.200"), 0, 2); |
31 | - this.arg2_baseTimeImg = arg2_baseTimeImg; | |
32 | - | |
34 | + this.arg_baseTimeImg = arg2_baseTimeImg; | |
33 | 35 | this.mainPanel.add(new JLabel(i18n.getString("label.200")), BorderLayout.NORTH); |
34 | 36 | |
35 | 37 | argsPanel = new JPanel(); |
@@ -38,15 +40,18 @@ public class CardFirstFile extends Card implements PanelAction { | ||
38 | 40 | this.mainPanel.add(argsPanel, BorderLayout.CENTER); |
39 | 41 | } |
40 | 42 | |
43 | + /** | |
44 | + * 入力条件が満たされているかどうか | |
45 | + * @return | |
46 | + */ | |
47 | + @Override | |
48 | + public boolean isEnable() { | |
49 | + return this.arg_baseTimeImg.isEnable(); | |
50 | + } | |
51 | + | |
41 | 52 | @Override |
53 | + @SuppressWarnings("empty-statement") | |
42 | 54 | public void openAction() { |
43 | - try { | |
44 | - File dir = arg2_baseTimeImg.paramDir.getDirectory(); | |
45 | - } catch (FileNotFoundException ex) { | |
46 | - arg2_baseTimeImg.setText(null); | |
47 | - } | |
48 | - if (arg2_baseTimeImg.getText() == null) { | |
49 | - } | |
50 | - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. | |
55 | + ; // 何もしない | |
51 | 56 | } |
52 | 57 | } |
@@ -16,22 +16,33 @@ import osm.jp.gpx.matchtime.gui.ParameterPanelFolder; | ||
16 | 16 | * @author yuu |
17 | 17 | */ |
18 | 18 | public class CardSourceFolder extends Card implements PanelAction { |
19 | + ParameterPanelFolder arg_srcFolder; // 対象フォルダ | |
19 | 20 | |
20 | 21 | /** |
21 | 22 | * コンストラクタ |
22 | 23 | * @param tabbe parent panel |
23 | - * @param arg1_srcFolder 対象フォルダ | |
24 | + * @param arg_srcFolder 対象フォルダ | |
24 | 25 | */ |
25 | - public CardSourceFolder(JTabbedPane tabbe, ParameterPanelFolder arg1_srcFolder) { | |
26 | + public CardSourceFolder(JTabbedPane tabbe, ParameterPanelFolder arg_srcFolder) { | |
26 | 27 | super(tabbe, AdjustTime.i18n.getString("tab.100"), -1, 1); |
28 | + this.arg_srcFolder = arg_srcFolder; | |
27 | 29 | this.mainPanel.add(new JLabel(i18n.getString("label.100")), BorderLayout.NORTH); |
28 | 30 | |
29 | 31 | JPanel argsPanel = new JPanel(); // パラメータ設定パネル (上部) |
30 | 32 | argsPanel.setLayout(new BoxLayout(argsPanel, BoxLayout.Y_AXIS)); |
31 | - argsPanel.add(arg1_srcFolder); | |
33 | + argsPanel.add(arg_srcFolder); | |
32 | 34 | this.mainPanel.add(argsPanel, BorderLayout.CENTER); |
33 | 35 | } |
34 | 36 | |
37 | + /** | |
38 | + * 入力条件が満たされているかどうか | |
39 | + * @return | |
40 | + */ | |
41 | + @Override | |
42 | + public boolean isEnable() { | |
43 | + return this.arg_srcFolder.isEnable(); | |
44 | + } | |
45 | + | |
35 | 46 | @Override |
36 | 47 | @SuppressWarnings("empty-statement") |
37 | 48 | public void openAction() { |
@@ -4,20 +4,24 @@ import java.awt.event.ActionEvent; | ||
4 | 4 | import java.io.File; |
5 | 5 | import java.io.IOException; |
6 | 6 | import java.util.Date; |
7 | +import java.util.Observable; | |
8 | +import java.util.Observer; | |
7 | 9 | import javax.swing.*; |
10 | +import javax.swing.event.DocumentEvent; | |
8 | 11 | import osm.jp.gpx.AppParameters; |
9 | 12 | import osm.jp.gpx.matchtime.gui.AdjustTime; |
10 | 13 | import osm.jp.gpx.matchtime.gui.Card; |
11 | 14 | import osm.jp.gpx.matchtime.gui.ImageFileView; |
12 | 15 | import osm.jp.gpx.matchtime.gui.ImageFilter; |
13 | 16 | import osm.jp.gpx.matchtime.gui.ImagePreview; |
14 | -import osm.jp.gpx.matchtime.gui.ParameterPanel; | |
15 | 17 | import osm.jp.gpx.matchtime.gui.ParameterPanelFolder; |
16 | 18 | import osm.jp.gpx.matchtime.gui.ParameterPanelImageFile; |
17 | 19 | import static osm.jp.gpx.matchtime.gui.AdjustTime.i18n; |
20 | +import osm.jp.gpx.matchtime.gui.ParameterPanelTime; | |
21 | +import osm.jp.gpx.matchtime.gui.SimpleDocumentListener; | |
18 | 22 | |
19 | 23 | @SuppressWarnings("serial") |
20 | -public class RestampDialog extends Dialog | |
24 | +public class RestampDialog extends Dialog implements Observer | |
21 | 25 | { |
22 | 26 | //{{DECLARE_CONTROLS |
23 | 27 | java.awt.Label label1; |
@@ -26,16 +30,27 @@ public class RestampDialog extends Dialog | ||
26 | 30 | JLabel imageLabel; // 開始画像の基準時刻画像表示 |
27 | 31 | JTabbedPane cardPanel; // ウィザード形式パネル(タブ型) |
28 | 32 | JScrollPane imageSPane; // スクロールパネル |
29 | - JPanel[] cards; | |
33 | + Card[] cards; | |
30 | 34 | ParameterPanelFolder arg1_srcFolder; // 対象フォルダ |
31 | 35 | ParameterPanelImageFile arg2_baseTimeImg; // 開始画像ファイルパス |
32 | - ParameterPanel arg3_basetime; // 開始画像の基準時刻: | |
36 | + ParameterPanelTime arg2_basetime; // 開始画像の基準時刻: | |
33 | 37 | AppParameters params; |
34 | 38 | //}} |
35 | 39 | |
36 | 40 | // Used for addNotify redundency check. |
37 | 41 | boolean fComponentsAdjusted = false; |
38 | 42 | |
43 | + /** | |
44 | + * | |
45 | + * @param arg0 | |
46 | + * @param arg1 | |
47 | + */ | |
48 | + @Override | |
49 | + public void update(Observable arg0, Object arg1) { | |
50 | + String str = (String) arg1; | |
51 | + System.out.println("私はAです。観察対象の通知を検知したよ。" + str); | |
52 | + } | |
53 | + | |
39 | 54 | class SymWindow extends java.awt.event.WindowAdapter |
40 | 55 | { |
41 | 56 | @Override |
@@ -101,7 +116,7 @@ public class RestampDialog extends Dialog | ||
101 | 116 | |
102 | 117 | //--------------------------------------------------------------------- |
103 | 118 | params = new AppParameters(); |
104 | - cards = new JPanel[3]; | |
119 | + cards = new Card[3]; | |
105 | 120 | cardPanel = new JTabbedPane(JTabbedPane.LEFT); |
106 | 121 | mainPanel.add(cardPanel, BorderLayout.CENTER); |
107 | 122 | int cardNo = 0; |
@@ -113,6 +128,16 @@ public class RestampDialog extends Dialog | ||
113 | 128 | i18n.getString("label.110") +": ", |
114 | 129 | params.getProperty(AppParameters.IMG_SOURCE_FOLDER) |
115 | 130 | ); |
131 | + arg1_srcFolder.argField | |
132 | + .getDocument() | |
133 | + .addDocumentListener( | |
134 | + new SimpleDocumentListener() { | |
135 | + @Override | |
136 | + public void update(DocumentEvent e) { | |
137 | + toEnable(0, arg1_srcFolder.isEnable()); | |
138 | + } | |
139 | + } | |
140 | + ); | |
116 | 141 | |
117 | 142 | Card card = new CardSourceFolder(cardPanel, arg1_srcFolder); |
118 | 143 | cardPanel.addTab(card.getTitle(), card); |
@@ -130,6 +155,16 @@ public class RestampDialog extends Dialog | ||
130 | 155 | null, |
131 | 156 | arg1_srcFolder |
132 | 157 | ); |
158 | + arg2_baseTimeImg.argField | |
159 | + .getDocument() | |
160 | + .addDocumentListener( | |
161 | + new SimpleDocumentListener() { | |
162 | + @Override | |
163 | + public void update(DocumentEvent e) { | |
164 | + toEnable(1, arg2_baseTimeImg.isEnable()); | |
165 | + } | |
166 | + } | |
167 | + ); | |
133 | 168 | |
134 | 169 | CardFirstFile card = new CardFirstFile(cardPanel, arg2_baseTimeImg); |
135 | 170 | cardPanel.addTab(card.getTitle(), card); |
@@ -142,9 +177,23 @@ public class RestampDialog extends Dialog | ||
142 | 177 | // 2a. 開始画像の本当の時刻を設定の入力画面 |
143 | 178 | { |
144 | 179 | // 2a. 基準時刻: |
145 | - arg3_basetime = new ParameterPanel(); | |
180 | + arg2_basetime = new ParameterPanelTime( | |
181 | + i18n.getString("label.310"), | |
182 | + null, | |
183 | + arg2_baseTimeImg | |
184 | + ); | |
185 | + arg2_basetime.argField | |
186 | + .getDocument() | |
187 | + .addDocumentListener( | |
188 | + new SimpleDocumentListener() { | |
189 | + @Override | |
190 | + public void update(DocumentEvent e) { | |
191 | + toEnable(2, arg2_basetime.isEnable()); | |
192 | + } | |
193 | + } | |
194 | + ); | |
146 | 195 | |
147 | - CardCorectTime card = new CardCorectTime(cardPanel, arg3_basetime); | |
196 | + CardCorectTime card = new CardCorectTime(cardPanel, arg2_basetime); | |
148 | 197 | cardPanel.addTab(card.getTitle(), card); |
149 | 198 | cardPanel.setEnabledAt(cardNo, false); |
150 | 199 | cards[cardNo] = card; |
@@ -158,6 +207,21 @@ public class RestampDialog extends Dialog | ||
158 | 207 | closeButton.addActionListener(lSymAction); |
159 | 208 | //}} |
160 | 209 | } |
210 | + | |
211 | + | |
212 | + void toEnable(final int cardNo, final boolean enable) { | |
213 | + if ((cardNo >= 0) && (cardNo < cards.length)) { | |
214 | + cardPanel.setEnabledAt(cardNo, enable); | |
215 | + if ((cardNo -1) >= 0) { | |
216 | + cards[cardNo -1].nextButton.setEnabled(enable); | |
217 | + } | |
218 | + if ((cardNo +1) < cards.length) { | |
219 | + cardPanel.setEnabledAt(cardNo+1, enable); | |
220 | + cards[cardNo +1].backButton.setEnabled(enable); | |
221 | + cards[cardNo].nextButton.setEnabled(enable); | |
222 | + } | |
223 | + } | |
224 | + } | |
161 | 225 | |
162 | 226 | @SuppressWarnings("OverridableMethodCallInConstructor") |
163 | 227 | public RestampDialog(Frame parent, String title, boolean modal) throws IOException { |
@@ -229,7 +293,7 @@ public class RestampDialog extends Dialog | ||
229 | 293 | |
230 | 294 | File timeFile = new File(path); |
231 | 295 | long lastModifyTime = timeFile.lastModified(); |
232 | - arg3_basetime.argField.setText(AdjustTime.dfjp.format(new Date(lastModifyTime))); | |
296 | + arg2_basetime.argField.setText(AdjustTime.dfjp.format(new Date(lastModifyTime))); | |
233 | 297 | |
234 | 298 | int size_x = imageSPane.getWidth() - 8; |
235 | 299 | ImageIcon tmpIcon = new ImageIcon(path); |