- Timestamp:
- 2019-08-04T22:30:23+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r15121 r15280 294 294 */ 295 295 public int deletedRelations; 296 /** 297 * Incomplete nodes that have been visited 298 */ 299 public int incompleteNodes; 300 /** 301 * Incomplete ways that have been visited 302 */ 303 public int incompleteWays; 304 /** 305 * Incomplete relations that have been visited 306 */ 307 public int incompleteRelations; 296 308 297 309 @Override … … 301 313 deletedNodes++; 302 314 } 315 if (n.isIncomplete()) { 316 incompleteNodes++; 317 } 303 318 } 304 319 … … 309 324 deletedWays++; 310 325 } 326 if (w.isIncomplete()) { 327 incompleteWays++; 328 } 311 329 } 312 330 … … 316 334 if (r.isDeleted()) { 317 335 deletedRelations++; 336 } 337 if (r.isIncomplete()) { 338 incompleteRelations++; 318 339 } 319 340 } … … 650 671 } 651 672 673 private static String counterText(String text, int deleted, int incomplete) { 674 StringBuilder sb = new StringBuilder(text); 675 if (deleted > 0 || incomplete > 0) { 676 sb.append(" ("); 677 if (deleted > 0) { 678 sb.append(trn("{0} deleted", "{0} deleted", deleted, deleted)); 679 } 680 if (deleted > 0 && incomplete > 0) { 681 sb.append(", "); 682 } 683 if (incomplete > 0) { 684 sb.append(trn("{0} incomplete", "{0} incomplete", incomplete, incomplete)); 685 } 686 sb.append(')'); 687 } 688 return sb.toString(); 689 } 690 652 691 @Override 653 692 public Object getInfoComponent() { … … 658 697 final JPanel p = new JPanel(new GridBagLayout()); 659 698 660 String nodeText = trn("{0} node", "{0} nodes", counter.nodes, counter.nodes); 661 if (counter.deletedNodes > 0) { 662 nodeText += " ("+trn("{0} deleted", "{0} deleted", counter.deletedNodes, counter.deletedNodes)+')'; 663 } 664 665 String wayText = trn("{0} way", "{0} ways", counter.ways, counter.ways); 666 if (counter.deletedWays > 0) { 667 wayText += " ("+trn("{0} deleted", "{0} deleted", counter.deletedWays, counter.deletedWays)+')'; 668 } 669 670 String relationText = trn("{0} relation", "{0} relations", counter.relations, counter.relations); 671 if (counter.deletedRelations > 0) { 672 relationText += " ("+trn("{0} deleted", "{0} deleted", counter.deletedRelations, counter.deletedRelations)+')'; 673 } 699 String nodeText = counterText(trn("{0} node", "{0} nodes", counter.nodes, counter.nodes), 700 counter.deletedNodes, counter.incompleteNodes); 701 String wayText = counterText(trn("{0} way", "{0} ways", counter.ways, counter.ways), 702 counter.deletedWays, counter.incompleteWays); 703 String relationText = counterText(trn("{0} relation", "{0} relations", counter.relations, counter.relations), 704 counter.deletedRelations, counter.incompleteRelations); 674 705 675 706 p.add(new JLabel(tr("{0} consists of:", getName())), GBC.eol());
Note:
See TracChangeset
for help on using the changeset viewer.