diff --git a/.gitignore b/.gitignore index 05ba256..4beedd8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .project .settings/ *.class +*.log *.zip *.jar *.tar.gz diff --git a/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelFolder.java b/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelFolder.java index 6af259f..714fbc2 100644 --- a/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelFolder.java +++ b/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelFolder.java @@ -61,7 +61,7 @@ throw new FileNotFoundException(String.format("Folder '%s' is Not exists.", path)); } if (!sdir.isDirectory()) { - throw new FileNotFoundException(String.format("Folder '%s' is Not directory.", path)); + sdir = sdir.getParentFile(); } return sdir; } @@ -120,6 +120,9 @@ if (returnVal == JFileChooser.APPROVE_OPTION) { File file = this.fc.getSelectedFile(); + if (!file.isDirectory()) { + file = file.getParentFile(); + } String text = file.getAbsolutePath(); this.argField.setText(text); } diff --git a/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelSourceFolder.java b/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelSourceFolder.java index 888d390..f30e68b 100644 --- a/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelSourceFolder.java +++ b/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelSourceFolder.java @@ -3,6 +3,8 @@ import java.io.File; import java.io.FileNotFoundException; +import javax.swing.JFileChooser; + import osm.jp.gpx.matchtime.gui.AdjustTerra; import osm.jp.gpx.matchtime.gui.ImageFileFilter; @@ -16,7 +18,7 @@ * @param text */ public ParameterPanelSourceFolder(String name, String label, String text) { - super(name, label, text); + super(name, label, text, JFileChooser.FILES_AND_DIRECTORIES); } /** diff --git a/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelTime.java b/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelTime.java index 806071a..07c6ab8 100644 --- a/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelTime.java +++ b/src/main/java/osm/jp/gpx/matchtime/gui/parameters/ParameterPanelTime.java @@ -2,7 +2,6 @@ import java.awt.Window; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; @@ -30,7 +29,7 @@ * パラメータを設定する為のパネル。 * この1インスタンスで、1パラメータをあらわす。 */ -public class ParameterPanelTime extends ParameterPanel implements ActionListener { +public class ParameterPanelTime extends ParameterPanel { private static final long serialVersionUID = 1683226418990348336L; SimpleDateFormat sdf = (SimpleDateFormat)DateFormat.getDateTimeInstance(); ParameterPanelImageFile imageFile; // 基準時刻画像 @@ -222,16 +221,4 @@ return false; } } - - @Override - public void actionPerformed(ActionEvent e) { - // TODO Auto-generated method stub - - } - - @Override - public void propertyChange(PropertyChangeEvent evt) { - // TODO Auto-generated method stub - - } }