Changeset 10194 in josm
- Timestamp:
- 2016-05-11T22:29:43+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r10173 r10194 135 135 136 136 protected boolean canShowAsLatest(OsmPrimitive primitive) { 137 if (primitive == null) return false; 138 if (primitive.isNew() || !primitive.isUsable()) return false; 137 if (primitive == null) 138 return false; 139 if (primitive.isNew() || !primitive.isUsable()) 140 return false; 139 141 140 142 //try creating a history primitive. if that fails, the primitive cannot be used. … … 145 147 } 146 148 147 if (history == null) return false; 149 if (history == null) 150 return false; 148 151 // only show latest of the same version if it is modified 149 152 if (history.getByVersion(primitive.getVersion()) != null) … … 394 397 */ 395 398 public boolean isLatest(HistoryOsmPrimitive primitive) { 396 if (primitive == null) return false; 399 if (primitive == null) 400 return false; 397 401 return primitive == latest; 398 402 } … … 446 450 @Override 447 451 public void setValueAt(Object aValue, int row, int column) { 448 if (!((Boolean) aValue)) return; 452 if (!((Boolean) aValue)) 453 return; 449 454 switch (column) { 450 455 case 1: … … 466 471 467 472 public void setReferencePointInTime(int row) { 468 if (history == null) return; 473 if (history == null) 474 return; 469 475 if (row == history.getNumVersions()) { 470 476 if (latest != null) { … … 473 479 return; 474 480 } 475 if (row < 0 || row > history.getNumVersions()) return; 481 if (row < 0 || row > history.getNumVersions()) 482 return; 476 483 HistoryOsmPrimitive reference = history.get(row); 477 484 HistoryBrowserModel.this.setReferencePointInTime(reference); … … 479 486 480 487 public void setCurrentPointInTime(int row) { 481 if (history == null) return; 488 if (history == null) 489 return; 482 490 if (row == history.getNumVersions()) { 483 491 if (latest != null) { … … 486 494 return; 487 495 } 488 if (row < 0 || row > history.getNumVersions()) return; 496 if (row < 0 || row > history.getNumVersions()) 497 return; 489 498 HistoryOsmPrimitive current = history.get(row); 490 499 HistoryBrowserModel.this.setCurrentPointInTime(current); … … 492 501 493 502 public boolean isReferencePointInTime(int row) { 494 if (history == null) return false; 503 if (history == null) 504 return false; 495 505 if (row == history.getNumVersions()) 496 506 return latest == reference; 497 if (row < 0 || row > history.getNumVersions()) return false; 507 if (row < 0 || row > history.getNumVersions()) 508 return false; 498 509 HistoryOsmPrimitive p = history.get(row); 499 510 return p == reference; … … 501 512 502 513 public boolean isCurrentPointInTime(int row) { 503 if (history == null) return false; 514 if (history == null) 515 return false; 504 516 if (row == history.getNumVersions()) 505 517 return latest == current; 506 if (row < 0 || row > history.getNumVersions()) return false; 518 if (row < 0 || row > history.getNumVersions()) 519 return false; 507 520 HistoryOsmPrimitive p = history.get(row); 508 521 return p == current; … … 520 533 521 534 public OsmPrimitive getLatest() { 522 if (latest == null) return null; 535 if (latest == null) 536 return null; 523 537 OsmDataLayer editLayer = Main.main.getEditLayer(); 524 if (editLayer == null) return null; 538 if (editLayer == null) 539 return null; 525 540 return editLayer.data.getPrimitiveById(latest.getId(), latest.getType()); 526 541 } … … 541 556 private List<String> keys; 542 557 private final PointInTimeType pointInTimeType; 558 559 protected TagTableModel(PointInTimeType type) { 560 pointInTimeType = type; 561 initKeyList(); 562 } 543 563 544 564 protected void initKeyList() { … … 555 575 } 556 576 557 protected TagTableModel(PointInTimeType type) {558 pointInTimeType = type;559 initKeyList();560 }561 562 577 @Override 563 578 public int getRowCount() { 564 if (keys == null) return 0; 579 if (keys == null) 580 return 0; 565 581 return keys.size(); 566 582 } -
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r9509 r10194 237 237 public final int limit; 238 238 239 /** 240 * Constructs a {@code MoreNotesException}. 241 * @param notes downloaded notes 242 * @param limit download limit sent to the server 243 */ 239 244 public MoreNotesException(List<Note> notes, int limit) { 240 245 this.notes = notes; … … 242 247 } 243 248 } 244 245 249 } -
trunk/src/org/openstreetmap/josm/io/CachedFile.java
r10181 r10194 176 176 } 177 177 178 /** 179 * Returns maximum age of cache file. Only applies to URLs. 180 * When this time has passed after the last download of the file, the 181 * cache is considered stale and a new download will be attempted. 182 * @return the maximum cache age in seconds 183 */ 178 184 public long getMaxAge() { 179 185 return maxAge; -
trunk/src/org/openstreetmap/josm/io/ChangesetQuery.java
r10006 r10194 28 28 * Maximum number of changesets returned by the OSM API call "/changesets?" 29 29 */ 30 public static int MAX_CHANGESETS_NUMBER = 100; 31 32 /** 33 * Replies a changeset query object from the query part of a OSM API URL for querying changesets. 34 * 35 * @param query the query part 36 * @return the query object 37 * @throws ChangesetQueryUrlException if query doesn't consist of valid query parameters 38 */ 39 public static ChangesetQuery buildFromUrlQuery(String query) throws ChangesetQueryUrlException { 40 return new ChangesetQueryUrlParser().parse(query); 41 } 30 public static final int MAX_CHANGESETS_NUMBER = 100; 42 31 43 32 /** the user id this query is restricted to. null, if no restriction to a user id applies */ … … 56 45 /** a collection of changeset ids to query for */ 57 46 private Collection<Long> changesetIds; 47 48 /** 49 * Replies a changeset query object from the query part of a OSM API URL for querying changesets. 50 * 51 * @param query the query part 52 * @return the query object 53 * @throws ChangesetQueryUrlException if query doesn't consist of valid query parameters 54 */ 55 public static ChangesetQuery buildFromUrlQuery(String query) throws ChangesetQueryUrlException { 56 return new ChangesetQueryUrlParser().parse(query); 57 } 58 58 59 59 /** … … 305 305 } 306 306 307 /** 308 * Exception thrown for invalid changeset queries. 309 */ 307 310 public static class ChangesetQueryUrlException extends Exception { 308 311 … … 339 342 } 340 343 344 /** 345 * Changeset query URL parser. 346 */ 341 347 public static class ChangesetQueryUrlParser { 342 348 protected int parseUid(String value) throws ChangesetQueryUrlException { … … 486 492 * </pre> 487 493 * 488 * @param query the query string. If null, an empty query (identical to a query for all changesets) is 489 * assumed 494 * @param query the query string. If null, an empty query (identical to a query for all changesets) is assumed 490 495 * @return the changeset query 491 496 * @throws ChangesetQueryUrlException if the query string doesn't represent a legal query for changesets … … 494 499 if (query == null) 495 500 return new ChangesetQuery(); 496 query = query.trim();497 if ( query.isEmpty())501 String apiQuery = query.trim(); 502 if (apiQuery.isEmpty()) 498 503 return new ChangesetQuery(); 499 Map<String, String> queryParams = createMapFromQueryString(query); 500 return createFromMap(queryParams); 504 return createFromMap(createMapFromQueryString(apiQuery)); 501 505 } 502 506 }
Note:
See TracChangeset
for help on using the changeset viewer.