Changeset 29153 in osm for applications/editors
- Timestamp:
- 2013-01-01T22:48:01+01:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/seamap/Map.java
r29152 r29153 38 38 39 39 public class Feature { 40 public long id;41 40 public Fflag flag; 42 41 public ArrayList<Long> refs; … … 50 49 51 50 void clean() { 52 id = 0;53 51 flag = Fflag.UNKN; 54 52 refs = new ArrayList<Long>(); -
applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
r29152 r29153 41 41 @Override 42 42 public void dataChanged(DataChangedEvent e) { 43 System.out.println(e);43 reMap(); 44 44 } 45 45 46 46 @Override 47 47 public void nodeMoved(NodeMovedEvent e) { 48 System.out.println(e);48 reMap(); 49 49 } 50 50 51 51 @Override 52 52 public void otherDatasetChange(AbstractDatasetChangedEvent e) { 53 System.out.println(e);53 reMap(); 54 54 } 55 55 56 56 @Override 57 57 public void primitivesAdded(PrimitivesAddedEvent e) { 58 System.out.println(e);58 reMap(); 59 59 } 60 60 61 61 @Override 62 62 public void primitivesRemoved(PrimitivesRemovedEvent e) { 63 System.out.println(e);63 reMap(); 64 64 } 65 65 66 66 @Override 67 67 public void relationMembersChanged(RelationMembersChangedEvent e) { 68 System.out.println(e);68 reMap(); 69 69 } 70 70 71 71 @Override 72 72 public void tagsChanged(TagsChangedEvent e) { 73 System.out.println(e);73 reMap(); 74 74 } 75 75 76 76 @Override 77 77 public void wayNodesChanged(WayNodesChangedEvent e) { 78 System.out.println(e);78 reMap(); 79 79 } 80 80 }; … … 143 143 newLayer.data.addDataSetListener(dataSetListener); 144 144 data = newLayer.data.allPrimitives(); 145 map = new Map(); 146 for (OsmPrimitive osm : data) { 147 if (osm instanceof Node) { 148 map.addNode(((Node)osm).getId(), ((Node)osm).getCoor().lat(), ((Node)osm).getCoor().lon()); 149 } else if (osm instanceof Way) { 150 map.addWay(((Way)osm).getId()); 151 } 152 for (Entry<String, String> entry : osm.getKeys().entrySet()) { 153 map.addTag(entry.getKey(), entry.getValue()); 154 } 155 } 145 reMap(); 156 146 } else { 157 147 data = null; … … 165 155 166 156 } 157 158 void reMap() { 159 map = new Map(); 160 for (OsmPrimitive osm : data) { 161 if (osm instanceof Node) { 162 map.addNode(((Node)osm).getId(), ((Node)osm).getCoor().lat(), ((Node)osm).getCoor().lon()); 163 } else if (osm instanceof Way) { 164 map.addWay(((Way)osm).getId()); 165 for (Node node : ((Way)osm).getNodes()) { 166 map.addToWay(((Way)osm).getUniqueId(), node.getUniqueId()); 167 } 168 } 169 for (Entry<String, String> entry : osm.getKeys().entrySet()) { 170 map.addTag(entry.getKey(), entry.getValue()); 171 } 172 } 173 174 } 167 175 168 176 }
Note:
See TracChangeset
for help on using the changeset viewer.