Changeset 5551 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2012-11-01T21:11:11+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/session
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r5505 r5551 417 417 418 418 layers = new ArrayList<Layer>(); 419 for (int idx : layersMap.keySet()) { 420 Layer layer = layersMap.get(idx); 421 if (layer == null) { 422 continue; 423 } 424 Element el = elems.get(idx); 425 if (el.hasAttribute("visible")) { 426 layer.setVisible(Boolean.parseBoolean(el.getAttribute("visible"))); 427 } 428 if (el.hasAttribute("opacity")) { 429 try { 430 double opacity = Double.parseDouble(el.getAttribute("opacity")); 431 layer.setOpacity(opacity); 432 } catch (NumberFormatException ex) {} 433 } 434 } 419 435 for (Entry<Integer, Layer> e : layersMap.entrySet()) { 420 436 Layer l = e.getValue(); … … 422 438 continue; 423 439 } 440 424 441 l.setName(names.get(e.getKey())); 425 442 layers.add(l); -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r5505 r5551 172 172 el.setAttribute("index", Integer.toString(index+1)); 173 173 el.setAttribute("name", layer.getName()); 174 el.setAttribute("visible", Boolean.toString(layer.isVisible())); 175 if (layer.getOpacity() != 1.0) { 176 el.setAttribute("opacity", Double.toString(layer.getOpacity())); 177 } 174 178 Set<Layer> deps = dependencies.get(layer); 175 179 if (deps.size() > 0) {
Note:
See TracChangeset
for help on using the changeset viewer.