Changeset 6672 in josm
- Timestamp:
- 2014-01-11T21:01:59+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java
r6380 r6672 21 21 import org.openstreetmap.josm.command.SequenceCommand; 22 22 import org.openstreetmap.josm.data.coor.EastNorth; 23 import org.openstreetmap.josm.data.coor.LatLon; 23 24 import org.openstreetmap.josm.data.osm.Node; 24 25 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 203 204 204 205 if (sUnder == 0) { 205 new Notification( 206 tr("Those nodes are not in a circle. Aborting.")) 207 .setIcon(JOptionPane.WARNING_MESSAGE) 208 .show(); 206 notifyNodesNotOnCircle(); 209 207 return; 210 208 } … … 246 244 double x = xc + r*Math.cos(a); 247 245 double y = yc + r*Math.sin(a); 248 Node n = new Node(Main.getProjection().eastNorth2latlon(new EastNorth(x,y))); 246 LatLon ll = Main.getProjection().eastNorth2latlon(new EastNorth(x,y)); 247 if (ll.isOutSideWorld()) { 248 notifyNodesNotOnCircle(); 249 return; 250 } 251 Node n = new Node(ll); 249 252 wayToAdd.add(n); 250 253 cmds.add(new AddCommand(n)); … … 273 276 Main.map.repaint(); 274 277 } 278 279 private static void notifyNodesNotOnCircle() { 280 new Notification( 281 tr("Those nodes are not in a circle. Aborting.")) 282 .setIcon(JOptionPane.WARNING_MESSAGE) 283 .show(); 284 } 275 285 276 286 @Override
Note:
See TracChangeset
for help on using the changeset viewer.