Changeset 17 in josm for src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2005-10-09T04:14:40+02:00 (19 years ago)
- Location:
- src/org/openstreetmap/josm/data/osm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/data/osm/DataSet.java
r16 r17 186 186 187 187 /** 188 * Import the given dataset by merging all data with this dataset. 189 * The objects imported are not cloned, so from now on, these data belong 190 * to both datasets. So use mergeFrom only if you are about to abandon the 191 * other dataset or this dataset. 192 * 193 * @param ds The DataSet to merge into this one. 194 * @param mergeEqualNodes If <code>true</code>, nodes with the same lat/lon 195 * are merged together. 196 */ 197 public void mergeFrom(DataSet ds, boolean mergeEqualNodes) { 198 if (mergeEqualNodes) { 199 LinkedList<Node> nodesToAdd = new LinkedList<Node>(); 200 for (Node n : ds.nodes) 201 for (Node mynode : nodes) { 202 if (mynode.coor.equalsLatLon(n.coor)) 203 mynode.mergeFrom(n); 204 else 205 nodesToAdd.add(n); 206 } 207 } else 208 nodes.addAll(ds.nodes); 209 tracks.addAll(ds.tracks); 210 pendingLineSegments.addAll(ds.pendingLineSegments); 211 } 212 213 /** 188 214 * Remove the selection from every value in the collection. 189 215 * @param list The collection to remove the selection from. -
src/org/openstreetmap/josm/data/osm/Node.java
r9 r17 33 33 return Collections.unmodifiableCollection(parentSegment); 34 34 } 35 36 /** 37 * Merge the node given at parameter with this node. 38 * All parents of the parameter-node become parents of this node. 39 * 40 * The argument node is not changed. 41 * 42 * @param node Merge the node to this. 43 */ 44 public void mergeFrom(Node node) { 45 parentSegment.addAll(node.parentSegment); 46 if (keys == null) 47 keys = node.keys; 48 else if (node.keys != null) 49 keys.putAll(node.keys); 50 } 35 51 36 52 /** -
src/org/openstreetmap/josm/data/osm/visitor/SelectionComponentVisitor.java
r11 r17 7 7 8 8 import javax.swing.Icon; 9 import javax.swing.ImageIcon;10 9 11 10 import org.openstreetmap.josm.data.osm.Key; … … 13 12 import org.openstreetmap.josm.data.osm.Node; 14 13 import org.openstreetmap.josm.data.osm.Track; 15 import org.openstreetmap.josm.gui. Main;14 import org.openstreetmap.josm.gui.ImageProvider; 16 15 17 16 /** … … 38 37 public void visit(Key k) { 39 38 name = k.name; 40 icon = new ImageIcon(Main.class.getResource("/images/data/key.png"));39 icon = ImageProvider.get("data", "key"); 41 40 } 42 41 … … 53 52 54 53 this.name = name; 55 icon = new ImageIcon("images/data/linesegment.png");54 icon = ImageProvider.get("data", "linesegment"); 56 55 } 57 56 … … 67 66 68 67 this.name = name; 69 icon = new ImageIcon("images/data/node.png");68 icon = ImageProvider.get("data", "node"); 70 69 } 71 70 … … 87 86 88 87 this.name = name; 89 icon = new ImageIcon("images/data/track.png");88 icon = ImageProvider.get("data", "track"); 90 89 } 91 90
Note:
See TracChangeset
for help on using the changeset viewer.