Reverted some unneeded changes mistakenly made during bugfixing.
This commit is contained in:
parent
713a3b9d4b
commit
b286326aa8
2 changed files with 0 additions and 31 deletions
|
@ -646,23 +646,6 @@ public class Algorithms {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String colorNameToString(String colorName) {
|
|
||||||
Map<String, String> colorTable = new HashMap<>();
|
|
||||||
colorTable.put("black", "#000000");
|
|
||||||
colorTable.put("white", "#FFFFFF");
|
|
||||||
colorTable.put("red", "#ff0000");
|
|
||||||
colorTable.put("orange", "#ff8800");
|
|
||||||
colorTable.put("green", "#23b03b");
|
|
||||||
colorTable.put("blue", "#2f7af5");
|
|
||||||
for (String key : colorTable.keySet()) {
|
|
||||||
if(colorName.toLowerCase().contains(key)) {
|
|
||||||
return colorTable.get(key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return "#FF0000";
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String format(int i, String hexString) {
|
private static String format(int i, String hexString) {
|
||||||
while (hexString.length() < i) {
|
while (hexString.length() < i) {
|
||||||
hexString = "0" + hexString;
|
hexString = "0" + hexString;
|
||||||
|
|
|
@ -99,10 +99,6 @@ public class GPXUtilities {
|
||||||
getExtensionsToWrite().put("color", Algorithms.colorToString(color));
|
getExtensionsToWrite().put("color", Algorithms.colorToString(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setColor(String colorName) {
|
|
||||||
getExtensionsToWrite().put("color", Algorithms.colorNameToString(colorName));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeColor() {
|
public void removeColor() {
|
||||||
getExtensionsToWrite().remove("color");
|
getExtensionsToWrite().remove("color");
|
||||||
}
|
}
|
||||||
|
@ -1523,16 +1519,6 @@ public class GPXUtilities {
|
||||||
((WptPt) parse).speed = Float.parseFloat(value);
|
((WptPt) parse).speed = Float.parseFloat(value);
|
||||||
} catch (NumberFormatException e) {}
|
} catch (NumberFormatException e) {}
|
||||||
}
|
}
|
||||||
if (tag.equals("trackextension") || tag.equals("color") || tag.equals("colour") || tag.equals("displaycolor")) {
|
|
||||||
int color;
|
|
||||||
try {
|
|
||||||
color = Integer.parseInt(value);
|
|
||||||
((GPXExtensions) parse).setColor(color);
|
|
||||||
} catch (NumberFormatException nfe) {
|
|
||||||
((GPXExtensions) parse).setColor(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else if (parse instanceof GPXExtensions && tag.equals("extensions")) {
|
} else if (parse instanceof GPXExtensions && tag.equals("extensions")) {
|
||||||
extensionReadMode = true;
|
extensionReadMode = true;
|
||||||
|
|
Loading…
Reference in a new issue