• R/O
  • HTTP
  • SSH
  • HTTPS

importpicture: Commit


Commit MetaInfo

Revision6f500da72c910061356f3c9a2b3d088596db51af (tree)
Time2019-10-11 04:22:24
Authorhaya4 <hayashi.yuu@gmai...>
Commiterhaya4

Log Message

fixed: 画像ファイルが選択されたら次のパネルを有効にする

Change Summary

Incremental Difference

--- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java
+++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java
@@ -39,7 +39,8 @@ public class ParameterPanelFolder extends ParameterPanel implements ActionListen
3939 openButton.setEnabled(f);
4040 }
4141
42- public File getDirectory(String path) throws FileNotFoundException {
42+ public File getDirectory() throws FileNotFoundException {
43+ String path = this.argField.getText();
4344 if (path == null) {
4445 throw new FileNotFoundException("Image folder is Not specifiyed yet.");
4546 }
@@ -56,28 +57,28 @@ public class ParameterPanelFolder extends ParameterPanel implements ActionListen
5657 @Override
5758 public void actionPerformed(ActionEvent e) {
5859 if (e.getSource() == openButton){
59- System.out.println("ParameterPanelFolder.actionPerformed(openButton)");
60- File sdir;
61- try {
62- sdir = getDirectory(this.argField.getText());
63- } catch (FileNotFoundException ex) {
64- sdir = new File(".");
65- this.argField.setText(sdir.getAbsolutePath());
66- }
67- if (sdir.exists()) {
68- this.fc = new JFileChooser(sdir);
69- }
70- else {
71- this.fc = new JFileChooser();
72- }
73- this.fc.setFileSelectionMode(this.chooser);
74-
75- int returnVal = this.fc.showOpenDialog(ParameterPanelFolder.this);
76-
77- if (returnVal == JFileChooser.APPROVE_OPTION) {
78- File file = this.fc.getSelectedFile();
79- this.argField.setText(file.getAbsolutePath());
80- }
60+ System.out.println("ParameterPanelFolder.actionPerformed(openButton)");
61+ File sdir;
62+ try {
63+ sdir = getDirectory();
64+ } catch (FileNotFoundException ex) {
65+ sdir = new File(".");
66+ this.argField.setText(sdir.getAbsolutePath());
67+ }
68+ if (sdir.exists()) {
69+ this.fc = new JFileChooser(sdir);
70+ }
71+ else {
72+ this.fc = new JFileChooser();
73+ }
74+ this.fc.setFileSelectionMode(this.chooser);
75+
76+ int returnVal = this.fc.showOpenDialog(ParameterPanelFolder.this);
77+
78+ if (returnVal == JFileChooser.APPROVE_OPTION) {
79+ File file = this.fc.getSelectedFile();
80+ this.argField.setText(file.getAbsolutePath());
81+ }
8182 }
8283 }
8384
--- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java
+++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java
@@ -78,7 +78,7 @@ public class ParameterPanelImageFile extends ParameterPanel {
7878 String text = this.argField.getText();
7979 if (text != null) {
8080 try {
81- File dir = this.paramDir.getDirectory(text);
81+ File dir = this.paramDir.getDirectory();
8282 File file = new File(dir, text);
8383 if (file.exists() && file.isFile()) {
8484 String name = file.getName().toUpperCase();
Show on old repository browser