Ignore:
Timestamp:
2007-09-24T01:36:24+02:00 (17 years ago)
Author:
framm
Message:

This commit is a manual merge of all changes that have been made to
the intermediate "core_0.5" branch on the main OSM repository,
bevore JOSM was moved to openstreetmap.de.

Changes incorporated here:

r4464@svn.openstreetmap.org
r4466@svn.openstreetmap.org
r4468@svn.openstreetmap.org
r4469@svn.openstreetmap.org
r4479@svn.openstreetmap.org

File:
1 edited

Legend:

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

    r298 r329  
    3131
    3232        /**
    33          * All segments goes here, even when they are in a way.
     33         * All ways (Streets etc.) in the DataSet.
     34         *
     35         * The way nodes are stored only in the way list.
    3436         */
    35         public Collection<Segment> segments = new LinkedList<Segment>();
     37        public Collection<Way> ways = new LinkedList<Way>();
    3638
    3739        /**
    38          * All ways (Streets etc.) in the DataSet.
    39          *
    40          * The nodes of the way segments of this way must be objects from
    41          * the nodes list, however the way segments are stored only in the
    42          * way list.
     40         * All relations/relationships
    4341         */
    44         public Collection<Way> ways = new LinkedList<Way>();
     42        public Collection<Relation> relations = new LinkedList<Relation>();
    4543
    4644        /**
     
    5553         * selection does only change in the active layer)
    5654         */
    57         public static Collection<SelectionChangedListener> listeners = new LinkedList<SelectionChangedListener>();
     55        public static Collection<SelectionChangedListener> selListeners = new LinkedList<SelectionChangedListener>();
    5856
    5957        /**
    6058         * @return A collection containing all primitives of the dataset. The
    61          * data is ordered after: first comes nodes, then segments, then ways.
     59         * data is ordered after: first come nodes, then ways, then relations.
    6260         * Ordering in between the categories is not guaranteed.
    6361         */
     
    6563                List<OsmPrimitive> o = new LinkedList<OsmPrimitive>();
    6664                o.addAll(nodes);
    67                 o.addAll(segments);
    6865                o.addAll(ways);
     66                o.addAll(relations);
    6967                return o;
    7068        }
     
    8886        public void clearSelection() {
    8987                clearSelection(nodes);
    90                 clearSelection(segments);
    9188                clearSelection(ways);
     89                clearSelection(relations);
    9290                Collection<OsmPrimitive> sel = Collections.emptyList();
    9391                fireSelectionChanged(sel);
     
    10098        public Collection<OsmPrimitive> getSelected() {
    10199                Collection<OsmPrimitive> sel = getSelected(nodes);
    102                 sel.addAll(getSelected(segments));
    103100                sel.addAll(getSelected(ways));
     101                sel.addAll(getSelected(relations));
    104102                return sel;
    105103        }
     
    107105        public void setSelected(Collection<? extends OsmPrimitive> selection) {
    108106                clearSelection(nodes);
    109                 clearSelection(segments);
    110107                clearSelection(ways);
     108                clearSelection(relations);
    111109                for (OsmPrimitive osm : selection)
    112110                        osm.selected = true;
     
    120118                }
    121119                clearSelection(nodes);
    122                 clearSelection(segments);
    123120                clearSelection(ways);
     121                clearSelection(relations);
    124122                for (OsmPrimitive o : osm)
    125123                        if (o != null)
     
    158156         */
    159157        public static void fireSelectionChanged(Collection<? extends OsmPrimitive> sel) {
    160                 for (SelectionChangedListener l : listeners)
     158                for (SelectionChangedListener l : selListeners)
    161159                        l.selectionChanged(sel);
    162160        }
    163 
     161       
    164162        @Override public DataSet clone() {
    165163                DataSet ds = new DataSet();
    166164                for (Node n : nodes)
    167165                        ds.nodes.add(new Node(n));
    168                 for (Segment s : segments)
    169                         ds.segments.add(new Segment(s));
    170166                for (Way w : ways)
    171167                        ds.ways.add(new Way(w));
     168                for (Relation e : relations)
     169                        ds.relations.add(new Relation(e));
    172170                for (DataSource source : dataSources)
    173171                        ds.dataSources.add(new DataSource(source.bounds, source.origin));
Note: See TracChangeset for help on using the changeset viewer.