Ignore:
Timestamp:
2006-03-25T16:21:09+01:00 (20 years ago)
Author:
imi
Message:
  • refactored GpsPoint to be immutable and added LatLon and NorthEast
  • refactored Bounding Box calculations
  • various other renames
Location:
src/org/openstreetmap/josm/actions/mapmode
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java

    r68 r71  
    162162                g.setColor(Color.BLACK);
    163163                g.setXORMode(Color.WHITE);
    164                 Point firstDrawn = mv.getScreenPoint(first.coor);
    165                 Point secondDrawn = mv.getScreenPoint(second.coor);
     164                Point firstDrawn = mv.getPoint(first.eastNorth);
     165                Point secondDrawn = mv.getPoint(second.eastNorth);
    166166                g.drawLine(firstDrawn.x, firstDrawn.y, secondDrawn.x, secondDrawn.y);
    167167                hintDrawn = !hintDrawn;
  • src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java

    r68 r71  
    2323public class AddNodeAction extends MapMode {
    2424
    25         /**
    26          * Create an AddNodeAction. Mnemonic is 'a'
    27          * @param mapFrame
    28          */
    2925        public AddNodeAction(MapFrame mapFrame) {
    3026                super("Add nodes", "addnode", "Add nodes to the map.", "N", KeyEvent.VK_N, mapFrame);
     
    5046        public void mouseClicked(MouseEvent e) {
    5147                if (e.getButton() == MouseEvent.BUTTON1) {
    52                         Node node = new Node(mv.getPoint(e.getX(), e.getY(), true));
     48                        Node node = new Node(mv.getLatLon(e.getX(), e.getY()));
    5349                        if (node.coor.isOutSideWorld()) {
    5450                                JOptionPane.showMessageDialog(Main.main, "Can not add a node outside of the world.");
  • src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java

    r68 r71  
    9494         * Delete the primitives and everything they references.
    9595         *
    96          * If a node is deleted, the node and all line segments, waies and areas
     96         * If a node is deleted, the node and all line segments, ways and areas
    9797         * the node is part of are deleted as well.
    9898         *
    99          * If a line segment is deleted, all waies the line segment is part of
     99         * If a line segment is deleted, all ways the line segment is part of
    100100         * are deleted as well. No nodes are deleted.
    101101         *
  • src/org/openstreetmap/josm/actions/mapmode/MoveAction.java

    r68 r71  
    1212import org.openstreetmap.josm.command.Command;
    1313import org.openstreetmap.josm.command.MoveCommand;
    14 import org.openstreetmap.josm.data.GeoPoint;
     14import org.openstreetmap.josm.data.coor.EastNorth;
    1515import org.openstreetmap.josm.data.osm.Node;
    1616import org.openstreetmap.josm.data.osm.OsmPrimitive;
     17import org.openstreetmap.josm.data.osm.visitor.AllNodesVisitor;
    1718import org.openstreetmap.josm.gui.MapFrame;
    1819
     
    7980                }
    8081
    81                 GeoPoint mouseGeo = mv.getPoint(e.getX(), e.getY(), false);
    82                 GeoPoint mouseStartGeo = 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();
    8586                if (dx == 0 && dy == 0)
    8687                        return;
    8788
    8889                Collection<OsmPrimitive> selection = Main.main.ds.getSelected();
    89                 Collection<Node> affectedNodes = MoveCommand.getAffectedNodes(selection);
     90                Collection<Node> affectedNodes = AllNodesVisitor.getAllNodes(selection);
    9091               
    9192                // check if any coordinate would be outside the world
  • src/org/openstreetmap/josm/actions/mapmode/SelectionAction.java

    r68 r71  
    2727 * If Alt key was hold, select all objects that are touched by the
    2828 * selection rectangle. If the Alt key was not hold, select only those objects
    29  * completly within (e.g. for waies mean: only if all nodes of the way are
     29 * completly within (e.g. for ways mean: only if all nodes of the way are
    3030 * within). 
    3131 *
  • src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java

    r68 r71  
    44import java.awt.event.KeyEvent;
    55
    6 import org.openstreetmap.josm.data.GeoPoint;
     6import org.openstreetmap.josm.data.coor.EastNorth;
    77import org.openstreetmap.josm.gui.MapFrame;
    88import org.openstreetmap.josm.gui.MapView;
     
    5252                if (r.width >= 3 && r.height >= 3) {
    5353                        double scale = mv.getScale() * r.getWidth()/mv.getWidth();
    54                         GeoPoint newCenter = 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);
    5555                        mv.zoomTo(newCenter, scale);
    5656                }
Note: See TracChangeset for help on using the changeset viewer.