Changeset 4143 in josm


Ignore:
Timestamp:
2011-06-19T00:18:54+02:00 (10 years ago)
Author:
stoecker
Message:

fix #6463 - fix NPE, remove some of the new toolbar warnings for image menu

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

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

    r3737 r4143  
    6868    JMenuItem singleOffset = new JMenuItem(offsetAction);
    6969    JMenuItem offsetMenuItem = singleOffset;
     70    Map_Rectifier_WMSmenuAction rectaction = new Map_Rectifier_WMSmenuAction();
     71    JosmAction blankmenu = new JosmAction(
     72            tr("Blank Layer"), "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    };
    7084    int offsPos;
    7185
     
    8397        }
    8498        addSeparator();
    85         add(new JMenuItem(new Map_Rectifier_WMSmenuAction()));
     99        add(new JMenuItem(rectaction));
    86100
    87101        addSeparator();
     
    89103        add(offsetMenuItem);
    90104        addSeparator();
    91         add(new JMenuItem(new JosmAction(
    92                 tr("Blank Layer"), "blankmenu", tr("Open a blank WMS layer to load data from a file"), null, false) {
    93             @Override
    94             public void actionPerformed(ActionEvent ev) {
    95                 if (!isEnabled()) return;
    96                 Main.main.addLayer(new WMSLayer());
    97             }
    98 
    99             @Override
    100             protected void updateEnabledState() {
    101                 setEnabled(Main.map != null && Main.map.mapView != null && !Main.map.mapView.getAllLayers().isEmpty());
    102             }
    103         }));
     105        add(new JMenuItem(blankmenu));
    104106    }
    105107
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r4129 r4143  
    462462
    463463        LinkedList<WayPoint> visibleSegments = new LinkedList<WayPoint>();
     464        WayPoint last = null;
    464465        for (GpxTrack trk: data.tracks) {
    465466            for (GpxTrackSegment trkSeg: trk.getSegments()) {
    466                 WayPoint last = null;
    467467                for(WayPoint pt : trkSeg.getWayPoints())
    468468                {
Note: See TracChangeset for help on using the changeset viewer.