Changeset 5551 in josm


Ignore:
Timestamp:
2012-11-01T21:11:11+01:00 (7 years ago)
Author:
bastiK
Message:

see #4029 - remember layer visibility/opacity

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java

    r4285 r5551  
    1414 *
    1515 * This method is described by EPSG as EPSG::9606.
     16 * Also known as Bursa-Wolf.
    1617 */
    1718public class SevenParameterDatum extends AbstractDatum {
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r5548 r5551  
    6565    private static Map<String, ProjectionChoice> projectionChoicesById = new HashMap<String, ProjectionChoice>();
    6666
    67     public static final ProjectionChoice wgs84;
    68     public static final ProjectionChoice mercator;
    69     public static final ProjectionChoice lambert;
     67    // some ProjectionChoices that are referenced from other parts of the code
     68    public static final ProjectionChoice wgs84, mercator, lambert;
     69
    7070    static {
    7171
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r5505 r5551  
    417417
    418418        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        }
    419435        for (Entry<Integer, Layer> e : layersMap.entrySet()) {
    420436            Layer l = e.getValue();
     
    422438                continue;
    423439            }
     440
    424441            l.setName(names.get(e.getKey()));
    425442            layers.add(l);
  • trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java

    r5505 r5551  
    172172            el.setAttribute("index", Integer.toString(index+1));
    173173            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            }
    174178            Set<Layer> deps = dependencies.get(layer);
    175179            if (deps.size() > 0) {
Note: See TracChangeset for help on using the changeset viewer.