- Timestamp:
- 2021-03-24T23:04:28+01:00 (4 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
r16865 r17659 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.awt.Color; 6 7 import java.awt.GraphicsEnvironment; 7 8 import java.io.BufferedInputStream; … … 46 47 import org.openstreetmap.josm.io.IllegalDataException; 47 48 import org.openstreetmap.josm.tools.CheckParameterUtil; 49 import org.openstreetmap.josm.tools.ColorHelper; 48 50 import org.openstreetmap.josm.tools.JosmRuntimeException; 49 51 import org.openstreetmap.josm.tools.Logging; … … 618 620 } 619 621 } 622 String colorString = el.getAttribute("color"); 623 if (colorString != null) { 624 try { 625 Color color = ColorHelper.html2color(colorString); 626 layer.setColor(color); 627 } catch (RuntimeException ex) { 628 Logging.warn("Cannot parse color " + colorString); 629 } 630 } 620 631 layer.setName(names.get(entry.getKey())); 621 632 layers.add(layer); -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r17658 r17659 44 44 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; 45 45 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; 46 import org.openstreetmap.josm.tools.ColorHelper; 46 47 import org.openstreetmap.josm.tools.JosmRuntimeException; 47 48 import org.openstreetmap.josm.tools.Logging; … … 239 240 if (!Utils.equalsEpsilon(layer.getOpacity(), 1.0)) { 240 241 el.setAttribute("opacity", Double.toString(layer.getOpacity())); 242 } 243 if (layer.getColor() != null) { 244 el.setAttribute("color", ColorHelper.color2html(layer.getColor())); 241 245 } 242 246 Set<Layer> deps = dependencies.get(layer);
Note:
See TracChangeset
for help on using the changeset viewer.