source: josm/src/org/openstreetmap/josm/data/osm/visitor/AddVisitor.java@ 35

Last change on this file since 35 was 35, checked in by imi, 18 years ago
  • fixed bug in UTM
  • upload of nodes and segments
  • fixed bugs in display the selection
File size: 838 bytes
Line 
1/**
2 */
3package org.openstreetmap.josm.data.osm.visitor;
4
5import org.openstreetmap.josm.data.osm.DataSet;
6import org.openstreetmap.josm.data.osm.Key;
7import org.openstreetmap.josm.data.osm.LineSegment;
8import org.openstreetmap.josm.data.osm.Node;
9import org.openstreetmap.josm.data.osm.Track;
10
11/**
12 * Visitor, that adds the visited object to the dataset given at constructor.
13 *
14 * Is not capable of adding keys.
15 *
16 * @author imi
17 */
18public class AddVisitor implements Visitor {
19
20 private final DataSet ds;
21
22 public AddVisitor(DataSet ds) {
23 this.ds = ds;
24 }
25
26 public void visit(Node n) {
27 ds.nodes.add(n);
28 n.setDeleted(false);
29 }
30 public void visit(LineSegment ls) {
31 ds.lineSegments.add(ls);
32 ls.setDeleted(false);
33 }
34 public void visit(Track t) {
35 ds.tracks.add(t);
36 t.setDeleted(false);
37 }
38 public void visit(Key k) {}
39}
Note: See TracBrowser for help on using the repository browser.