Changeset 9617 in josm
- Timestamp:
- 2016-01-24T19:08:31+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r9371 r9617 44 44 45 45 import javax.json.Json; 46 import javax.json.JsonArray; 47 import javax.json.JsonArrayBuilder; 46 48 import javax.json.JsonObject; 47 49 import javax.json.JsonObjectBuilder; … … 1413 1415 for (Object o: map.entrySet()) { 1414 1416 Entry e = (Entry) o; 1415 object.add(e.getKey().toString(), e.getValue().toString()); 1417 Object evalue = e.getValue(); 1418 if (evalue instanceof Collection) { 1419 JsonArrayBuilder a = Json.createArrayBuilder(); 1420 for (Object evo : (Collection)evalue) { 1421 a.add(evo.toString()); 1422 } 1423 object.add(e.getKey().toString(), a.build()); 1424 } else { 1425 object.add(e.getKey().toString(), evalue.toString()); 1426 } 1416 1427 } 1417 1428 writer.writeObject(object.build()); … … 1428 1439 for (Entry<String, JsonValue> e: object.entrySet()) { 1429 1440 JsonValue value = e.getValue(); 1430 if (value instanceof JsonString) { 1441 if (value instanceof JsonArray) { 1442 List <String> finalList = new ArrayList<String>(); 1443 for(JsonString js: ((JsonArray)value).getValuesAs(JsonString.class)) { 1444 finalList.add(js.getString()); 1445 } 1446 ret.put(e.getKey(), finalList); 1447 } else if (value instanceof JsonString) { 1431 1448 // in some cases, when JsonValue.toString() is called, then additional quotation marks are left in value 1432 1449 ret.put(e.getKey(), ((JsonString) value).getString()); … … 1497 1514 * 1498 1515 * The map value (a String) is converted to the field type. Supported 1499 * types are: boolean, Boolean, int, Integer, double, Double, String and1500 * Map<String, String> .1516 * types are: boolean, Boolean, int, Integer, double, Double, String, 1517 * Map<String, String> and Map<String, List<String>>. 1501 1518 * 1502 1519 * Only fields with annotation {@link pref} are taken into account. -
trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
r9176 r9617 80 80 handleTemplate(); 81 81 initProjection(); 82 // FIXME: remove in September 2015, when ImageryPreferenceEntry.tileSize will be initialized to -1 instead to 25683 // need to leave it as it is to keep compatibility between tested and latest JOSM versions84 tileSize = WMSLayer.PROP_IMAGE_SIZE.get();85 82 } 86 83 -
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r9603 r9617 625 625 } 626 626 627 // FIXME: remove in September 2015, when ImageryPreferenceEntry.tileSize will be initialized to -1 instead to 256628 // need to leave it as it is to keep compatiblity between tested and latest JOSM versions629 @Override630 public int getTileSize() {631 TileMatrix matrix = getTileMatrix(1);632 if (matrix == null) {633 return 1;634 }635 return matrix.tileHeight;636 }637 638 627 @Override 639 628 public String getTileUrl(int zoom, int tilex, int tiley) {
Note: See TracChangeset
for help on using the changeset viewer.