Changeset 33874 in osm for applications
- Timestamp:
- 2017-11-22T00:40:22+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/waypoint_search
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/waypoint_search/build.xml
r32680 r33874 5 5 <property name="commit.message" value="bugfix of search when layer is added"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 0580"/>7 <property name="plugin.main.version" value="12636"/> 8 8 9 9 <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 7 7 import java.util.regex.Pattern; 8 8 9 import org.openstreetmap.josm. Main;9 import org.openstreetmap.josm.gui.MainApplication; 10 10 import org.openstreetmap.josm.gui.layer.markerlayer.Marker; 11 11 import org.openstreetmap.josm.gui.layer.markerlayer.MarkerLayer; … … 21 21 if (gpxLayersExist()) { 22 22 //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();) { 24 24 //loop over each marker (waypoint) 25 25 for (Iterator<Marker> markerIterator = it.next().data.iterator(); markerIterator.hasNext();) { … … 35 35 36 36 static boolean gpxLayersExist() { 37 return !Main .getLayerManager().getLayersOfType(MarkerLayer.class).isEmpty();37 return !MainApplication.getLayerManager().getLayersOfType(MarkerLayer.class).isEmpty(); 38 38 } 39 39 } -
applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java
r32644 r33874 21 21 import javax.swing.ListSelectionModel; 22 22 23 import org.openstreetmap.josm. Main;23 import org.openstreetmap.josm.gui.MainApplication; 24 24 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 25 25 import org.openstreetmap.josm.gui.layer.markerlayer.Marker; … … 102 102 if (idx >= 0) { 103 103 Marker marker = searchResultObjectCache.get(idx); 104 Main .map.mapView.zoomTo(marker.getCoor());104 MainApplication.getMap().mapView.zoomTo(marker.getCoor()); 105 105 } 106 106 } -
applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/WaypointSearchPlugin.java
r32551 r33874 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import org.openstreetmap.josm. Main;6 import org.openstreetmap.josm.gui.MainApplication; 7 7 import org.openstreetmap.josm.gui.MapFrame; 8 8 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; … … 15 15 /** 16 16 * 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. 18 18 * Pressing this buttons open the search dialog on the right side. 19 19 * Click on one of the search results/waypoints to move the map. … … 21 21 public class WaypointSearchPlugin extends Plugin implements LayerChangeListener { 22 22 private SelectWaypointDialog waypointDialog; 23 23 24 24 /** 25 25 * Will be invoked by JOSM to bootstrap the plugin 26 26 * 27 * @param info information about the plugin and its local installation 27 * @param info information about the plugin and its local installation 28 28 */ 29 29 public WaypointSearchPlugin(PluginInformation info) { 30 30 super(info); 31 Main .getLayerManager().addLayerChangeListener(this);31 MainApplication.getLayerManager().addLayerChangeListener(this); 32 32 } 33 33 34 34 @Override 35 35 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 36 36 if (newFrame != null) { 37 37 waypointDialog = new SelectWaypointDialog( 38 tr("Waypoint search"), "ToolbarIcon", 38 tr("Waypoint search"), "ToolbarIcon", 39 39 tr("Search after waypoint. Click and move the map view to the waypoint."), null, 100); 40 40 newFrame.addToggleDialog(waypointDialog); … … 48 48 // Do nothing 49 49 } 50 50 51 51 @Override 52 52 public void layerAdded(LayerAddEvent e) { … … 61 61 if (waypointDialog != null && !Engine.gpxLayersExist()) { 62 62 waypointDialog.updateSearchResults(); 63 } 63 } 64 64 } 65 65 }
Note:
See TracChangeset
for help on using the changeset viewer.