Changeset 71 in josm for src/org/openstreetmap/josm/actions/mapmode
- Timestamp:
- 2006-03-25T16:21:09+01:00 (20 years ago)
- Location:
- src/org/openstreetmap/josm/actions/mapmode
- Files:
-
- 6 edited
-
AddLineSegmentAction.java (modified) (1 diff)
-
AddNodeAction.java (modified) (2 diffs)
-
DeleteAction.java (modified) (1 diff)
-
MoveAction.java (modified) (2 diffs)
-
SelectionAction.java (modified) (1 diff)
-
ZoomAction.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java
r68 r71 162 162 g.setColor(Color.BLACK); 163 163 g.setXORMode(Color.WHITE); 164 Point firstDrawn = mv.get ScreenPoint(first.coor);165 Point secondDrawn = mv.get ScreenPoint(second.coor);164 Point firstDrawn = mv.getPoint(first.eastNorth); 165 Point secondDrawn = mv.getPoint(second.eastNorth); 166 166 g.drawLine(firstDrawn.x, firstDrawn.y, secondDrawn.x, secondDrawn.y); 167 167 hintDrawn = !hintDrawn; -
src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java
r68 r71 23 23 public class AddNodeAction extends MapMode { 24 24 25 /**26 * Create an AddNodeAction. Mnemonic is 'a'27 * @param mapFrame28 */29 25 public AddNodeAction(MapFrame mapFrame) { 30 26 super("Add nodes", "addnode", "Add nodes to the map.", "N", KeyEvent.VK_N, mapFrame); … … 50 46 public void mouseClicked(MouseEvent e) { 51 47 if (e.getButton() == MouseEvent.BUTTON1) { 52 Node node = new Node(mv.get Point(e.getX(), e.getY(), true));48 Node node = new Node(mv.getLatLon(e.getX(), e.getY())); 53 49 if (node.coor.isOutSideWorld()) { 54 50 JOptionPane.showMessageDialog(Main.main, "Can not add a node outside of the world."); -
src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r68 r71 94 94 * Delete the primitives and everything they references. 95 95 * 96 * If a node is deleted, the node and all line segments, wa ies and areas96 * If a node is deleted, the node and all line segments, ways and areas 97 97 * the node is part of are deleted as well. 98 98 * 99 * If a line segment is deleted, all wa ies the line segment is part of99 * If a line segment is deleted, all ways the line segment is part of 100 100 * are deleted as well. No nodes are deleted. 101 101 * -
src/org/openstreetmap/josm/actions/mapmode/MoveAction.java
r68 r71 12 12 import org.openstreetmap.josm.command.Command; 13 13 import org.openstreetmap.josm.command.MoveCommand; 14 import org.openstreetmap.josm.data. GeoPoint;14 import org.openstreetmap.josm.data.coor.EastNorth; 15 15 import org.openstreetmap.josm.data.osm.Node; 16 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 import org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor; 17 18 import org.openstreetmap.josm.gui.MapFrame; 18 19 … … 79 80 } 80 81 81 GeoPointmouseGeo = mv.getPoint(e.getX(), e.getY(), false);82 GeoPointmouseStartGeo = mv.getPoint(mousePos.x, mousePos.y, false);83 double dx = mouseGeo. x- mouseStartGeo.x;84 double dy = mouseGeo. y- mouseStartGeo.y;82 EastNorth mouseGeo = mv.getEastNorth(e.getX(), e.getY()); 83 EastNorth mouseStartGeo = mv.getEastNorth(mousePos.x, mousePos.y); 84 double dx = mouseGeo.east() - mouseStartGeo.east(); 85 double dy = mouseGeo.north() - mouseStartGeo.north(); 85 86 if (dx == 0 && dy == 0) 86 87 return; 87 88 88 89 Collection<OsmPrimitive> selection = Main.main.ds.getSelected(); 89 Collection<Node> affectedNodes = MoveCommand.getAffectedNodes(selection);90 Collection<Node> affectedNodes = AllNodesVisitor.getAllNodes(selection); 90 91 91 92 // check if any coordinate would be outside the world -
src/org/openstreetmap/josm/actions/mapmode/SelectionAction.java
r68 r71 27 27 * If Alt key was hold, select all objects that are touched by the 28 28 * selection rectangle. If the Alt key was not hold, select only those objects 29 * completly within (e.g. for wa ies mean: only if all nodes of the way are29 * completly within (e.g. for ways mean: only if all nodes of the way are 30 30 * within). 31 31 * -
src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java
r68 r71 4 4 import java.awt.event.KeyEvent; 5 5 6 import org.openstreetmap.josm.data. GeoPoint;6 import org.openstreetmap.josm.data.coor.EastNorth; 7 7 import org.openstreetmap.josm.gui.MapFrame; 8 8 import org.openstreetmap.josm.gui.MapView; … … 52 52 if (r.width >= 3 && r.height >= 3) { 53 53 double scale = mv.getScale() * r.getWidth()/mv.getWidth(); 54 GeoPointnewCenter = mv.getPoint(r.x+r.width/2, r.y+r.height/2, false);54 EastNorth newCenter = mv.getEastNorth(r.x+r.width/2, r.y+r.height/2); 55 55 mv.zoomTo(newCenter, scale); 56 56 }
Note:
See TracChangeset
for help on using the changeset viewer.
