Changeset 1640 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-06-06T14:30:21+02:00 (17 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 6 edited
-
conflict/PositionConflict.java (modified) (2 diffs)
-
osm/Node.java (modified) (2 diffs)
-
osm/visitor/BoundingXYVisitor.java (modified) (1 diff)
-
osm/visitor/MapPaintVisitor.java (modified) (10 diffs)
-
osm/visitor/MergeVisitor.java (modified) (1 diff)
-
osm/visitor/SimplePaintVisitor.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/conflict/PositionConflict.java
r1636 r1640 10 10 11 11 @Override public boolean hasConflict(OsmPrimitive key, OsmPrimitive value) { 12 return key instanceof Node && !((Node)key). coor.equals(((Node)value).coor);12 return key instanceof Node && !((Node)key).getCoor().equals(((Node)value).getCoor()); 13 13 } 14 14 15 15 @Override protected String str(OsmPrimitive osm) { 16 return osm instanceof Node ? ((Node)osm). coor.lat()+", "+((Node)osm).coor.lon() : null;16 return osm instanceof Node ? ((Node)osm).getCoor().lat()+", "+((Node)osm).getCoor().lon() : null; 17 17 } 18 18 … … 23 23 @Override public void apply(OsmPrimitive target, OsmPrimitive other) { 24 24 if (target instanceof Node) { 25 ((Node)target).setEastNorth(((Node)other). eastNorth);25 ((Node)target).setEastNorth(((Node)other).getEastNorth()); 26 26 int newversion = Math.max(target.version, other.version); 27 27 // set version on "other" as well in case user decides to keep local -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r1636 r1640 20 20 public LatLon coor; 21 21 public volatile EastNorth eastNorth; 22 23 public void setCoor(LatLon coor) { 22 23 public final void setCoor(LatLon coor) { 24 24 this.coor = coor; 25 this.eastNorth = Main.proj.latlon2eastNorth(coor); 25 this.eastNorth = Main.proj.latlon2eastNorth(coor); 26 26 } 27 28 public void setEastNorth(EastNorth eastNorth) { 27 28 public final LatLon getCoor() { 29 return coor; 30 } 31 32 public final void setEastNorth(EastNorth eastNorth) { 29 33 this.eastNorth = eastNorth; 30 34 this.coor = Main.proj.eastNorth2latlon(eastNorth); 31 35 } 32 33 public void setEastNorth(double east, double north) { 36 37 public final void setEastNorth(double east, double north) { 34 38 this.setEastNorth(new EastNorth(east, north)); 35 39 } 36 40 41 public final EastNorth getEastNorth() { 42 return eastNorth; 43 } 44 37 45 private static CoordinateFormat mCord; 38 46 … … 107 115 return name; 108 116 } 117 109 118 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r1523 r1640 22 22 23 23 public void visit(Node n) { 24 visit(n. eastNorth);24 visit(n.getEastNorth()); 25 25 } 26 26 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1635 r1640 134 134 public void visit(Node n) { 135 135 /* check, if the node is visible at all */ 136 if((n. eastNorth.east() > maxEN.east() ) ||137 (n. eastNorth.north() > maxEN.north()) ||138 (n. eastNorth.east() < minEN.east() ) ||139 (n. eastNorth.north() < minEN.north()))136 if((n.getEastNorth().east() > maxEN.east() ) || 137 (n.getEastNorth().north() > maxEN.north()) || 138 (n.getEastNorth().east() < minEN.east() ) || 139 (n.getEastNorth().north() < minEN.north())) 140 140 { 141 141 n.mappaintVisibleCode = viewid; … … 180 180 for (Node n : w.nodes) 181 181 { 182 if(n. eastNorth.east() > maxx) maxx = n.eastNorth.east();183 if(n. eastNorth.north() > maxy) maxy = n.eastNorth.north();184 if(n. eastNorth.east() < minx) minx = n.eastNorth.east();185 if(n. eastNorth.north() < miny) miny = n.eastNorth.north();182 if(n.getEastNorth().east() > maxx) maxx = n.getEastNorth().east(); 183 if(n.getEastNorth().north() > maxy) maxy = n.getEastNorth().north(); 184 if(n.getEastNorth().east() < minx) minx = n.getEastNorth().east(); 185 if(n.getEastNorth().north() < miny) miny = n.getEastNorth().north(); 186 186 } 187 187 … … 650 650 } 651 651 652 Point pFrom = nc.getPoint(fromNode. eastNorth);653 Point pVia = nc.getPoint(viaNode. eastNorth);652 Point pFrom = nc.getPoint(fromNode.getEastNorth()); 653 Point pVia = nc.getPoint(viaNode.getEastNorth()); 654 654 655 655 //if(restrictionDebug) { … … 887 887 for (Node n : w.nodes) 888 888 { 889 p = nc.getPoint(n. eastNorth);889 p = nc.getPoint(n.getEastNorth()); 890 890 poly.addPoint(p.x,p.y); 891 891 } … … 941 941 for (Node n : wInner.nodes) 942 942 { 943 Point pInner = nc.getPoint(n. eastNorth);943 Point pInner = nc.getPoint(n.getEastNorth()); 944 944 polygon.addPoint(pInner.x,pInner.y); 945 945 } 946 946 if(!wInner.isClosed()) 947 947 { 948 Point pInner = nc.getPoint(wInner.nodes.get(0). eastNorth);948 Point pInner = nc.getPoint(wInner.nodes.get(0).getEastNorth()); 949 949 polygon.addPoint(pInner.x,pInner.y); 950 950 } … … 1065 1065 for (Node n : w.nodes) 1066 1066 { 1067 Point p = nc.getPoint(n. eastNorth);1067 Point p = nc.getPoint(n.getEastNorth()); 1068 1068 polygon.addPoint(p.x,p.y); 1069 1069 } … … 1088 1088 1089 1089 protected void drawNode(Node n, ImageIcon icon, boolean annotate, Boolean selected) { 1090 Point p = nc.getPoint(n. eastNorth);1090 Point p = nc.getPoint(n.getEastNorth()); 1091 1091 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return; 1092 1092 … … 1130 1130 displaySegments(col, width, dashed, dashedColor); 1131 1131 } 1132 Point p1 = nc.getPoint(n1. eastNorth);1133 Point p2 = nc.getPoint(n2. eastNorth);1132 Point p1 = nc.getPoint(n1.getEastNorth()); 1133 Point p2 = nc.getPoint(n2.getEastNorth()); 1134 1134 1135 1135 if (!isSegmentVisible(p1, p2)) { … … 1209 1209 public void drawNode(Node n, Color color, int size, int radius, boolean fill) { 1210 1210 if (isZoomOk(null) && size > 1) { 1211 Point p = nc.getPoint(n. eastNorth);1211 Point p = nc.getPoint(n.getEastNorth()); 1212 1212 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) 1213 1213 || (p.y > nc.getHeight())) … … 1456 1456 */ 1457 1457 protected void drawOrderNumber(Node n1, Node n2, int orderNumber) { 1458 Point p1 = nc.getPoint(n1. eastNorth);1459 Point p2 = nc.getPoint(n2. eastNorth);1458 Point p1 = nc.getPoint(n1.getEastNorth()); 1459 Point p2 = nc.getPoint(n2.getEastNorth()); 1460 1460 drawOrderNumber(p1, p2, orderNumber); 1461 1461 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MergeVisitor.java
r1567 r1640 163 163 164 164 private static boolean realMatch(Node n1, Node n2) { 165 return n1. coor.equalsEpsilon(n2.coor);165 return n1.getCoor().equalsEpsilon(n2.getCoor()); 166 166 } 167 167 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r1523 r1640 271 271 Iterator<Node> it = w.nodes.iterator(); 272 272 if (it.hasNext()) { 273 Point lastP = nc.getPoint(it.next(). eastNorth);273 Point lastP = nc.getPoint(it.next().getEastNorth()); 274 274 while(it.hasNext()) 275 275 { 276 Point p = nc.getPoint(it.next(). eastNorth);276 Point p = nc.getPoint(it.next().getEastNorth()); 277 277 if(isSegmentVisible(lastP, p) && isLargeSegment(lastP, p, virtualNodeSpace)) 278 278 { … … 321 321 Iterator<Node> it = w.nodes.iterator(); 322 322 if (it.hasNext()) { 323 Point lastP = nc.getPoint(it.next(). eastNorth);323 Point lastP = nc.getPoint(it.next().getEastNorth()); 324 324 for (int orderNumber = 1; it.hasNext(); orderNumber++) { 325 Point p = nc.getPoint(it.next(). eastNorth);325 Point p = nc.getPoint(it.next().getEastNorth()); 326 326 drawSegment(lastP, p, wayColor, 327 327 showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow); … … 352 352 353 353 if (m.member instanceof Node) { 354 Point p = nc.getPoint(((Node) m.member). eastNorth);354 Point p = nc.getPoint(((Node) m.member).getEastNorth()); 355 355 if (p.x < 0 || p.y < 0 356 356 || p.x > nc.getWidth() || p.y > nc.getHeight()) continue; … … 363 363 for (Node n : ((Way) m.member).nodes) { 364 364 if (n.incomplete || n.deleted) continue; 365 Point p = nc.getPoint(n. eastNorth);365 Point p = nc.getPoint(n.getEastNorth()); 366 366 if (first) { 367 367 path.moveTo(p.x, p.y); … … 410 410 public void drawNode(Node n, Color color, int size, int radius, boolean fill) { 411 411 if (size > 1) { 412 Point p = nc.getPoint(n. eastNorth);412 Point p = nc.getPoint(n.getEastNorth()); 413 413 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) 414 414 || (p.y > nc.getHeight()))
Note:
See TracChangeset
for help on using the changeset viewer.
