Changeset 17 in josm for src/org/openstreetmap/josm/data/osm


Ignore:
Timestamp:
2005-10-09T04:14:40+02:00 (19 years ago)
Author:
imi
Message:
  • added Layer support
  • added support for raw GPS data
  • fixed tooltips
  • added options for loading gpx files
Location:
src/org/openstreetmap/josm/data/osm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/data/osm/DataSet.java

    r16 r17  
    186186
    187187        /**
     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        /**
    188214         * Remove the selection from every value in the collection.
    189215         * @param list The collection to remove the selection from.
  • src/org/openstreetmap/josm/data/osm/Node.java

    r9 r17  
    3333                return Collections.unmodifiableCollection(parentSegment);
    3434        }
     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        }
    3551       
    3652        /**
  • src/org/openstreetmap/josm/data/osm/visitor/SelectionComponentVisitor.java

    r11 r17  
    77
    88import javax.swing.Icon;
    9 import javax.swing.ImageIcon;
    109
    1110import org.openstreetmap.josm.data.osm.Key;
     
    1312import org.openstreetmap.josm.data.osm.Node;
    1413import org.openstreetmap.josm.data.osm.Track;
    15 import org.openstreetmap.josm.gui.Main;
     14import org.openstreetmap.josm.gui.ImageProvider;
    1615
    1716/**
     
    3837        public void visit(Key k) {
    3938                name = k.name;
    40                 icon = new ImageIcon(Main.class.getResource("/images/data/key.png"));
     39                icon = ImageProvider.get("data", "key");
    4140        }
    4241
     
    5352                       
    5453                this.name = name;
    55                 icon = new ImageIcon("images/data/linesegment.png");
     54                icon = ImageProvider.get("data", "linesegment");
    5655        }
    5756
     
    6766               
    6867                this.name = name;
    69                 icon = new ImageIcon("images/data/node.png");
     68                icon = ImageProvider.get("data", "node");
    7069        }
    7170
     
    8786               
    8887                this.name = name;
    89                 icon = new ImageIcon("images/data/track.png");
     88                icon = ImageProvider.get("data", "track");
    9089        }
    9190
Note: See TracChangeset for help on using the changeset viewer.