Ignore:
Timestamp:
2006-10-04T19:56:06+02:00 (18 years ago)
Author:
imi
Message:
  • added "Align nodes in a circle" patch from Matthew Newton.
  • added a couple of unit tests
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/command/Command.java

    r98 r146  
    22
    33import java.util.Collection;
     4import java.util.HashMap;
    45import java.util.HashSet;
     6import java.util.Map;
    57import java.util.Map.Entry;
    68
    79import javax.swing.tree.MutableTreeNode;
    810
     11import org.openstreetmap.josm.data.osm.Node;
    912import org.openstreetmap.josm.data.osm.OsmPrimitive;
    10 import org.openstreetmap.josm.data.osm.visitor.CloneVisitor;
     13import org.openstreetmap.josm.data.osm.Segment;
     14import org.openstreetmap.josm.data.osm.Way;
     15import org.openstreetmap.josm.data.osm.visitor.Visitor;
    1116
    1217
     
    2328abstract public class Command {
    2429
     30        private static final class CloneVisitor implements Visitor {
     31                public Map<OsmPrimitive, OsmPrimitive> orig = new HashMap<OsmPrimitive, OsmPrimitive>();
     32               
     33                public void visit(Node n) {
     34                        orig.put(n, new Node(n));
     35            }
     36                public void visit(Segment s) {
     37                        orig.put(s, new Segment(s));
     38            }
     39                public void visit(Way w) {
     40                        orig.put(w, new Way(w));
     41            }
     42        }
     43       
    2544        private CloneVisitor orig;
    2645       
Note: See TracChangeset for help on using the changeset viewer.