- Timestamp:
- 2010-05-29T22:21:47+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r3271 r3286 147 147 nodesNo--; 148 148 } 149 if(name.length() == 0 ) 150 name = String.valueOf(way.getId()); 151 /* note: length == 0 should no longer happen, but leave the bracket code 152 nevertheless, who knows what future brings */ 149 153 String nodes = trn("{0} node", "{0} nodes", nodesNo, nodesNo); 150 154 name += (name.length() > 0) ? " ("+nodes+")" : nodes; … … 357 361 int nodesNo = way.isClosed() ? way.getNumNodes() -1 : way.getNumNodes(); 358 362 String nodes = trn("{0} node", "{0} nodes", nodesNo, nodesNo); 363 if(sb.length() == 0 ) 364 sb.append(way.getId()); 365 /* note: length == 0 should no longer happen, but leave the bracket code 366 nevertheless, who knows what future brings */ 359 367 sb.append((sb.length() > 0) ? " ("+nodes+")" : nodes); 360 368 decorateNameWithId(sb, way); -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r3262 r3286 455 455 if (history.getFirst().equals(selection)) return; 456 456 history.addFirst(selection); 457 for(int i = 1; i < history.size(); ++i) { 458 if(history.get(i).equals(selection)) { 459 history.remove(i); 460 break; 461 } 462 } 457 463 while (history.size() > SELECTION_HISTORY_SIZE) { 458 464 history.removeLast(); … … 685 691 */ 686 692 protected static class SelectionMenuItem extends JMenuItem implements ActionListener { 693 final private DefaultNameFormatter df = DefaultNameFormatter.getInstance(); 687 694 protected Collection<? extends OsmPrimitive> sel; 688 695 … … 715 722 .append(trn("{0} relation", "{0} relations", relations, relations)); 716 723 } 717 setText(tr("Selection: {0}", text)); 724 if(ways + nodes + relations == 1) 725 { 726 text.append(": "); 727 for(OsmPrimitive o : sel) 728 text.append(o.getDisplayName(df)); 729 setText(text.toString()); 730 } 731 else 732 setText(tr("Selection: {0}", text)); 718 733 addActionListener(this); 719 734 }
Note:
See TracChangeset
for help on using the changeset viewer.