Ignore:
Timestamp:
2017-11-22T00:40:22+01:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12636

Location:
applications/editors/josm/plugins/waypoint_search
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/waypoint_search/build.xml

    r32680 r33874  
    55    <property name="commit.message" value="bugfix of search when layer is added"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="10580"/>
     7    <property name="plugin.main.version" value="12636"/>
    88
    99    <property name="plugin.author" value="Åsmund Realfsen - realfsen at gmx.net"/>
  • applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/Engine.java

    r32551 r33874  
    77import java.util.regex.Pattern;
    88
    9 import org.openstreetmap.josm.Main;
     9import org.openstreetmap.josm.gui.MainApplication;
    1010import org.openstreetmap.josm.gui.layer.markerlayer.Marker;
    1111import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer;
     
    2121        if (gpxLayersExist()) {
    2222            //Loop over marker (waypoint) layers.. it could be more than one
    23             for (Iterator<MarkerLayer> it = Main.getLayerManager().getLayersOfType(MarkerLayer.class).iterator(); it.hasNext();) {
     23            for (Iterator<MarkerLayer> it = MainApplication.getLayerManager().getLayersOfType(MarkerLayer.class).iterator(); it.hasNext();) {
    2424                //loop over each marker (waypoint)
    2525                for (Iterator<Marker> markerIterator = it.next().data.iterator(); markerIterator.hasNext();) {
     
    3535
    3636    static boolean gpxLayersExist() {
    37         return !Main.getLayerManager().getLayersOfType(MarkerLayer.class).isEmpty();
     37        return !MainApplication.getLayerManager().getLayersOfType(MarkerLayer.class).isEmpty();
    3838    }
    3939}
  • applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java

    r32644 r33874  
    2121import javax.swing.ListSelectionModel;
    2222
    23 import org.openstreetmap.josm.Main;
     23import org.openstreetmap.josm.gui.MainApplication;
    2424import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
    2525import org.openstreetmap.josm.gui.layer.markerlayer.Marker;
     
    102102            if (idx >= 0) {
    103103                Marker marker = searchResultObjectCache.get(idx);
    104                 Main.map.mapView.zoomTo(marker.getCoor());
     104                MainApplication.getMap().mapView.zoomTo(marker.getCoor());
    105105            }
    106106        }
  • applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/WaypointSearchPlugin.java

    r32551 r33874  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import org.openstreetmap.josm.Main;
     6import org.openstreetmap.josm.gui.MainApplication;
    77import org.openstreetmap.josm.gui.MapFrame;
    88import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent;
     
    1515/**
    1616 * This plugin enables a user to search for waypoint imported from a gpx file.
    17  * After the plugin is installed a new button is presented on the left side of the map window. 
     17 * After the plugin is installed a new button is presented on the left side of the map window.
    1818 * Pressing this buttons open the search dialog on the right side.
    1919 * Click on one of the search results/waypoints to move the map.
     
    2121public class WaypointSearchPlugin extends Plugin implements LayerChangeListener {
    2222    private SelectWaypointDialog waypointDialog;
    23    
     23
    2424    /**
    2525     * Will be invoked by JOSM to bootstrap the plugin
    2626     *
    27      * @param info  information about the plugin and its local installation   
     27     * @param info  information about the plugin and its local installation
    2828     */
    2929    public WaypointSearchPlugin(PluginInformation info) {
    3030        super(info);
    31         Main.getLayerManager().addLayerChangeListener(this);
     31        MainApplication.getLayerManager().addLayerChangeListener(this);
    3232    }
    33      
     33
    3434    @Override
    3535    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    3636        if (newFrame != null) {
    3737            waypointDialog = new SelectWaypointDialog(
    38                     tr("Waypoint search"), "ToolbarIcon", 
     38                    tr("Waypoint search"), "ToolbarIcon",
    3939                    tr("Search after waypoint. Click and move the map view to the waypoint."), null, 100);
    4040            newFrame.addToggleDialog(waypointDialog);
     
    4848        // Do nothing
    4949    }
    50    
     50
    5151    @Override
    5252    public void layerAdded(LayerAddEvent e) {
     
    6161        if (waypointDialog != null && !Engine.gpxLayersExist()) {
    6262            waypointDialog.updateSearchResults();
    63         }   
     63        }
    6464    }
    6565}
Note: See TracChangeset for help on using the changeset viewer.