Changeset 30532 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/actions
- Timestamp:
- 2014-07-14T04:18:06+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/FindRelationAction.java
r28857 r30532 37 37 panel.add(searchField, BorderLayout.NORTH); 38 38 final FindRelationListModel relationsData = new FindRelationListModel(); 39 final JList relationsList = new JList(relationsData); 39 final JList<Relation> relationsList = new JList<>(relationsData); 40 40 relationsList.setSelectionModel(relationsData.getSelectionModel()); 41 41 relationsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); … … 167 167 * I admit, some of it was copypasted from {@link org.openstreetmap.josm.gui.dialogs.RelationListDialog.RelationListModel}. 168 168 */ 169 protected class FindRelationListModel extends AbstractListModel { 169 protected class FindRelationListModel extends AbstractListModel<Relation> { 170 170 private final ArrayList<Relation> relations = new ArrayList<Relation>(); 171 171 private DefaultListSelectionModel selectionModel; … … 184 184 } 185 185 186 public Relation getRelation( int idx ) { 187 return relations.get(idx); 188 } 189 186 @Override 190 187 public int getSize() { 191 188 return relations.size(); 192 189 } 193 190 194 public Object getElementAt( int index ) { 195 return getRelation(index); 191 @Override 192 public Relation getElementAt( int index ) { 193 return relations.get(index); 196 194 } 197 195 198 196 public void setRelations(Collection<Relation> relations) { 199 197 int selectedIndex = selectionModel.getMinSelectionIndex(); 200 Relation sel = selectedIndex < 0 ? null : get Relation(selectedIndex);198 Relation sel = selectedIndex < 0 ? null : getElementAt(selectedIndex); 201 199 202 200 this.relations.clear();
Note:
See TracChangeset
for help on using the changeset viewer.