- Timestamp:
- 2015-05-17T02:24:13+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyHelper.java
r7937 r8372 57 57 } 58 58 59 candidate = Main.map.mapView.getNearestWay(p, 60 OsmPrimitive.isSelectablePredicate); 61 62 return candidate; 59 return Main.map.mapView.getNearestWay(p, OsmPrimitive.isSelectablePredicate); 63 60 } 64 61 … … 145 142 EastNorth a = wpp.a.getEastNorth(); 146 143 EastNorth b = wpp.b.getEastNorth(); 147 144 148 145 // Finding intersection of the segment with its altitude from p 149 146 EastNorth altitudeIntersection = Geometry.closestPointToSegment(a, b, pEN); 150 147 currentDistance = pEN.distance(altitudeIntersection); 151 148 152 149 if (!altitudeIntersection.equals(a) && !altitudeIntersection.equals(b)) { 153 150 // If the segment intersects with the altitude from p, -
trunk/src/org/openstreetmap/josm/gui/history/CoordinateInfoViewer.java
r8308 r8372 100 100 101 101 /** 102 * 102 * Constructs a new {@code CoordinateInfoViewer}. 103 103 * @param model the model. Must not be null. 104 104 * @throws IllegalArgumentException if model is null … … 173 173 private transient HistoryBrowserModel model; 174 174 private PointInTimeType role; 175 176 protected LatLon coord; 177 protected LatLon oppositeCoord; 175 178 176 179 protected HistoryOsmPrimitive getPrimitive() { … … 249 252 } 250 253 251 protected void refresh() {254 protected final boolean prepareRefresh() { 252 255 HistoryOsmPrimitive p = getPrimitive(); 253 256 HistoryOsmPrimitive opposite = getOppositePrimitive(); 254 if (!(p instanceof HistoryNode)) return ;255 if (!(opposite instanceof HistoryNode)) return ;257 if (!(p instanceof HistoryNode)) return false; 258 if (!(opposite instanceof HistoryNode)) return false; 256 259 HistoryNode node = (HistoryNode)p; 257 260 HistoryNode oppositeNode = (HistoryNode) opposite; 258 261 259 LatLon coord = node.getCoords(); 260 LatLon oppositeCoord = oppositeNode.getCoords(); 262 coord = node.getCoords(); 263 oppositeCoord = oppositeNode.getCoords(); 264 return true; 265 } 266 267 protected void refresh() { 268 if (!prepareRefresh()) return; 261 269 262 270 // display the coordinates … … 323 331 @Override 324 332 protected void refresh() { 325 HistoryOsmPrimitive p = getPrimitive(); 326 HistoryOsmPrimitive opposite = getOppositePrimitive(); 327 if (!(p instanceof HistoryNode)) return; 328 if (!(opposite instanceof HistoryNode)) return; 329 HistoryNode node = (HistoryNode) p; 330 HistoryNode oppositeNode = (HistoryNode) opposite; 331 332 LatLon coord = node.getCoords(); 333 LatLon oppositeCoord = oppositeNode.getCoords(); 333 if (!prepareRefresh()) return; 334 334 335 335 // update distance -
trunk/src/org/openstreetmap/josm/tools/date/PrimaryDateParser.java
r7299 r8372 183 183 184 184 private Date parseShortStandardDate(String date) { 185 int year; 186 int month; 187 int day; 188 int hour; 189 int minute; 190 int second; 191 192 year = Integer.parseInt(date.substring(0, 4)); 193 month = Integer.parseInt(date.substring(5, 7)); 194 day = Integer.parseInt(date.substring(8, 10)); 195 hour = Integer.parseInt(date.substring(11, 13)); 196 minute = Integer.parseInt(date.substring(14, 16)); 197 second = Integer.parseInt(date.substring(17, 19)); 185 int year = Integer.parseInt(date.substring(0, 4)); 186 int month = Integer.parseInt(date.substring(5, 7)); 187 int day = Integer.parseInt(date.substring(8, 10)); 188 int hour = Integer.parseInt(date.substring(11, 13)); 189 int minute = Integer.parseInt(date.substring(14, 16)); 190 int second = Integer.parseInt(date.substring(17, 19)); 198 191 199 192 calendar.clear(); … … 209 202 210 203 private Date parseLongStandardDate(String date) { 211 int year; 212 int month; 213 int day; 214 int hour; 215 int minute; 216 int second; 217 int millisecond; 218 219 year = Integer.parseInt(date.substring(0, 4)); 220 month = Integer.parseInt(date.substring(5, 7)); 221 day = Integer.parseInt(date.substring(8, 10)); 222 hour = Integer.parseInt(date.substring(11, 13)); 223 minute = Integer.parseInt(date.substring(14, 16)); 224 second = Integer.parseInt(date.substring(17, 19)); 225 millisecond = Integer.parseInt(date.substring(20, 23)); 204 int year = Integer.parseInt(date.substring(0, 4)); 205 int month = Integer.parseInt(date.substring(5, 7)); 206 int day = Integer.parseInt(date.substring(8, 10)); 207 int hour = Integer.parseInt(date.substring(11, 13)); 208 int minute = Integer.parseInt(date.substring(14, 16)); 209 int second = Integer.parseInt(date.substring(17, 19)); 210 int millisecond = Integer.parseInt(date.substring(20, 23)); 226 211 227 212 calendar.clear();
Note:
See TracChangeset
for help on using the changeset viewer.