Ignore:
Timestamp:
29.09.2005 00:33:19 (7 years ago)
Author:
imi
Message:

Added selection

File:
1 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) {} 
Note: See TracChangeset for help on using the changeset viewer.