Changeset 2 in josm for src/org/openstreetmap/josm/data


Ignore:
Timestamp:
2005-09-29T00:33:19+02:00 (15 years ago)
Author:
imi
Message:

Added selection

Location:
src/org/openstreetmap/josm/data/osm
Files:
2 edited

Legend:

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

    r1 r2  
    11package org.openstreetmap.josm.data.osm;
    22
     3import java.util.Collection;
    34import java.util.List;
    45
     
    1617 */
    1718public class DataSet implements Cloneable {
    18 
    19         /**
    20          * human readable name of the data.
    21          */
    22         public String name;
    23 
    24         /**
    25          * human readable description of what the data is about. Space for comments.
    26          */
    27         public String desc;
    28 
    29         /**
    30          * Who recorded/created it.
    31          */
    32         public String author;
    3319
    3420        /**
     
    10995        }
    11096
     97        /**
     98         * Remove the selection of the whole dataset.
     99         */
     100        public void clearSelection() {
     101                clearSelection(allNodes);
     102                clearSelection(tracks);
     103                for (Track t : tracks)
     104                        clearSelection(t.segments);
     105        }
     106       
     107        /**
     108         * Remove the selection from every value in the collection.
     109         * @param list The collection to remove the selection from.
     110         */
     111        private void clearSelection(Collection<? extends OsmPrimitive> list) {
     112                if (list == null)
     113                        return;
     114                for (OsmPrimitive osm : list) {
     115                        osm.selected = false;
     116                        if (osm.keys != null)
     117                                clearSelection(osm.keys.keySet());
     118                }
     119        }
     120       
    111121        public DataSet clone() {
    112122                try {return (DataSet)super.clone();} catch (CloneNotSupportedException e) {}
  • src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r1 r2  
    1616         */
    1717        public Map<Key, String> keys;
     18       
     19        /**
     20         * If set to true, this object has been modified in the current session.
     21         */
     22        public boolean modified = false;
     23       
     24        /**
     25         * If set to true, this object is currently selected.
     26         */
     27        public boolean selected = false;
    1828}
Note: See TracChangeset for help on using the changeset viewer.