red: muiltiTRK.GarminColorado.gpxでマルチTRKノードが認識されない。ImportPictureTestの強化。
1 parent 886d22f commit 2cf2ea5f90109c4dee3b29bf1e2a523f8556e4eb
@hayashi hayashi authored on 26 Jun 2017
Showing 18 changed files
View
0
■■■■■
importPicture/doc/GPX.class.violet.html
Too large (Show diff)
View
18
importPicture/src/osm/jp/gpx/AppParameters.java
File file;
public AppParameters() throws FileNotFoundException, IOException {
super();
this.file = new File(FILE_PATH);
syncFile();
}
 
public AppParameters(Properties defaults) throws FileNotFoundException, IOException {
super(defaults);
this.file = new File(FILE_PATH);
syncFile();
}
public AppParameters(String iniFileName) throws FileNotFoundException, IOException {
super();
this.file = new File(iniFileName);
syncFile();
}
void syncFile() throws FileNotFoundException, IOException {
boolean update = false;
this.file = new File(FILE_PATH);
if (file.exists()) {
if (this.file.exists()) {
// ファイルが存在すれば、その内容をロードする。
this.load(new FileInputStream(file));
}
else {
 
if (update) {
// ・ファイルがなければ新たに作る
// ・項目が足りない時は書き足す。
this.store(new FileOutputStream(this.file), "defuilt settings");
}
}
this.store(new FileOutputStream(this.file), "defuilt settings");
}
}
public void store() throws FileNotFoundException, IOException {
this.store(new FileOutputStream(this.file), "by AdjustTime");
}
View
14
importPicture/src/osm/jp/gpx/ElementMapTRKPT.java
super(new TimeComparator());
}
 
/**
* 拡張put value:ElementをputするとElement内のtimeを読み取ってkeyとしてsuper.put(key,value)する。
* 拡張put value:ElementをputするとElement内のtimeを読み取ってkeyとしてthis.put(key,value)する。
* @param value
* @return keyとして登録したtime:Date
* @throws ParseException
* @throws DOMException
}
}
return null;
}
public void printinfo() {
Date firstTime = null;
Date lastTime = null;
for (Date key : this.keySet()) {
if (firstTime == null) {
firstTime = new Date(key.getTime());
}
lastTime = new Date(key.getTime());
}
System.out.println(String.format("| <trkpt/> |%20s|%20s|", ImportPicture.dfuk.format(firstTime), ImportPicture.dfuk.format(lastTime)));
}
}
View
71
importPicture/src/osm/jp/gpx/ElementMapTRKSEG.java 0 → 100644
package osm.jp.gpx;
 
import java.text.ParseException;
import java.util.Date;
import java.util.TreeMap;
 
import org.w3c.dom.*;
 
@SuppressWarnings("serial")
public class ElementMapTRKSEG extends TreeMap<Date, ElementMapTRKPT> {
public ElementMapTRKSEG() {
super(new TimeComparator());
}
/**
* 拡張put value:Node<TRKSEG>をputするとNode<TRKSEG>内のNode<TRKSPT>を put(key,value)する。
* @param nodeTRKSEG
* @return keyとして登録したtime:Date
* @throws ParseException
* @throws DOMException
*/
public Date put(Node nodeTRKSEG) throws DOMException, ParseException {
if (nodeTRKSEG.getNodeName().equals("trkseg")) {
NodeList nodes2 = nodeTRKSEG.getChildNodes();
Date trksegStartTime = new Date(); // 対象とする開始時刻(現在時刻)
ElementMapTRKPT mapTRKPT = new ElementMapTRKPT();
for (int i2 = 0; i2 < nodes2.getLength(); i2++) {
Node nodeTRKPT = nodes2.item(i2);
if (nodeTRKPT.getNodeName().equals("trkpt")) {
if (ImportPicture.param_GpxNoFirstNode && (i2 == 0)) {
continue;
}
Date time = mapTRKPT.put((Element)nodeTRKPT);
if (trksegStartTime.compareTo(time) < 0) {
trksegStartTime = time;
}
}
}
this.put(trksegStartTime, mapTRKPT);
return trksegStartTime;
}
return null;
}
/**
* 拡張put value:ElementMapTRKPTをputするとElementMapTRKPT内の最初のエントリのtimeを読み取ってkeyとしてthis.put(key,value)する。
* @param value
* @return keyとして登録したtime:Date
* @throws ParseException
* @throws DOMException
*/
public Date put(ElementMapTRKPT value) {
for (Date key : value.keySet()) {
this.put(key, value);
return key;
}
return null;
}
public void printinfo() {
for (java.util.Map.Entry<Date, ElementMapTRKPT> map : this.entrySet()) {
System.out.println("|--------------------------------|--------------------|--------------------|");
ElementMapTRKPT mapTRKPT = map.getValue();
mapTRKPT.printinfo();
}
}
 
}
View
importPicture/src/osm/jp/gpx/ImportPicture.java
View
importPicture/src/osm/jp/gpx/matchtime/gui/AdjustTime.java
View
importPicture/test/osm/jp/gpx/ImportPictureTest.java
Too large (Show diff)
View
importPicture/testdata/AdjustTime.20170518.A1.ini 0 → 100644
View
importPicture/testdata/AdjustTime.20170518.A2.ini 0 → 100644
View
importPicture/testdata/AdjustTime.20170518.B1.ini 0 → 100644
View
importPicture/testdata/AdjustTime.20170518.B2.ini 0 → 100644
View
importPicture/testdata/AdjustTime.20170518.ini
View
importPicture/testdata/AdjustTime.M1a.separate.ini 0 → 100644
View
importPicture/testdata/AdjustTime.M1b.separate.ini 0 → 100644
View
importPicture/testdata/AdjustTime.M1c.separate.ini 0 → 100644
View
importPicture/testdata/AdjustTime.M1d.separate.ini 0 → 100644
View
importPicture/testdata/AdjustTime.M2a.separate.ini 0 → 100644
View
importPicture/testdata/AdjustTime.separate.ini