Changeset 34515 in osm for applications/editors/josm/plugins/gpsblam/src
- Timestamp:
- 2018-08-18T17:56:03+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamInputData.java
r33776 r34515 9 9 import java.util.LinkedList; 10 10 11 import org.openstreetmap.josm.Main;12 11 import org.openstreetmap.josm.data.coor.CachedLatLon; 13 12 import org.openstreetmap.josm.data.gpx.GpxTrack; … … 15 14 import org.openstreetmap.josm.data.gpx.WayPoint; 16 15 import org.openstreetmap.josm.data.projection.Projection; 16 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 17 17 import org.openstreetmap.josm.gui.MainApplication; 18 18 import org.openstreetmap.josm.gui.layer.GpxLayer; … … 30 30 GPSBlamInputData(Point p1, Point p2, int radius) { 31 31 Collection<Layer> layers = MainApplication.getLayerManager().getLayers(); 32 Projection projection = Main.getProjection();32 Projection projection = ProjectionRegistry.getProjection(); 33 33 for (Layer l : layers) { 34 34 if (l.isVisible() && l instanceof GpxLayer) { 35 for (GpxTrack track : ((GpxLayer) l).data.tracks) {35 for (GpxTrack track : ((GpxLayer) l).data.tracks) { 36 36 for (GpxTrackSegment segment: track.getSegments()) { 37 37 for (WayPoint wayPoint : segment.getWayPoints()) { … … 69 69 this.add(cll, wayPoint); 70 70 } 71 } // end if circular else line based selection72 } // end loop over wayponts in segment73 } // end loop over segments in track74 } // end loop over tracks in layer75 } // end if layer visible76 } // end loop over layers77 } // end constructor71 } 72 } 73 } 74 } 75 } 76 } 77 } 78 78 79 79 private void add(CachedLatLon cll, WayPoint wayPoint) { 80 80 this.add(cll); 81 81 Calendar day = new GregorianCalendar(); 82 day.setTimeInMillis((long) wayPoint.time*1000);82 day.setTimeInMillis((long) (wayPoint.time*1000d)); 83 83 day.set(Calendar.HOUR_OF_DAY, 0); 84 84 day.set(Calendar.MINUTE, 0); -
applications/editors/josm/plugins/gpsblam/src/org/openstreetmap/josm/plugins/gpsblam/GPSBlamMarker.java
r33776 r34515 11 11 import java.awt.geom.Point2D; 12 12 13 import org.openstreetmap.josm.Main;14 13 import org.openstreetmap.josm.data.coor.CachedLatLon; 15 14 import org.openstreetmap.josm.data.coor.EastNorth; 16 15 import org.openstreetmap.josm.data.projection.Projection; 16 import org.openstreetmap.josm.data.projection.ProjectionRegistry; 17 17 import org.openstreetmap.josm.gui.MapView; 18 18 … … 23 23 private static final double FAC = 2.45; // 2.45 gives 95% CI for 2D 24 24 25 /** construct a blammarker by analysis of selected GPS points */ 25 /** 26 * Construct a blammarker by analysis of selected GPS points 27 * @param inputData input data 28 */ 26 29 GPSBlamMarker(GPSBlamInputData inputData) { 27 Projection projection = Main.getProjection();30 Projection projection = ProjectionRegistry.getProjection(); 28 31 // get mean east, north 29 32 double meanEast=0.0, meanNorth=0.0; … … 67 70 68 71 // save latlon coords of the mean and the ends of the crosshairs 69 Projection proj = Main.getProjection();72 Projection proj = ProjectionRegistry.getProjection(); 70 73 mean = new CachedLatLon(proj.eastNorth2latlon(new EastNorth(meanEast, meanNorth))); 71 74 hair1Coord1 = new CachedLatLon(proj.eastNorth2latlon( … … 88 91 89 92 void paint(Graphics2D g, MapView mv) { 90 Projection projection = Main.getProjection();93 Projection projection = ProjectionRegistry.getProjection(); 91 94 g.setColor(Color.GREEN); 92 95 g.setPaintMode();
Note:
See TracChangeset
for help on using the changeset viewer.