Changeset 8372 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2015-05-17T02:24:13+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.