Changeset 146 in josm
- Timestamp:
- 2006-10-04T19:56:06+02:00 (18 years ago)
- Files:
-
- 13 added
- 1 deleted
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
data/empty.xml
r142 r146 1 1 <?xml version='1.0' encoding='UTF-8'?> 2 2 <osm version='0.3' generator='JOSM'> 3 <node id='-1' lat='19.054463960754692' lon='-66.94382022471912' /> 4 <node id='2' lat='43.00883564541926' lon='-6.269662921348315' /> 5 <node id='-2' lat='-34.84314824807727' lon='-13.146067415730338' /> 3 6 <node id='1' lat='67.99839775928415' lon='-59.66292134831462' /> 4 <node id='2' lat='43.00883564541926' lon='-6.269662921348315' /> 5 <node id='-3' lat='19.054463960754692' lon='-66.94382022471912' /> 6 <node id='-4' lat='-24.68228648077048' lon='-40.651685393258425' /> 7 <node id='-5' lat='-34.84314824807727' lon='-13.146067415730338' /> 8 <segment id='-6' from='1' to='2' /> 9 <segment id='-7' from='2' to='-3' /> 10 <segment id='-8' from='-5' to='-4' /> 11 <way id='-9'> 7 <node id='-3' lat='-24.68228648077048' lon='-40.651685393258425' /> 8 <segment id='-4' from='1' to='2' /> 9 <segment id='-5' from='-2' to='-3' /> 10 <segment id='-6' from='2' to='-1' /> 11 <way id='-7'> 12 <seg id='-4' /> 12 13 <seg id='-6' /> 13 <seg id='-7' />14 14 </way> 15 <way id='- 10'>16 <seg id='- 8' />15 <way id='-8'> 16 <seg id='-5' /> 17 17 </way> 18 18 </osm> -
src/org/openstreetmap/josm/Main.java
r145 r146 31 31 32 32 import org.openstreetmap.josm.actions.AboutAction; 33 import org.openstreetmap.josm.actions.AlignInCircleAction; 33 34 import org.openstreetmap.josm.actions.DownloadAction; 34 35 import org.openstreetmap.josm.actions.ExitAction; … … 174 175 annotationTesterAction.putValue(Action.SMALL_ICON, ImageProvider.get("annotation-tester")); 175 176 final Action reverseSegmentAction = new ReverseSegmentAction(); 177 final Action alignInCircleAction = new AlignInCircleAction(); 176 178 final Action uploadAction = new UploadAction(); 177 179 final Action saveAction = new SaveAction(); … … 211 213 editMenu.addSeparator(); 212 214 editMenu.add(reverseSegmentAction); 215 editMenu.add(alignInCircleAction); 213 216 editMenu.addSeparator(); 214 217 editMenu.add(preferencesAction); … … 239 242 toolBar.add(undoAction); 240 243 toolBar.add(redoAction); 241 toolBar.addSeparator();242 toolBar.add(reverseSegmentAction);243 244 toolBar.addSeparator(); 244 245 toolBar.add(preferencesAction); -
src/org/openstreetmap/josm/actions/ExternalToolsAction.java
r143 r146 76 76 final boolean addGpx = flags.contains("gpx"); 77 77 78 AddVisitor adder = new AddVisitor(fromDataSet, flags.contains("include_references")); 78 AddVisitor adder = new AddVisitor(fromDataSet); 79 if (flags.contains("include_references")) { 80 adder = new AddVisitor(fromDataSet){ 81 @Override public void visit(Node n) { 82 if (!ds.nodes.contains(n)) 83 super.visit(n); 84 } 85 @Override public void visit(Segment s) { 86 super.visit(s); 87 if (!s.incomplete) { 88 if (!ds.nodes.contains(s.from)) 89 s.from.visit(this); 90 if (!ds.nodes.contains(s.to)) 91 s.to.visit(this); 92 } 93 } 94 @Override public void visit(Way w) { 95 super.visit(w); 96 for (Segment s : w.segments) 97 if (!ds.segments.contains(s)) 98 s.visit(this); 99 } 100 }; 101 } 79 102 if (input.contains("selection")) { 80 103 Collection<OsmPrimitive> sel = Main.ds.getSelected(); -
src/org/openstreetmap/josm/command/Command.java
r98 r146 2 2 3 3 import java.util.Collection; 4 import java.util.HashMap; 4 5 import java.util.HashSet; 6 import java.util.Map; 5 7 import java.util.Map.Entry; 6 8 7 9 import javax.swing.tree.MutableTreeNode; 8 10 11 import org.openstreetmap.josm.data.osm.Node; 9 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 10 import org.openstreetmap.josm.data.osm.visitor.CloneVisitor; 13 import org.openstreetmap.josm.data.osm.Segment; 14 import org.openstreetmap.josm.data.osm.Way; 15 import org.openstreetmap.josm.data.osm.visitor.Visitor; 11 16 12 17 … … 23 28 abstract public class Command { 24 29 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 25 44 private CloneVisitor orig; 26 45 -
src/org/openstreetmap/josm/command/MoveCommand.java
r104 r146 4 4 import static org.openstreetmap.josm.tools.I18n.trn; 5 5 6 import java.util.Arrays; 6 7 import java.util.Collection; 7 8 import java.util.Iterator; … … 56 57 private List<OldState> oldState = new LinkedList<OldState>(); 57 58 59 60 public MoveCommand(OsmPrimitive osm, double x, double y) { 61 this(Arrays.asList(new OsmPrimitive[]{osm}), x, y); 62 } 58 63 /** 59 64 * Create a MoveCommand and assign the initial object set and movement vector. -
src/org/openstreetmap/josm/data/osm/visitor/AddVisitor.java
r142 r146 17 17 public class AddVisitor implements Visitor { 18 18 19 private final DataSet ds; 20 private final boolean includeReferences; 21 22 public AddVisitor(DataSet ds, boolean includeReferences) { 23 this.ds = ds; 24 this.includeReferences = includeReferences; 25 } 19 protected final DataSet ds; 26 20 27 21 public AddVisitor(DataSet ds) { 28 this (ds, false);22 this.ds = ds; 29 23 } 30 24 31 25 public void visit(Node n) { 32 if (!includeReferences || !ds.nodes.contains(n)) 33 ds.nodes.add(n); 26 ds.nodes.add(n); 34 27 } 35 28 public void visit(Segment s) { 36 29 ds.segments.add(s); 37 if (includeReferences && !s.incomplete) {38 if (!ds.nodes.contains(s.from))39 s.from.visit(this);40 if (!ds.nodes.contains(s.to))41 s.to.visit(this);42 }43 30 } 44 31 public void visit(Way w) { 45 32 ds.ways.add(w); 46 if (includeReferences)47 for (Segment s : w.segments)48 if (!ds.segments.contains(s))49 s.visit(this);50 33 } 51 34 } -
src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r86 r146 9 9 10 10 /** 11 * Calculates the total bounding rectangle of a serie of OsmPrimitives, using the EastNorth values12 * as reference.11 * Calculates the total bounding rectangle of a serie of OsmPrimitives, using the 12 * EastNorth values as reference. 13 13 * @author imi 14 14 */ -
test/org/openstreetmap/josm/tools/DateParserTest.java
r141 r146 1 package org.openstreetmap.josm.t estframework;1 package org.openstreetmap.josm.tools; 2 2 3 3 import java.text.ParseException;
Note:
See TracChangeset
for help on using the changeset viewer.