Changeset 25591 in osm for applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/BugsListModel.java
- Timestamp:
- 2011-03-14T09:30:11+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/BugsListModel.java
r24514 r25591 30 30 31 31 import java.util.List; 32 import javax.swing.ListModel; 33 import javax.swing.event.ListDataListener; 32 import javax.swing.AbstractListModel; 34 33 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug; 35 34 … … 41 40 * 42 41 */ 43 public class BugsListModel implements ListModel { 42 public class BugsListModel extends AbstractListModel { 43 44 /** The serial version UID */ 45 private static final long serialVersionUID = 3451277352571392219L; 44 46 45 47 /** The list of <code>MapdustBug</code> objects */ … … 62 64 } 63 65 64 @Override 65 public void addListDataListener(ListDataListener l) {} 66 66 /** 67 * Returns the <code>MapdustBug</code> from the given position. 68 * 69 * @param index The position of the element 70 * @return <code>MapdustBug</code> from the given position 71 */ 67 72 @Override 68 73 public Object getElementAt(int index) { 69 return bugs.get(index); 74 if (index >= 0 && index < bugs.size()) { 75 return bugs.get(index); 76 } 77 return null; 70 78 } 71 79 80 /** 81 * Returns the size of the list of objects. 82 * 83 * @return size 84 */ 72 85 @Override 73 86 public int getSize() { … … 75 88 } 76 89 77 @Override 78 public void removeListDataListener(ListDataListener l) {} 90 /** 91 * Updates the bugs list model. 92 */ 93 public void update() { 94 this.fireContentsChanged(this, 0, bugs.size() - 1); 95 } 79 96 80 97 }
Note:
See TracChangeset
for help on using the changeset viewer.