Changeset 5410 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2012-08-09T00:50:12+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r5349 r5410 121 121 122 122 /** 123 * Create a new local node. 124 * 123 * Constructs a new local {@code Node} with id 0. 125 124 */ 126 125 public Node() { … … 129 128 130 129 /** 131 * Create an incomplete Node object 132 */ 133 public Node(long id) { 130 * Constructs an incomplete {@code Node} object with the given id. 131 * @param id The id. Must be >= 0 132 * @throws IllegalArgumentException if id < 0 133 */ 134 public Node(long id) throws IllegalArgumentException { 134 135 super(id, false); 135 136 } 136 137 137 138 /** 138 * Create new node 139 * @param id 140 * @param version 141 */ 142 public Node(long id, int version) { 139 * Constructs a new {@code Node} with the given id and version. 140 * @param id The id. Must be >= 0 141 * @param version The version 142 * @throws IllegalArgumentException if id < 0 143 */ 144 public Node(long id, int version) throws IllegalArgumentException { 143 145 super(id, version, false); 144 146 } 145 147 146 148 /** 147 * 148 * @param clone 149 * Constructs an identical clone of the argument. 150 * @param clone The node to clone 149 151 * @param clearId If true, set version to 0 and id to new unique value 150 152 */ … … 158 160 159 161 /** 160 * Create an identical clone of the argument (including the id) 162 * Constructs an identical clone of the argument (including the id). 163 * @param clone The node to clone, including its id 161 164 */ 162 165 public Node(Node clone) { … … 164 167 } 165 168 169 /** 170 * Constructs a new {@code Node} with the given lat/lon with id 0. 171 * @param latlon The {@link LatLon} coordinates 172 */ 166 173 public Node(LatLon latlon) { 167 174 super(0, false); … … 169 176 } 170 177 178 /** 179 * Constructs a new {@code Node} with the given east/north with id 0. 180 * @param eastNorth The {@link EastNorth} coordinates 181 */ 171 182 public Node(EastNorth eastNorth) { 172 183 super(0, false); … … 181 192 } 182 193 183 @Override public void visit(Visitor visitor) { 194 @Override 195 public void visit(Visitor visitor) { 184 196 visitor.visit(this); 185 197 } 186 198 187 @Override public void visit(PrimitiveVisitor visitor) { 199 @Override 200 public void visit(PrimitiveVisitor visitor) { 188 201 visitor.visit(this); 189 202 } 190 203 191 @Override public void cloneFrom(OsmPrimitive osm) { 204 @Override 205 public void cloneFrom(OsmPrimitive osm) { 192 206 boolean locked = writeLock(); 193 207 try { … … 242 256 } 243 257 244 @Override public String toString() { 258 @Override 259 public String toString() { 245 260 String coorDesc = isLatLonKnown() ? "lat="+lat+",lon="+lon : ""; 246 261 return "{Node id=" + getUniqueId() + " version=" + getVersion() + " " + getFlagsAsString() + " " + coorDesc+"}"; … … 287 302 public void updatePosition() { 288 303 } 304 305 @Override 306 public boolean isDrawable() { 307 // Not possible to draw a node without coordinates. 308 return super.isDrawable() && isLatLonKnown(); 309 } 289 310 290 311 /** … … 298 319 } 299 320 321 /** 322 * Get debug info for bug #3892. 323 * @return debug info for bug #3892. 324 * @deprecated This method will be remove by the end of 2012 if no report appears. 325 */ 300 326 public String get3892DebugInfo() { 301 327 StringBuilder builder = new StringBuilder(); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
r5403 r5410 843 843 { 844 844 Point2D p = n.getEastNorth(); 845 if (initial) { 846 path.moveTo(p.getX(), p.getY()); 847 initial = false; 848 } else { 849 path.lineTo(p.getX(), p.getY()); 845 if (p != null) { 846 if (initial) { 847 path.moveTo(p.getX(), p.getY()); 848 initial = false; 849 } else { 850 path.lineTo(p.getX(), p.getY()); 851 } 850 852 } 851 853 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/Multipolygon.java
r5176 r5410 214 214 for (Node n : nodes) { 215 215 Point2D p = n.getEastNorth(); 216 if (initial) { 217 poly.moveTo(p.getX(), p.getY()); 218 initial = false; 219 } else { 220 poly.lineTo(p.getX(), p.getY()); 216 if (p != null) { 217 if (initial) { 218 poly.moveTo(p.getX(), p.getY()); 219 initial = false; 220 } else { 221 poly.lineTo(p.getX(), p.getY()); 222 } 221 223 } 222 224 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r5344 r5410 879 879 EastNorth en2 = w.getNode(1).getEastNorth(); 880 880 EastNorth en3 = w.getNode(2).getEastNorth(); 881 en1 = en1.sub(en2); 882 en2 = en2.sub(en3); 883 return en1.north() * en2.east() - en2.north() * en1.east() > 0 ? ROUNDABOUT_LEFT : ROUNDABOUT_RIGHT; 884 } else 885 return NONE; 881 if (en1 != null && en2 != null && en3 != null) { 882 en1 = en1.sub(en2); 883 en2 = en2.sub(en3); 884 return en1.north() * en2.east() - en2.north() * en1.east() > 0 ? ROUNDABOUT_LEFT : ROUNDABOUT_RIGHT; 885 } 886 } 887 return NONE; 886 888 } 887 889
Note:
See TracChangeset
for help on using the changeset viewer.