- Timestamp:
- 2017-09-08T01:04:05+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java
r12726 r12778 19 19 import java.util.TreeSet; 20 20 21 import org.openstreetmap.josm.Main; 21 22 import org.openstreetmap.josm.command.ChangeCommand; 22 23 import org.openstreetmap.josm.command.Command; … … 29 30 import org.openstreetmap.josm.data.osm.Way; 30 31 import org.openstreetmap.josm.data.osm.WaySegment; 31 import org.openstreetmap.josm.data.projection.Projections;32 32 import org.openstreetmap.josm.gui.MainApplication; 33 33 import org.openstreetmap.josm.gui.MapView; … … 138 138 if (joinWayToNode) { 139 139 for (Node node : nodesInSegment) { 140 EastNorth newPosition = Geometry.closestPointToSegment(w.getNode(segmentIndex).getEastNorth(), 141 w.getNode(segmentIndex+1).getEastNorth(), 142 node.getEastNorth()); 143 MoveCommand c = new MoveCommand(node, Projections.inverseProject(newPosition)); 140 EastNorth newPosition = Geometry.closestPointToSegment( 141 w.getNode(segmentIndex).getEastNorth(), 142 w.getNode(segmentIndex+1).getEastNorth(), 143 node.getEastNorth()); 144 MoveCommand c = new MoveCommand( 145 node, Main.getProjection().eastNorth2latlon(newPosition)); 144 146 // Avoid moving a given node several times at the same position in case of overlapping ways 145 147 if (!cmds.contains(c)) { -
trunk/src/org/openstreetmap/josm/command/MoveCommand.java
r12759 r12778 14 14 import javax.swing.Icon; 15 15 16 import org.openstreetmap.josm.Main; 16 17 import org.openstreetmap.josm.data.coor.EastNorth; 17 18 import org.openstreetmap.josm.data.coor.LatLon; … … 20 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 21 22 import org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor; 22 import org.openstreetmap.josm.data.projection.Projections;23 23 import org.openstreetmap.josm.tools.ImageProvider; 24 24 … … 72 72 */ 73 73 public MoveCommand(Node node, LatLon position) { 74 this(Collections.singleton((OsmPrimitive) node), Projections.project(position).subtract(node.getEastNorth())); 74 this(Collections.singleton((OsmPrimitive) node), 75 Main.getProjection().latlon2eastNorth(position).subtract(node.getEastNorth())); 75 76 } 76 77 -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r12753 r12778 16 16 import org.openstreetmap.josm.data.osm.visitor.Visitor; 17 17 import org.openstreetmap.josm.data.projection.Projecting; 18 import org.openstreetmap.josm.data.projection.Projections;19 18 import org.openstreetmap.josm.tools.CheckParameterUtil; 20 19 import org.openstreetmap.josm.tools.Utils; … … 142 141 invalidateEastNorthCache(); 143 142 } else if (eastNorth != null) { 144 LatLon ll = Projections.inverseProject(eastNorth);143 LatLon ll = Main.getProjection().eastNorth2latlon(eastNorth); 145 144 this.lat = ll.lat(); 146 145 this.lon = ll.lon(); -
trunk/src/org/openstreetmap/josm/data/osm/NodeData.java
r12738 r12778 2 2 package org.openstreetmap.josm.data.osm; 3 3 4 import org.openstreetmap.josm.Main; 4 5 import org.openstreetmap.josm.data.coor.EastNorth; 5 6 import org.openstreetmap.josm.data.coor.LatLon; 6 7 import org.openstreetmap.josm.data.osm.visitor.PrimitiveVisitor; 7 import org.openstreetmap.josm.data.projection.Projections;8 8 9 9 /** … … 83 83 // No internal caching of projected coordinates needed. In contrast to getEastNorth() 84 84 // on Node, this method is rarely used. Caching would be overkill. 85 return Projections.project(getCoor());85 return Main.getProjection().latlon2eastNorth(getCoor()); 86 86 } 87 87 88 88 @Override 89 89 public void setEastNorth(EastNorth eastNorth) { 90 setCoor( Projections.inverseProject(eastNorth));90 setCoor(Main.getProjection().eastNorth2latlon(eastNorth)); 91 91 } 92 92 -
trunk/src/org/openstreetmap/josm/data/projection/Projections.java
r12725 r12778 194 194 * @return the corresponding east/north coordinates 195 195 * @since 12725 196 */ 196 * @deprecated use <code>Main.getProjection().latlon2eastNorth(ll)</code> 197 */ 198 @Deprecated 197 199 public static EastNorth project(ILatLon ll) { 198 200 if (ll == null) return null; … … 205 207 * @param ll the geographical point to convert (in WGS84 lat/lon) 206 208 * @return the corresponding east/north coordinates 207 */ 209 * @deprecated use <code>Main.getProjection().latlon2eastNorth(ll)</code> 210 */ 211 @Deprecated 208 212 public static EastNorth project(LatLon ll) { 209 213 return project((ILatLon) ll); … … 215 219 * @param en the geographical point to convert (in projected coordinates) 216 220 * @return the corresponding lat/lon (WGS84) 217 */ 221 * @deprecated use <code>Main.getProjection().eastNorth2latlon(en)</code> 222 */ 223 @Deprecated 218 224 public static LatLon inverseProject(EastNorth en) { 219 225 if (en == null) return null; -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r12725 r12778 53 53 import org.openstreetmap.josm.data.projection.Projection; 54 54 import org.openstreetmap.josm.data.projection.ProjectionChangeListener; 55 import org.openstreetmap.josm.data.projection.Projections;56 55 import org.openstreetmap.josm.gui.help.Helpful; 57 56 import org.openstreetmap.josm.gui.layer.NativeScaleLayer; … … 715 714 */ 716 715 public void zoomTo(ILatLon newCenter) { 717 zoomTo( Projections.project(newCenter));716 zoomTo(getProjection().latlon2eastNorth(newCenter)); 718 717 } 719 718 -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r12630 r12778 31 31 import org.openstreetmap.josm.data.coor.EastNorth; 32 32 import org.openstreetmap.josm.data.coor.LatLon; 33 import org.openstreetmap.josm.data.projection.Projections;34 33 import org.openstreetmap.josm.gui.MainApplication; 35 34 import org.openstreetmap.josm.gui.MapView; … … 266 265 MapView mapView = MainApplication.getMap().mapView; 267 266 EastNorth center = mapView.getCenter(); 268 LatLon centerLL = Projections.inverseProject(center);267 LatLon centerLL = Main.getProjection().eastNorth2latlon(center); 269 268 centerEl.setAttribute("lat", Double.toString(centerLL.lat())); 270 269 centerEl.setAttribute("lon", Double.toString(centerLL.lon()));
Note:
See TracChangeset
for help on using the changeset viewer.