Ignore:
Timestamp:
2014-07-14T04:18:06+02:00 (10 years ago)
Author:
donvip
Message:

[josm_plugins] fix compilation warnings

Location:
applications/editors/josm/plugins/reltoolbox/src/relcontext
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java

    r30145 r30532  
    137137
    138138        final MouseListener relationMouseAdapter = new ChosenRelationMouseAdapter();
    139         final JComboBox roleBox = new JComboBox();
     139        final JComboBox<String> roleBox = new JComboBox<>();
    140140        roleBoxModel = new RoleComboBoxModel(roleBox);
    141141        roleBox.setModel(roleBoxModel);
     
    620620            setEnabled(newRelation != null);
    621621        }
    622         }
     622    }
    623623       
    624     private class RoleComboBoxModel extends AbstractListModel implements ComboBoxModel {
     624    private class RoleComboBoxModel extends AbstractListModel<String> implements ComboBoxModel<String> {
    625625        private List<String> roles = new ArrayList<String>();
    626626        private int selectedIndex = -1;
    627         private JComboBox combobox;
     627        private JComboBox<String> combobox;
    628628        private String membersRole;
    629629        private final String EMPTY_ROLE = tr("<empty>");
    630630        private final String ANOTHER_ROLE = tr("another...");
    631631
    632         public RoleComboBoxModel( JComboBox combobox ) {
     632        public RoleComboBoxModel( JComboBox<String> combobox ) {
    633633            super();
    634634            this.combobox = combobox;
     
    708708        }
    709709
    710         public Object getElementAt( int index ) {
     710        public String getElementAt( int index ) {
    711711            return getRole(index);
    712712        }
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/FindRelationAction.java

    r28857 r30532  
    3737        panel.add(searchField, BorderLayout.NORTH);
    3838        final FindRelationListModel relationsData = new FindRelationListModel();
    39         final JList relationsList = new JList(relationsData);
     39        final JList<Relation> relationsList = new JList<>(relationsData);
    4040        relationsList.setSelectionModel(relationsData.getSelectionModel());
    4141        relationsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    167167     * I admit, some of it was copypasted from {@link org.openstreetmap.josm.gui.dialogs.RelationListDialog.RelationListModel}.
    168168     */
    169     protected class FindRelationListModel extends AbstractListModel {
     169    protected class FindRelationListModel extends AbstractListModel<Relation> {
    170170        private final ArrayList<Relation> relations = new ArrayList<Relation>();
    171171        private DefaultListSelectionModel selectionModel;
     
    184184        }
    185185
    186         public Relation getRelation( int idx ) {
    187             return relations.get(idx);
    188         }
    189 
     186        @Override
    190187        public int getSize() {
    191188            return relations.size();
    192189        }
    193190
    194         public Object getElementAt( int index ) {
    195             return getRelation(index);
     191        @Override
     192        public Relation getElementAt( int index ) {
     193            return relations.get(index);
    196194        }
    197195
    198196        public void setRelations(Collection<Relation> relations) {
    199197            int selectedIndex = selectionModel.getMinSelectionIndex();
    200             Relation sel =  selectedIndex < 0 ? null : getRelation(selectedIndex);
     198            Relation sel =  selectedIndex < 0 ? null : getElementAt(selectedIndex);
    201199           
    202200            this.relations.clear();
Note: See TracChangeset for help on using the changeset viewer.