Changeset 1836 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2009-07-25T13:12:07+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/relation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowser.java
r1828 r1836 58 58 private final GenericRelationEditor relationEditor; 59 59 60 /** state flag for this browser. Initially initialized is false.61 * It becomes initialized after the first download of the parent62 * relations.63 */64 private boolean initialized;65 66 60 /** 67 61 * build the GUI … … 97 91 } 98 92 99 100 /**101 * Replies true this browser has initialized itself by downloading the reference relations102 * parents.103 *104 * @return true this browser has initialized itself by downloading the reference relations105 * parents; false, otherwise106 */107 public boolean isInitialized() {108 return initialized;109 }110 111 93 public void init() { 112 if (initialized) return; 113 initialized = true; 114 boolean full = cbReadFull.isSelected(); 115 ReloadTask task = new ReloadTask(full, relationEditor); 116 Main.worker.submit(task); 94 model.populate(getLayer().data); 117 95 } 118 96 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ReferringRelationsBrowserModel.java
r1828 r1836 6 6 import javax.swing.AbstractListModel; 7 7 8 import org.openstreetmap.josm.data.osm.DataSet; 8 9 import org.openstreetmap.josm.data.osm.Relation; 9 10 import org.openstreetmap.josm.data.osm.RelationMember; … … 66 67 } 67 68 69 /** 70 * Populates the browser with the list of referring relations in the {@see DataSet} ds. 71 * 72 * @param ds the data set 73 */ 74 public void populate(DataSet ds) { 75 referrers.clear(); 76 if (ds == null) { 77 fireModelUpdate(); 78 return; 79 } 80 for (Relation parent : ds.relations) { 81 if (isReferringRelation(parent)) { 82 referrers.add(parent); 83 } 84 } 85 fireModelUpdate(); 86 } 87 88 68 89 public boolean canReload() { 69 90 return relation != null && relation.id > 0;
Note:
See TracChangeset
for help on using the changeset viewer.