Changeset 32932 in osm for applications/editors/josm/plugins
- Timestamp:
- 2016-09-07T01:01:56+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/opendata/modules/fr.toulouse/src/org/openstreetmap/josm/plugins/opendata/modules/fr/toulouse/datasets/ToulouseDataSetHandler.java
r31958 r32932 45 45 public static final DataSetCategory CAT_CULTURE = new DataSetCategory("Culture", "presets/arts_centre.png"); 46 46 public static final DataSetCategory CAT_ENFANCE = new DataSetCategory("Enfance", "presets/kindergarten.png"); 47 public static final DataSetCategory CAT_ENVIRONNEMENT = new DataSetCategory("Environnement", "styles/standard/service/recycling/recycling_container.svg"); 47 public static final DataSetCategory CAT_ENVIRONNEMENT = new DataSetCategory("Environnement", 48 "styles/standard/service/recycling/recycling_container.svg"); 48 49 public static final DataSetCategory CAT_PATRIMOINE = new DataSetCategory("Patrimoine", "presets/ruins.png"); 49 50 public static final DataSetCategory CAT_SERVICES = new DataSetCategory("Services", "styles/standard/vehicle/services.png"); … … 85 86 }*/ 86 87 87 private finalvoid init(int portalId) {88 private void init(int portalId) { 88 89 try { 89 90 setLicense(new ToulouseLicense()); … … 141 142 public void actionPerformed(ActionEvent e) { 142 143 final String baseName = OdPlugin.getInstance().getDialog().getDataLayer().getName(); 143 final DataSet baseDs = getCurrentDataSet();144 final DataSet baseDs = Main.getLayerManager().getEditDataSet(); 144 145 for (OsmPrimitive boundary : getBoundaries()) { 145 146 DataSet data = new DataSet(); 146 147 for (OsmPrimitive p : NodeWayUtils.selectAllInside(Collections.singleton(boundary), baseDs)) { 147 148 if (p instanceof Node) { 148 data.addPrimitive(new Node((Node) p));149 data.addPrimitive(new Node((Node) p)); 149 150 } else if (p instanceof Way) { 150 data.addPrimitive(new Way((Way) p));151 data.addPrimitive(new Way((Way) p)); 151 152 } else if (p instanceof Relation) { 152 data.addPrimitive(new Relation((Relation) p));153 data.addPrimitive(new Relation((Relation) p)); 153 154 } 154 155 } … … 165 166 } 166 167 } 168 167 169 @Override 168 170 public void dataChanged(DataChangedEvent event) { 169 171 setEnabled(!getBoundaries().isEmpty()); 170 172 } 173 171 174 @Override 172 175 public void primitivesAdded(PrimitivesAddedEvent event) { 173 176 } 177 174 178 @Override 175 179 public void primitivesRemoved(PrimitivesRemovedEvent event) { 176 180 } 181 177 182 @Override 178 183 public void tagsChanged(TagsChangedEvent event) { 179 184 } 185 180 186 @Override 181 187 public void nodeMoved(NodeMovedEvent event) { 182 188 } 189 183 190 @Override 184 191 public void wayNodesChanged(WayNodesChangedEvent event) { 185 192 } 193 186 194 @Override 187 195 public void relationMembersChanged(RelationMembersChangedEvent event) { 188 196 } 197 189 198 @Override 190 199 public void otherDatasetChange(AbstractDatasetChangedEvent event) { … … 196 205 super(marktr("Split by municipality"), tr("Split this data by municipality (admin_level=8).")); 197 206 } 207 198 208 @Override 199 209 protected Collection<Relation> getBoundaries() { … … 206 216 super(marktr("Split by sector"), tr("Split this data by sector (admin_level=10).")); 207 217 } 218 208 219 @Override 209 220 protected Collection<Relation> getBoundaries() { … … 216 227 super(marktr("Split by neighbourhood"), tr("Split this data by neighbourhood (admin_level=11).")); 217 228 } 229 218 230 @Override 219 231 protected Collection<Relation> getBoundaries() {
Note:
See TracChangeset
for help on using the changeset viewer.