diff --git a/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java b/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java index 0228da1..6b18464 100644 --- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java +++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelFolder.java @@ -39,7 +39,8 @@ openButton.setEnabled(f); } - public File getDirectory(String path) throws FileNotFoundException { + public File getDirectory() throws FileNotFoundException { + String path = this.argField.getText(); if (path == null) { throw new FileNotFoundException("Image folder is Not specifiyed yet."); } @@ -56,28 +57,28 @@ @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == openButton){ - System.out.println("ParameterPanelFolder.actionPerformed(openButton)"); - File sdir; - try { - sdir = getDirectory(this.argField.getText()); - } catch (FileNotFoundException ex) { - sdir = new File("."); - this.argField.setText(sdir.getAbsolutePath()); - } - if (sdir.exists()) { - this.fc = new JFileChooser(sdir); - } - else { - this.fc = new JFileChooser(); - } - this.fc.setFileSelectionMode(this.chooser); - - int returnVal = this.fc.showOpenDialog(ParameterPanelFolder.this); - - if (returnVal == JFileChooser.APPROVE_OPTION) { - File file = this.fc.getSelectedFile(); - this.argField.setText(file.getAbsolutePath()); - } + System.out.println("ParameterPanelFolder.actionPerformed(openButton)"); + File sdir; + try { + sdir = getDirectory(); + } catch (FileNotFoundException ex) { + sdir = new File("."); + this.argField.setText(sdir.getAbsolutePath()); + } + if (sdir.exists()) { + this.fc = new JFileChooser(sdir); + } + else { + this.fc = new JFileChooser(); + } + this.fc.setFileSelectionMode(this.chooser); + + int returnVal = this.fc.showOpenDialog(ParameterPanelFolder.this); + + if (returnVal == JFileChooser.APPROVE_OPTION) { + File file = this.fc.getSelectedFile(); + this.argField.setText(file.getAbsolutePath()); + } } } diff --git a/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java b/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java index e651f92..a381b62 100644 --- a/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java +++ b/src/osm/jp/gpx/matchtime/gui/ParameterPanelImageFile.java @@ -78,7 +78,7 @@ String text = this.argField.getText(); if (text != null) { try { - File dir = this.paramDir.getDirectory(text); + File dir = this.paramDir.getDirectory(); File file = new File(dir, text); if (file.exists() && file.isFile()) { String name = file.getName().toUpperCase();