Changeset 30532 in osm for applications/editors/josm/plugins/czechaddress
- Timestamp:
- 2014-07-14T04:18:06+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/Preferences.java
r27863 r30532 2 2 3 3 4 import java.awt.event.ActionEvent; 5 import java.awt.event.ActionListener; 6 7 import javax.swing.DefaultComboBoxModel; 8 import javax.swing.GroupLayout; 9 import javax.swing.JCheckBox; 10 import javax.swing.JComboBox; 11 import javax.swing.JLabel; 4 12 import javax.swing.JPanel; 13 import javax.swing.JTextField; 14 import javax.swing.event.ChangeEvent; 15 import javax.swing.event.ChangeListener; 5 16 6 17 import org.openstreetmap.josm.Main; … … 70 81 private void initComponents() { 71 82 72 mainPanel = new javax.swing.JPanel();73 addNewTagCheckBox = new javax.swing.JCheckBox();74 addNewTagKeyField = new javax.swing.JTextField();75 jLabel1 = new javax.swing.JLabel();76 addNewTagValueField = new javax.swing.JTextField();77 jLabel2 = new javax.swing.JLabel();78 optimizeComboBox = new javax.swing.JComboBox();79 buildingCheckBox = new javax.swing.JCheckBox();83 mainPanel = new JPanel(); 84 addNewTagCheckBox = new JCheckBox(); 85 addNewTagKeyField = new JTextField(); 86 jLabel1 = new JLabel(); 87 addNewTagValueField = new JTextField(); 88 jLabel2 = new JLabel(); 89 optimizeComboBox = new JComboBox<>(); 90 buildingCheckBox = new JCheckBox(); 80 91 81 92 thisPanel.setLayout(new java.awt.GridLayout(1, 0)); 82 93 83 94 addNewTagCheckBox.setText("Novým primitivám přidávat tag:"); 84 addNewTagCheckBox.addChangeListener(new javax.swing.event.ChangeListener() {85 public void stateChanged( javax.swing.event.ChangeEvent evt) {95 addNewTagCheckBox.addChangeListener(new ChangeListener() { 96 public void stateChanged(ChangeEvent evt) { 86 97 addNewTagChanged(evt); 87 98 } 88 99 }); 89 addNewTagCheckBox.addActionListener(new java.awt.event.ActionListener() {90 public void actionPerformed( java.awt.event.ActionEvent evt) {100 addNewTagCheckBox.addActionListener(new ActionListener() { 101 public void actionPerformed(ActionEvent evt) { 91 102 addNewTagCheckBoxActionPerformed(evt); 92 103 } … … 103 114 jLabel2.setText("Optimalizovat algoritmus přiřazování:"); 104 115 105 optimizeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "pro rychlejší odezvu", "menší spotřebu paměti" }));116 optimizeComboBox.setModel(new DefaultComboBoxModel<>(new String[] { "pro rychlejší odezvu", "menší spotřebu paměti" })); 106 117 optimizeComboBox.setSelectedIndex(1); 107 118 optimizeComboBox.setEnabled(false); 108 119 109 120 buildingCheckBox.setText("Nově polygonům přidávat tag \"building=yes\""); 110 buildingCheckBox.addChangeListener(new javax.swing.event.ChangeListener() {111 public void stateChanged( javax.swing.event.ChangeEvent evt) {121 buildingCheckBox.addChangeListener(new ChangeListener() { 122 public void stateChanged(ChangeEvent evt) { 112 123 buildingCheckBoxaddNewTagChanged(evt); 113 124 } … … 119 130 }); 120 131 121 javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);132 javax.swing.GroupLayout mainPanelLayout = new GroupLayout(mainPanel); 122 133 mainPanel.setLayout(mainPanelLayout); 123 134 mainPanelLayout.setHorizontalGroup( … … 213 224 private javax.swing.JLabel jLabel2; 214 225 private javax.swing.JPanel mainPanel; 215 private javax.swing.JComboBox optimizeComboBox;226 private javax.swing.JComboBox<String> optimizeComboBox; 216 227 // End of variables declaration//GEN-END:variables 217 228 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ElementWithHouses.java
r23190 r30532 57 57 return houses; 58 58 } 59 60 61 62 59 } -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ConflictResolver.java
r29854 r30532 87 87 candLabel = new javax.swing.JLabel(); 88 88 mainZoomButton = new javax.swing.JButton(); 89 mainField = new javax.swing.JComboBox ();90 candField = new javax.swing.JComboBox ();89 mainField = new javax.swing.JComboBox<>(); 90 candField = new javax.swing.JComboBox<>(); 91 91 candPickButton = new javax.swing.JButton(); 92 92 mainPickButton = new javax.swing.JButton(); … … 123 123 }); 124 124 125 mainField.setModel(new javax.swing.DefaultComboBoxModel (new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));125 mainField.setModel(new javax.swing.DefaultComboBoxModel<Object>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); 126 126 mainField.setRenderer(new UniversalListRenderer()); 127 127 128 candField.setModel(new javax.swing.DefaultComboBoxModel (new String[] { " " }));128 candField.setModel(new javax.swing.DefaultComboBoxModel<Object>(new String[] { " " })); 129 129 candField.setRenderer(new UniversalListRenderer()); 130 130 … … 236 236 r.unOverwrite(prim, r.translate(prim)); 237 237 238 ComboBoxModel model = candField.getModel();238 ComboBoxModel<Object> model = candField.getModel(); 239 239 for (int i = 0; i < model.getSize(); i++) { 240 240 AddressElement elem = (AddressElement) model.getElementAt(i); … … 253 253 r.unOverwrite(r.translate(elem), elem); 254 254 255 ComboBoxModel model = candField.getModel();255 ComboBoxModel<Object> model = candField.getModel(); 256 256 for (int i = 0; i < model.getSize(); i++) { 257 257 OsmPrimitive prim = (OsmPrimitive) model.getElementAt(i); … … 279 279 280 280 // Variables declaration - do not modify//GEN-BEGIN:variables 281 private javax.swing.JComboBox candField;281 private javax.swing.JComboBox<Object> candField; 282 282 private javax.swing.JLabel candLabel; 283 283 private javax.swing.JButton candPickButton; 284 284 private javax.swing.JButton candZoomButton; 285 private javax.swing.JComboBox mainField;285 private javax.swing.JComboBox<Object> mainField; 286 286 private javax.swing.JLabel mainLabel; 287 287 private javax.swing.JPanel mainPanel; … … 325 325 326 326 private ConflictsModel conflictModel = new ConflictsModel(); 327 private class ConflictsModel implements ComboBoxModel {327 private class ConflictsModel implements ComboBoxModel<Object> { 328 328 329 329 ArrayList<AddressElement> elements = new ArrayList<AddressElement>(); … … 473 473 conflPrims.addAll(Reasoner.getInstance().getCandidates(selElem)); 474 474 Collections.sort(conflPrims, PrimUtils.comparator); 475 candField.setModel(new CandidatesModel<O smPrimitive>(conflPrims));475 candField.setModel(new CandidatesModel<Object>(conflPrims)); 476 476 477 477 } else if (selected instanceof OsmPrimitive) { … … 480 480 conflElems.addAll(Reasoner.getInstance().getCandidates(selElem)); 481 481 Collections.sort(conflElems); 482 candField.setModel(new CandidatesModel< AddressElement>(conflElems));482 candField.setModel(new CandidatesModel<Object>(conflElems)); 483 483 484 484 } else { 485 candField.setModel(new DefaultComboBoxModel ());485 candField.setModel(new DefaultComboBoxModel<>()); 486 486 candZoomButton.setEnabled(false); 487 487 reassignButton.setEnabled(false); … … 512 512 } 513 513 514 private class CandidatesModel<E> implements ComboBoxModel {514 private class CandidatesModel<E> implements ComboBoxModel<E> { 515 515 516 516 Set<ListDataListener> listeners = new HashSet<ListDataListener>(); … … 540 540 } else 541 541 reassignButton.setEnabled(false); 542 543 544 542 } 545 543 … … 552 550 } 553 551 554 public ObjectgetElementAt(int index) {552 public E getElementAt(int index) { 555 553 if (index < primitives.size()) 556 554 return primitives.get(index); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/FactoryDialog.java
r30346 r30532 121 121 122 122 for (int i=0; i<houseModel.getSize(); i++) 123 if (houseModel.get HouseAt(i) == house) {123 if (houseModel.getElementAt(i) == house) { 124 124 houseList.setSelectedIndex(i); 125 125 houseList.ensureIndexIsVisible(i); … … 159 159 index++; // Initial kick to do at least one move. 160 160 House current; 161 while ( (current = houseModel.get HouseAt(index))!= null161 while ( (current = houseModel.getElementAt(index)) != null 162 162 && Reasoner.getInstance().translate(current) != null) 163 163 index++; … … 262 262 mainPanel = new javax.swing.JPanel(); 263 263 jScrollPane1 = new javax.swing.JScrollPane(); 264 houseList = new javax.swing.JList ();264 houseList = new javax.swing.JList<>(); 265 265 keepOddityCheckBox = new javax.swing.JCheckBox(); 266 266 relocateButton = new javax.swing.JButton(); 267 streetComboBox = new javax.swing.JComboBox ();267 streetComboBox = new javax.swing.JComboBox<>(); 268 268 269 269 setLayout(new java.awt.GridLayout(1, 0)); 270 271 houseList.setModel(new javax.swing.AbstractListModel () {270 /* 271 houseList.setModel(new javax.swing.AbstractListModel<String>() { 272 272 String[] strings = { " " }; 273 273 @Override 274 274 public int getSize() { return strings.length; } 275 275 @Override 276 public ObjectgetElementAt(int i) { return strings[i]; }277 }); 276 public String getElementAt(int i) { return strings[i]; } 277 });*/ 278 278 houseList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); 279 279 houseList.setEnabled(false); … … 349 349 350 350 // Variables declaration - do not modify//GEN-BEGIN:variables 351 private javax.swing.JList houseList;351 private javax.swing.JList<House> houseList; 352 352 private javax.swing.JScrollPane jScrollPane1; 353 353 private javax.swing.JCheckBox keepOddityCheckBox; 354 354 private javax.swing.JPanel mainPanel; 355 355 private javax.swing.JButton relocateButton; 356 private javax.swing.JComboBox streetComboBox;356 private javax.swing.JComboBox<ElementWithHouses> streetComboBox; 357 357 // End of variables declaration//GEN-END:variables 358 358 … … 370 370 private class StreetListRenderer extends DefaultListCellRenderer { 371 371 @Override 372 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {372 public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 373 373 Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 374 374 … … 398 398 399 399 @Override 400 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {400 public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 401 401 Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 402 402 … … 467 467 //============================================================================== 468 468 469 private class StreetListModel extends HalfCookedComboBoxModel {469 private class StreetListModel extends HalfCookedComboBoxModel<ElementWithHouses> { 470 470 471 471 private ElementWithHouses selected = null; … … 499 499 500 500 @Override 501 public ObjectgetElementAt(int index) {501 public ElementWithHouses getElementAt(int index) { 502 502 if (parent == null) return null; 503 503 … … 528 528 //============================================================================== 529 529 530 private class HouseListModel extends HalfCookedListModel 530 private class HouseListModel extends HalfCookedListModel<House> 531 531 implements ReasonerListener { 532 532 … … 544 544 } 545 545 546 public House getHouseAt(int index) { 546 @Override 547 public House getElementAt(int index) { 547 548 if (streetComboBox.getSelectedItem() == null) return null; 548 549 ElementWithHouses selected … … 555 556 556 557 @Override 557 public Object getElementAt(int index) {558 return getHouseAt(index);559 }560 561 @Override562 558 public void primitiveChanged(OsmPrimitive prim) {} 563 559 @Override -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java
r29854 r30532 66 66 initLocationHints(); 67 67 68 DefaultComboBoxModel regions = new DefaultComboBoxModel(Database.getInstance().regions.toArray());68 DefaultComboBoxModel<Region> regions = new DefaultComboBoxModel<>(Database.getInstance().regions.toArray(new Region[0])); 69 69 regionHlIndex = reshuffleListItems(regions, hlRegions); 70 70 oblastComboBox.setModel(regions); … … 173 173 * beginning, return number of moved items. 174 174 */ 175 176 private int reshuffleListItems(DefaultComboBoxModel list, final ArrayList<AddressElement> hlList) { 175 private <E> int reshuffleListItems(DefaultComboBoxModel<E> list, final ArrayList<AddressElement> hlList) { 177 176 int curHlIndex = 0; 178 177 179 178 for (int i = 0; i < list.getSize(); i++) 180 179 for (int j = 0; j < hlList.size(); j++) { 181 Objectt = list.getElementAt(i);180 E t = list.getElementAt(i); 182 181 if (t == hlList.get(j)) { 183 182 list.removeElementAt(i); … … 199 198 200 199 mainPanel = new javax.swing.JPanel(); 201 oblastComboBox = new javax.swing.JComboBox ();202 suburbComboBox = new javax.swing.JComboBox ();203 vitociComboBox = new javax.swing.JComboBox ();200 oblastComboBox = new javax.swing.JComboBox<>(); 201 suburbComboBox = new javax.swing.JComboBox<>(); 202 vitociComboBox = new javax.swing.JComboBox<>(); 204 203 obecLabel = new javax.swing.JLabel(); 205 204 castObceLabel = new javax.swing.JLabel(); … … 298 297 if (oblast == null) return; 299 298 300 DefaultComboBoxModel vitocis = new DefaultComboBoxModel(oblast.getViToCis().toArray());299 DefaultComboBoxModel<ViToCi> vitocis = new DefaultComboBoxModel<>(oblast.getViToCis().toArray(new ViToCi[0])); 301 300 vitociHlIndex = reshuffleListItems(vitocis, hlViToCis); 302 301 vitociComboBox.setModel(vitocis); … … 312 311 313 312 if (obec.getSuburbs().size() > 0) { 314 Object[] suburbs = new Object[obec.getSuburbs().size() + 1];313 ElementWithStreets[] suburbs = new ElementWithStreets[obec.getSuburbs().size() + 1]; 315 314 for (int i=0; i<obec.getSuburbs().size(); i++) 316 315 suburbs[i] = obec.getSuburbs().get(i); 317 316 suburbs[obec.getSuburbs().size()] = obec; 318 DefaultComboBoxModel suburbsList = new DefaultComboBoxModel(suburbs);317 DefaultComboBoxModel<ElementWithStreets> suburbsList = new DefaultComboBoxModel<>(suburbs); 319 318 suburbHlIndex = reshuffleListItems(suburbsList, hlSuburbs); 320 319 suburbComboBox.setModel(suburbsList); 321 320 suburbComboBox.setSelectedItem(suburbsList.getElementAt(0)); 322 321 } else 323 suburbComboBox.setModel(new DefaultComboBoxModel ());322 suburbComboBox.setModel(new DefaultComboBoxModel<ElementWithStreets>()); 324 323 325 324 suburbComboBox.setEnabled(suburbComboBox.getModel().getSize() > 1); … … 353 352 private javax.swing.JPanel mainPanel; 354 353 private javax.swing.JLabel obecLabel; 355 private javax.swing.JComboBox oblastComboBox;354 private javax.swing.JComboBox<Region> oblastComboBox; 356 355 private javax.swing.JLabel oblastLabel; 357 private javax.swing.JComboBox suburbComboBox;358 private javax.swing.JComboBox vitociComboBox;356 private javax.swing.JComboBox<ElementWithStreets> suburbComboBox; 357 private javax.swing.JComboBox<ViToCi> vitociComboBox; 359 358 // End of variables declaration//GEN-END:variables 360 359 … … 362 361 @Override 363 362 public Component getListCellRendererComponent( 364 JList list, Object value, int index,363 JList<?> list, Object value, int index, 365 364 boolean isSelected, boolean cellHasFocus) { 366 365 … … 383 382 private class SuburbRenderer extends AddressElementRenderer { 384 383 @Override 385 public Component getListCellRendererComponent(JList list, Object value,384 public Component getListCellRendererComponent(JList<?> list, Object value, 386 385 int index, boolean isSelected, boolean cellHasFocus) { 387 386 Component c = super.getListCellRendererComponent(list, value, -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java
r29727 r30532 197 197 changeLocationButton = new javax.swing.JButton(); 198 198 jScrollPane1 = new javax.swing.JScrollPane(); 199 proposalList = new javax.swing.JList ();200 matchesComboBox = new javax.swing.JComboBox ();199 proposalList = new javax.swing.JList<>(); 200 matchesComboBox = new javax.swing.JComboBox<>(); 201 201 jLabel6 = new javax.swing.JLabel(); 202 202 statusLabel = new javax.swing.JLabel(); … … 236 236 jScrollPane1.setViewportView(proposalList); 237 237 238 matchesComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "" }));238 //matchesComboBox.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] { "" })); 239 239 matchesComboBox.addItemListener(new java.awt.event.ItemListener() { 240 240 public void itemStateChanged(java.awt.event.ItemEvent evt) { … … 307 307 private void proposalListKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_proposalListKeyReleased 308 308 if (evt.getKeyCode() == KeyEvent.VK_DELETE) { 309 for (Object o : proposalList.getSelectedValues ())309 for (Object o : proposalList.getSelectedValuesList()) 310 310 proposalContainer.removeProposal((Proposal) o); 311 311 } … … 341 341 private javax.swing.JTextField locationEdit; 342 342 private javax.swing.JPanel mainPanel; 343 private javax.swing.JComboBox matchesComboBox;344 private javax.swing.JList proposalList;343 private javax.swing.JComboBox<AddressElement> matchesComboBox; 344 private javax.swing.JList<Proposal> proposalList; 345 345 private javax.swing.JLabel statusLabel; 346 346 // End of variables declaration//GEN-END:variables … … 349 349 * Container for all Houses, which match the given 'alternatenumber'. 350 350 */ 351 private class MatchesComboBoxModel extends HalfCookedComboBoxModel {351 private class MatchesComboBoxModel extends HalfCookedComboBoxModel<AddressElement> { 352 352 353 353 private List<AddressElement> matches = null; … … 379 379 } 380 380 381 public Object getElementAt(int index) {381 public AddressElement getElementAt(int index) { 382 382 if (matches == null) return null; 383 383 if (index >= matches.size()) return null; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/StreetEditor.java
r29854 r30532 37 37 38 38 nameField.setText(street.getName()); 39 houseList.setModel(new DefaultComboBoxModel (street.getHouses().toArray()));39 houseList.setModel(new DefaultComboBoxModel<>(street.getHouses().toArray(new House[0]))); 40 40 houseList.setCellRenderer(new UniversalListRenderer()); 41 41 … … 72 72 jLabel3 = new javax.swing.JLabel(); 73 73 jScrollPane1 = new javax.swing.JScrollPane(); 74 houseList = new javax.swing.JList ();74 houseList = new javax.swing.JList<>(); 75 75 parentEditButton = new javax.swing.JButton(); 76 76 houseEditButton = new javax.swing.JButton(); … … 163 163 assert selectedHouse != null; 164 164 if (EditorFactory.editHouse(selectedHouse)) 165 houseList.setModel(new DefaultComboBoxModel (street.getHouses().toArray()));165 houseList.setModel(new DefaultComboBoxModel<>(street.getHouses().toArray(new House[0]))); 166 166 }//GEN-LAST:event_houseEditButtonActionPerformed 167 167 … … 175 175 // Variables declaration - do not modify//GEN-BEGIN:variables 176 176 private javax.swing.JButton houseEditButton; 177 private javax.swing.JList houseList;177 private javax.swing.JList<House> houseList; 178 178 private javax.swing.JLabel jLabel1; 179 179 private javax.swing.JLabel jLabel2; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/SuburbEditor.java
r29854 r30532 39 39 parentEditButton.setEnabled(EditorFactory.isEditable(parent)); 40 40 41 houseList.setModel(new DefaultComboBoxModel (suburb.getHouses().toArray()));41 houseList.setModel(new DefaultComboBoxModel<>(suburb.getHouses().toArray(new House[0]))); 42 42 houseList.setCellRenderer(new UniversalListRenderer()); 43 43 … … 46 46 houseListChanged(null); 47 47 48 streetList.setModel(new DefaultComboBoxModel (suburb.getStreets().toArray()));48 streetList.setModel(new DefaultComboBoxModel<>(suburb.getStreets().toArray(new Street[0]))); 49 49 streetList.setCellRenderer(new UniversalListRenderer()); 50 50 … … 81 81 jLabel3 = new javax.swing.JLabel(); 82 82 jScrollPane1 = new javax.swing.JScrollPane(); 83 houseList = new javax.swing.JList ();83 houseList = new javax.swing.JList<>(); 84 84 parentEditButton = new javax.swing.JButton(); 85 85 houseEditButton = new javax.swing.JButton(); 86 86 jScrollPane2 = new javax.swing.JScrollPane(); 87 streetList = new javax.swing.JList ();87 streetList = new javax.swing.JList<>(); 88 88 streetEditButton = new javax.swing.JButton(); 89 89 jLabel4 = new javax.swing.JLabel(); … … 212 212 assert selectedHouse != null; 213 213 if (EditorFactory.editHouse(selectedHouse)) 214 houseList.setModel(new DefaultComboBoxModel (suburb.getHouses().toArray()));214 houseList.setModel(new DefaultComboBoxModel<>(suburb.getHouses().toArray(new House[0]))); 215 215 }//GEN-LAST:event_houseEditButtonActionPerformed 216 216 … … 223 223 assert selectedStreet != null; 224 224 if (EditorFactory.editStreet(selectedStreet)) 225 streetList.setModel(new DefaultComboBoxModel (suburb.getStreets().toArray()));225 streetList.setModel(new DefaultComboBoxModel<>(suburb.getStreets().toArray(new Street[0]))); 226 226 }//GEN-LAST:event_streetEditButtonActionPerformed 227 227 … … 229 229 // Variables declaration - do not modify//GEN-BEGIN:variables 230 230 private javax.swing.JButton houseEditButton; 231 private javax.swing.JList houseList;231 private javax.swing.JList<House> houseList; 232 232 private javax.swing.JLabel jLabel1; 233 233 private javax.swing.JLabel jLabel2; … … 242 242 private javax.swing.JTextField parentField; 243 243 private javax.swing.JButton streetEditButton; 244 private javax.swing.JList streetList;244 private javax.swing.JList<Street> streetList; 245 245 // End of variables declaration//GEN-END:variables 246 246 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedComboBoxModel.java
r15585 r30532 16 16 * @author Radomír Černoch, radomir.cernoch@gmail.com 17 17 */ 18 public abstract class HalfCookedComboBoxModel implements ComboBoxModel{18 public abstract class HalfCookedComboBoxModel<E> implements ComboBoxModel<E> { 19 19 20 20 List<ListDataListener> listeners = new ArrayList<ListDataListener>(); 21 21 22 @Override 22 23 public void addListDataListener(ListDataListener l) { 23 24 listeners.add(l); 24 25 } 25 26 27 @Override 26 28 public void removeListDataListener(ListDataListener l) { 27 29 listeners.remove(l); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedListModel.java
r15585 r30532 16 16 * @author Radomír Černoch, radomir.cernoch@gmail.com 17 17 */ 18 public abstract class HalfCookedListModel implements ListModel{18 public abstract class HalfCookedListModel<E> implements ListModel<E> { 19 19 20 20 List<ListDataListener> listeners = new ArrayList<ListDataListener>(); 21 21 22 @Override 22 23 public void addListDataListener(ListDataListener l) { 23 24 listeners.add(l); 24 25 } 25 26 27 @Override 26 28 public void removeListDataListener(ListDataListener l) { 27 29 listeners.remove(l); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ProposalContainer.java
r15584 r30532 23 23 * @see Proposal 24 24 */ 25 public class ProposalContainer implements ListModel, Comparable<ProposalContainer> { 26 25 public class ProposalContainer implements ListModel<Proposal>, Comparable<ProposalContainer> { 27 26 28 27 /** … … 65 64 * The list of proposals to be applied to encapsulated primitive. 66 65 */ 67 protected List<Proposal> proposals 68 = new ArrayList<Proposal>(); 66 protected List<Proposal> proposals = new ArrayList<Proposal>(); 69 67 70 68 /** … … 184 182 } 185 183 184 @Override 186 185 public int getSize() { 187 186 return proposals.size(); 188 187 } 189 188 190 public Object getElementAt(int index) { 189 @Override 190 public Proposal getElementAt(int index) { 191 191 return proposals.get(index); 192 192 } 193 193 194 @Override 194 195 public void addListDataListener(ListDataListener l) { 195 196 listeners.add(l); 196 197 } 197 198 199 @Override 198 200 public void removeListDataListener(ListDataListener l) { 199 201 listeners.remove(l); 200 202 } 201 203 204 @Override 202 205 public int compareTo(ProposalContainer o) { 203 206 return PrimUtils.comparator.compare(this.target, o.target); 204 207 } 205 206 208 }
Note:
See TracChangeset
for help on using the changeset viewer.