diff --git a/importPicture/src/AdjustTime2.jnlp b/importPicture/src/AdjustTime2.jnlp new file mode 100644 index 0000000..d865797 --- /dev/null +++ b/importPicture/src/AdjustTime2.jnlp @@ -0,0 +1,35 @@ + + + + + SwingSet2 Demo Application + Sun Microsystems, Inc. + + SwingSet2 Demo Application + A demo of the capabilities +of the Swing Graphical User Interface. + + + + + + + + + + + + + + SwingSet2 Demo on Linux + + + + + + + + + + + \ No newline at end of file diff --git a/importPicture/src/osm/jp/gpx/AppParameters.java b/importPicture/src/osm/jp/gpx/AppParameters.java index 728b4be..c2fc36b 100644 --- a/importPicture/src/osm/jp/gpx/AppParameters.java +++ b/importPicture/src/osm/jp/gpx/AppParameters.java @@ -114,16 +114,18 @@ valueStr = this.getProperty(IMG_OUTPUT); if (valueStr == null) { update = true; - this.setProperty(IMG_OUTPUT, String.valueOf(true)); + valueStr = String.valueOf(true); } + this.setProperty(IMG_OUTPUT, String.valueOf(valueStr)); //------------------------------------------------ // IMG出力: EXIFを変換する valueStr = this.getProperty(IMG_OUTPUT_EXIF); if (valueStr == null) { update = true; - this.setProperty(IMG_OUTPUT_EXIF, String.valueOf(true)); + valueStr = String.valueOf(true); } + this.setProperty(IMG_OUTPUT_EXIF, String.valueOf(valueStr)); //------------------------------------------------ // GPX出力: 時間的に間隔が開いたGPXログを別のセグメントに分割する。 {ON | OFF} diff --git a/importPicture/src/osm/jp/gpx/ImportPicture.java b/importPicture/src/osm/jp/gpx/ImportPicture.java index e4bb2c9..c28da45 100644 --- a/importPicture/src/osm/jp/gpx/ImportPicture.java +++ b/importPicture/src/osm/jp/gpx/ImportPicture.java @@ -192,18 +192,21 @@ obj.param_GpxOutputSpeed = true; } - // 第6引数が指定されなければ、指定されたディレクトリ内のGPXファイルすべてを対象とする - if (argv.length >= 5) { - obj.gpxDir = new File(argv[4]); + paramStr = obj.params.getProperty(AppParameters.GPX_SOURCE_FOLDER); + if (paramStr != null) { + obj.param_GpxSourceFolder = new String(paramStr); + obj.gpxDir = new File(obj.param_GpxSourceFolder); if (!obj.gpxDir.exists()) { // GPXファイルまたはディレクトリが存在しません。 - System.out.println("GPXファイルまたはディレクトリが存在しません。('"+ argv[4] +"')"); + System.out.println("GPXファイルまたはディレクトリが存在しません。('"+ paramStr +"')"); return; } - } + } else { obj.gpxDir = obj.imgDir; } + + // 指定されたディレクトリ内のGPXファイルすべてを対象とする if (obj.gpxDir.isDirectory()) { File[] files = obj.gpxDir.listFiles(); if (files == null) { @@ -214,7 +217,7 @@ for (File file : files) { if (file.isFile()) { String filename = file.getName().toUpperCase(); - if (filename.endsWith(".GPX")) { + if (filename.toUpperCase().endsWith(".GPX")) { if (!filename.toUpperCase().endsWith("_.GPX") || obj.param_GpxReuse) { obj.gpxFiles.add(file); } @@ -225,7 +228,12 @@ else { obj.gpxFiles.add(obj.gpxDir); } - + + paramStr = obj.params.getProperty(AppParameters.IMG_OUTPUT_EXIF); + if ((paramStr != null) && (paramStr.equals(Boolean.toString(true)))) { + obj.exif = true; + } + System.out.println(" - param: imgDir = '"+ obj.imgDir.getAbsolutePath() +"'"); System.out.println(" - param: outDir = '"+ (obj.outDir == null ? "" : obj.outDir.getAbsolutePath()) +"'"); System.out.println(" - param: gpxDir = '"+ (obj.gpxDir == null ? "" : obj.gpxDir.getAbsolutePath()) +"'"); @@ -235,7 +243,8 @@ System.out.println(" - param: "+ AppParameters.GPX_REUSE +"="+ obj.param_GpxReuse); System.out.println(" - param: "+ AppParameters.GPX_BASETIME +"="+ obj.params.getProperty(AppParameters.GPX_BASETIME) ); System.out.println(" - param: "+ AppParameters.IMG_OUTPUT +"="+ obj.params.getProperty(AppParameters.IMG_OUTPUT)); - System.out.println(" - param: "+ AppParameters.IMG_OUTPUT_EXIF +"= '"+ String.valueOf(obj.exif) +"'"); + System.out.println(" - param: "+ AppParameters.IMG_OUTPUT_EXIF +"= "+ String.valueOf(obj.exif)); + System.out.println(" - param: "+ AppParameters.GPX_SOURCE_FOLDER +"="+ obj.param_GpxSourceFolder); System.out.println(" - param: "+ AppParameters.GPX_OUTPUT_WPT +"="+ obj.param_GpxOutputWpt); System.out.println(" - param: "+ AppParameters.GPX_OVERWRITE_MAGVAR +"="+ obj.param_GpxOverwriteMagvar); System.out.println(" - param: "+ AppParameters.GPX_OUTPUT_SPEED +"="+ obj.param_GpxOutputSpeed); @@ -259,6 +268,7 @@ public boolean param_GpxOutputSpeed = false; public boolean param_GpxOverwriteMagvar = false; public boolean param_GpxOutputWpt = true; + public String param_GpxSourceFolder = "."; @Override public void run() { @@ -313,9 +323,9 @@ File outputFile = new File(outDir, iStr +"_.gpx"); System.out.println(gpxFile.getAbsolutePath() + " => "+ outputFile.getAbsolutePath()); - System.out.println(" 時差: "+ (delta / 1000) +"(sec)"); - System.out.println(" Target GPX: ["+ gpxFile.getAbsolutePath() +"]"); - System.out.println(" EXIF: "+ (exif ? ("convert to '" + outDir.getAbsolutePath() +"'") : "off")); + System.out.println(" 時差: "+ (delta / 1000) +"(sec)"); + System.out.println(" Target GPX: ["+ gpxFile.getAbsolutePath() +"]"); + System.out.println(" EXIF: "+ (exif ? ("convert to '" + outDir.getAbsolutePath() +"'") : "off")); System.out.println(); factory = DocumentBuilderFactory.newInstance();