Changeset 15961 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java
- Timestamp:
- 2009-06-17T09:46:26+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java
r13611 r15961 24 24 /** 25 25 * This hook is called at JOSM upload and will check if new nodes and ways provide 26 * a tag "source=". If not and if auto-sourcing is enabled, it will add 26 * a tag "source=". If not and if auto-sourcing is enabled, it will add 27 27 * automatically a tag "source"="Cadastre..." as defined in the plugin preferences. 28 28 */ 29 29 public class CheckSourceUploadHook implements UploadHook 30 30 { 31 31 /** Serializable ID */ 32 32 private static final long serialVersionUID = -1; 33 33 … … 40 40 Collection<OsmPrimitive> sel = new HashSet<OsmPrimitive>(); 41 41 for (OsmPrimitive osm : add) { 42 if ((osm instanceof Node || osm instanceof Way) 42 if ((osm instanceof Node || osm instanceof Way) 43 43 && (osm.keys == null || !tagSourceExist(osm))) { 44 44 sel.add(osm); … … 51 51 return true; 52 52 } 53 53 54 54 /** 55 55 * Check whenever one of the keys of the object is "source" … … 65 65 return false; 66 66 } 67 67 68 68 /** 69 * Displays a screen with the list of objects which will be tagged with 69 * Displays a screen with the list of objects which will be tagged with 70 70 * source="cadastre.." if it is approved. 71 71 * @param sel the list of elements added without a key "source" 72 72 */ 73 private void displaySource(Collection<OsmPrimitive> sel) 73 private void displaySource(Collection<OsmPrimitive> sel) 74 74 { 75 75 if (!sel.isEmpty()) { … … 86 86 Main.main.undoRedo.add(new ChangePropertyCommand(sel, "source", CadastrePlugin.source)); 87 87 } 88 89 } 88 89 } 90 90 }
Note:
See TracChangeset
for help on using the changeset viewer.