Ignore:
Timestamp:
2012-08-20T01:11:45+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #2961 - Improve usability of WMS Layer Saving/Loading

  • Replaced the unconventional method of creating a blank layer, then loading a .wms file to a standard File->Open approach
  • Fixed memory leaks with some actions registered as listeners but never destroyed
  • Layer interface modified to allow a generic approach of layer saving in SaveActionBase rather than the previous one restricted to OSM and GPX data
  • FileImporters and FileExporters can now be enabled/disabled at runtime, for example when the active layer changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java

    r5390 r5459  
    2424import org.openstreetmap.josm.gui.layer.ImageryLayer;
    2525import org.openstreetmap.josm.gui.layer.Layer;
    26 import org.openstreetmap.josm.gui.layer.WMSLayer;
    2726import org.openstreetmap.josm.tools.ImageProvider;
    2827
     
    6968    JMenuItem offsetMenuItem = singleOffset;
    7069    Map_Rectifier_WMSmenuAction rectaction = new Map_Rectifier_WMSmenuAction();
    71     JosmAction blankmenu = new JosmAction(
    72             tr("Blank Layer"), /* ICON */"blankmenu", tr("Open a blank WMS layer to load data from a file"), null, false) {
    73         @Override
    74         public void actionPerformed(ActionEvent ev) {
    75             if (!isEnabled()) return;
    76             Main.main.addLayer(new WMSLayer());
    77         }
    78 
    79         @Override
    80         protected void updateEnabledState() {
    81             setEnabled(Main.map != null && Main.map.mapView != null && !Main.map.mapView.getAllLayers().isEmpty());
    82         }
    83     };
    8470    int offsPos;
    8571
     
    10288        offsPos = getMenuComponentCount();
    10389        add(offsetMenuItem);
    104         addSeparator();
    105         add(new JMenuItem(blankmenu));
    10690    }
    10791
Note: See TracChangeset for help on using the changeset viewer.