Changeset 7020 in josm for trunk


Ignore:
Timestamp:
2014-04-29T01:09:09+02:00 (6 years ago)
Author:
Don-vip
Message:

see #8465 - fix remaining compilation warnings

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java

    r7005 r7020  
    3030    public final Collection<WayPoint> waypoints = new LinkedList<>();
    3131
    32     @SuppressWarnings("unchecked")
    3332    public void mergeFrom(GpxData other) {
    3433        if (storageFile == null && other.storageFile != null) {
     
    4140            String k = ent.getKey();
    4241            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);
    4547            } else {
    4648                attr.put(k, ent.getValue());
  • trunk/src/org/openstreetmap/josm/gui/download/BookmarkSelection.java

    r7001 r7020  
    202202            b.setArea(currentArea);
    203203            if (b.getName() != null && !b.getName().isEmpty()) {
    204                 ((DefaultListModel)bookmarks.getModel()).addElement(b);
     204                ((DefaultListModel<BookmarkList.Bookmark>)bookmarks.getModel()).addElement(b);
    205205                bookmarks.save();
    206206            }
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r7005 r7020  
    619619            });
    620620
    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) {
    623626                    String s;
    624627                    Icon i;
     
    631634                        s = tr("Separator");
    632635                    }
    633                     JLabel l = (JLabel)super.getListCellRendererComponent(list, s, index, isSelected, cellHasFocus);
     636                    JLabel l = (JLabel)def.getListCellRendererComponent(list, s, index, isSelected, cellHasFocus);
    634637                    l.setIcon(i);
    635638                    return l;
     
    654657            selectedList.setTransferHandler(new TransferHandler() {
    655658                @Override
     659                @SuppressWarnings("unchecked")
    656660                protected Transferable createTransferable(JComponent c) {
    657661                    List<ActionDefinition> actions = new ArrayList<>();
     
    686690                    try {
    687691                        int dropIndex = selectedList.locationToIndex(selectedList.getMousePosition(true));
     692                        @SuppressWarnings("unchecked")
    688693                        List<ActionDefinition> draggedData = (List<ActionDefinition>) t.getTransferData(ACTION_FLAVOR);
    689694
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r7015 r7020  
    8484        }
    8585
    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);
    9092            }
    9193        });
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java

    r7015 r7020  
    5353        model.selectLanguage(Main.pref.get("language"));
    5454        langCombo = new JosmComboBox<>(model);
    55         langCombo.setRenderer(new LanguageCellRenderer(langCombo.getRenderer()));
     55        langCombo.setRenderer(new LanguageCellRenderer());
    5656
    5757        LafPreference lafPreference = gui.getSetting(LafPreference.class);
     
    109109    }
    110110
    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();
    115115        }
    116116        @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) {
    120119            return dispatch.getListCellRendererComponent(list,
    121120                    l == null ? tr("Default (Auto determined)") : l.getDisplayName(l),
Note: See TracChangeset for help on using the changeset viewer.