Changeset 8390 in josm for trunk/src/org/openstreetmap/josm/gui/MapStatus.java
- Timestamp:
- 2015-05-18T02:14:30+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapStatus.java
r8378 r8390 572 572 */ 573 573 private JLabel popupBuildPrimitiveLabels(final OsmPrimitive osm) { 574 final StringBuilder text = new StringBuilder( );574 final StringBuilder text = new StringBuilder(32); 575 575 String name = osm.getDisplayName(DefaultNameFormatter.getInstance()); 576 576 if (osm.isNewOrUndeleted() || osm.isModified()) { … … 583 583 584 584 if (!osm.isNew() && !idShown) { 585 text.append(" [id=" +osm.getId()+"]");585 text.append(" [id=").append(osm.getId()).append(']'); 586 586 } 587 587 588 588 if(osm.getUser() != null) { 589 text.append(" [" + tr("User:") + " " + osm.getUser().getName() + "]");589 text.append(" [").append(tr("User:")).append(' ').append(osm.getUser().getName()).append(']'); 590 590 } 591 591 592 592 for (String key : osm.keySet()) { 593 text.append("<br>" + key + "=" +osm.get(key));593 text.append("<br>").append(key).append('=').append(osm.get(key)); 594 594 } 595 595 596 596 final JLabel l = new JLabel( 597 "<html>" + text.toString() + "</html>",597 "<html>" + text.toString() + "</html>", 598 598 ImageProvider.get(osm.getDisplayType()), 599 599 JLabel.HORIZONTAL … … 601 601 // This is necessary so the label updates its colors when the 602 602 // selection is changed from the outside 603 @Override public void validate() { 603 @Override 604 public void validate() { 604 605 super.validate(); 605 606 popupSetLabelColors(this, osm); … … 613 614 l.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); 614 615 l.addMouseListener(new MouseAdapter(){ 615 @Override public void mouseEntered(MouseEvent e) { 616 @Override 617 public void mouseEntered(MouseEvent e) { 616 618 l.setBackground(SystemColor.info); 617 619 l.setForeground(SystemColor.infoText); 618 620 } 619 @Override public void mouseExited(MouseEvent e) { 621 @Override 622 public void mouseExited(MouseEvent e) { 620 623 popupSetLabelColors(l, osm); 621 624 } 622 @Override public void mouseClicked(MouseEvent e) { 625 @Override 626 public void mouseClicked(MouseEvent e) { 623 627 DataSet ds = Main.main.getCurrentDataSet(); 624 628 // Let the user toggle the selection
Note:
See TracChangeset
for help on using the changeset viewer.