Changeset 13199 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-12-12T01:11:39+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r13120 r13199 340 340 String name = getChildContent(element, "Title", null, null); 341 341 String ident = getChildContent(element, "Name", null, null); 342 String abstr = getChildContent(element, "Abstract", null, null); 342 343 343 344 // The set of supported CRS/SRS for this layer … … 385 386 List<LayerDetails> childLayers = parseLayers(layerChildren, crsList); 386 387 387 return new LayerDetails(name, ident, crsList, josmSupportsThisLayer, bounds, childLayers);388 return new LayerDetails(name, ident, abstr, crsList, josmSupportsThisLayer, bounds, childLayers); 388 389 } 389 390 … … 448 449 449 450 /** 450 * The details of a layer of this wmsserver.451 * The details of a layer of this WMS server. 451 452 */ 452 453 public static class LayerDetails { 453 454 454 455 /** 455 * The layer name 456 * The layer name (WMS {@code Title}) 456 457 */ 457 458 public final String name; 459 /** 460 * The layer ident (WMS {@code Name}) 461 */ 458 462 public final String ident; 459 463 /** 464 * The layer abstract (WMS {@code Abstract}) 465 * @since xxx 466 */ 467 public final String abstr; 468 /** 460 469 * The child layers of this layer 461 470 */ … … 465 474 */ 466 475 public final Bounds bounds; 476 /** 477 * the CRS/SRS pulled out of this layer's XML element 478 */ 467 479 public final Set<String> crsList; 480 /** 481 * {@code true} if any of the specified projections are supported by JOSM 482 */ 468 483 public final boolean supported; 469 484 470 public LayerDetails(String name, String ident, Set<String> crsList, boolean supportedLayer, Bounds bounds, 485 /** 486 * Constructs a new {@code LayerDetails}. 487 * @param name The layer name (WMS {@code Title}) 488 * @param ident The layer ident (WMS {@code Name}) 489 * @param abstr The layer abstract (WMS {@code Abstract}) 490 * @param crsList The CRS/SRS pulled out of this layer's XML element 491 * @param supportedLayer {@code true} if any of the specified projections are supported by JOSM 492 * @param bounds The bounds this layer can be used for 493 * @param childLayers The child layers of this layer 494 * @since xxx 495 */ 496 public LayerDetails(String name, String ident, String abstr, Set<String> crsList, boolean supportedLayer, Bounds bounds, 471 497 List<LayerDetails> childLayers) { 472 498 this.name = name; 473 499 this.ident = ident; 500 this.abstr = abstr; 474 501 this.supported = supportedLayer; 475 502 this.children = childLayers; … … 478 505 } 479 506 507 /** 508 * Determines if any of the specified projections are supported by JOSM. 509 * @return {@code true} if any of the specified projections are supported by JOSM 510 */ 480 511 public boolean isSupported() { 481 512 return this.supported; 482 513 } 483 514 515 /** 516 * Returns the CRS/SRS pulled out of this layer's XML element. 517 * @return the CRS/SRS pulled out of this layer's XML element 518 */ 484 519 public Set<String> getProjections() { 485 520 return crsList; … … 488 523 @Override 489 524 public String toString() { 490 if (this.name == null || this.name.isEmpty()) 491 return this.ident; 492 else 493 return this.name; 525 String baseName = (name == null || name.isEmpty()) ? ident : name; 526 return abstr == null || abstr.equalsIgnoreCase(baseName) ? baseName : baseName + " (" + abstr + ')'; 494 527 } 495 528 }
Note:
See TracChangeset
for help on using the changeset viewer.