- Timestamp:
- 2014-04-29T01:09:09+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r7005 r7020 30 30 public final Collection<WayPoint> waypoints = new LinkedList<>(); 31 31 32 @SuppressWarnings("unchecked")33 32 public void mergeFrom(GpxData other) { 34 33 if (storageFile == null && other.storageFile != null) { … … 41 40 String k = ent.getKey(); 42 41 if (k.equals(META_LINKS) && attr.containsKey(META_LINKS)) { 43 ((Collection<GpxLink>) attr.get(META_LINKS)).addAll( 44 (Collection<GpxLink>) ent.getValue()); 42 @SuppressWarnings("unchecked") 43 Collection<GpxLink> my = (Collection<GpxLink>) attr.get(META_LINKS); 44 @SuppressWarnings("unchecked") 45 Collection<GpxLink> their = (Collection<GpxLink>) ent.getValue(); 46 my.addAll(their); 45 47 } else { 46 48 attr.put(k, ent.getValue()); -
trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java
r7001 r7020 202 202 b.setArea(currentArea); 203 203 if (b.getName() != null && !b.getName().isEmpty()) { 204 ((DefaultListModel )bookmarks.getModel()).addElement(b);204 ((DefaultListModel<BookmarkList.Bookmark>)bookmarks.getModel()).addElement(b); 205 205 bookmarks.save(); 206 206 } -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r7005 r7020 619 619 }); 620 620 621 ListCellRenderer renderer = new DefaultListCellRenderer(){ 622 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 621 ListCellRenderer<ActionDefinition> renderer = new ListCellRenderer<ActionDefinition>() { 622 final DefaultListCellRenderer def = new DefaultListCellRenderer(); 623 @Override 624 public Component getListCellRendererComponent(JList<? extends ActionDefinition> list, 625 ActionDefinition value, int index, boolean isSelected, boolean cellHasFocus) { 623 626 String s; 624 627 Icon i; … … 631 634 s = tr("Separator"); 632 635 } 633 JLabel l = (JLabel) super.getListCellRendererComponent(list, s, index, isSelected, cellHasFocus);636 JLabel l = (JLabel)def.getListCellRendererComponent(list, s, index, isSelected, cellHasFocus); 634 637 l.setIcon(i); 635 638 return l; … … 654 657 selectedList.setTransferHandler(new TransferHandler() { 655 658 @Override 659 @SuppressWarnings("unchecked") 656 660 protected Transferable createTransferable(JComponent c) { 657 661 List<ActionDefinition> actions = new ArrayList<>(); … … 686 690 try { 687 691 int dropIndex = selectedList.locationToIndex(selectedList.getMousePosition(true)); 692 @SuppressWarnings("unchecked") 688 693 List<ActionDefinition> draggedData = (List<ActionDefinition>) t.getTransferData(ACTION_FLAVOR); 689 694 -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r7015 r7020 84 84 } 85 85 86 final ListCellRenderer oldRenderer = lafCombo.getRenderer(); 87 lafCombo.setRenderer(new DefaultListCellRenderer(){ 88 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 89 return oldRenderer.getListCellRendererComponent(list, ((LookAndFeelInfo)value).getName(), index, isSelected, cellHasFocus); 86 lafCombo.setRenderer(new ListCellRenderer<LookAndFeelInfo>(){ 87 final DefaultListCellRenderer def = new DefaultListCellRenderer(); 88 @Override 89 public Component getListCellRendererComponent(JList<? extends LookAndFeelInfo> list, LookAndFeelInfo value, 90 int index, boolean isSelected, boolean cellHasFocus) { 91 return def.getListCellRendererComponent(list, value.getName(), index, isSelected, cellHasFocus); 90 92 } 91 93 }); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java
r7015 r7020 53 53 model.selectLanguage(Main.pref.get("language")); 54 54 langCombo = new JosmComboBox<>(model); 55 langCombo.setRenderer(new LanguageCellRenderer( langCombo.getRenderer()));55 langCombo.setRenderer(new LanguageCellRenderer()); 56 56 57 57 LafPreference lafPreference = gui.getSetting(LafPreference.class); … … 109 109 } 110 110 111 private static class LanguageCellRenderer extends DefaultListCellRenderer{112 private ListCellRenderer dispatch;113 public LanguageCellRenderer( ListCellRenderer dispatch) {114 this.dispatch = dispatch;111 private static class LanguageCellRenderer implements ListCellRenderer<Locale> { 112 private final DefaultListCellRenderer dispatch; 113 public LanguageCellRenderer() { 114 this.dispatch = new DefaultListCellRenderer(); 115 115 } 116 116 @Override 117 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 118 boolean cellHasFocus) { 119 Locale l = (Locale) value; 117 public Component getListCellRendererComponent(JList<? extends Locale> list, Locale l, 118 int index, boolean isSelected, boolean cellHasFocus) { 120 119 return dispatch.getListCellRendererComponent(list, 121 120 l == null ? tr("Default (Auto determined)") : l.getDisplayName(l),
Note:
See TracChangeset
for help on using the changeset viewer.