Ignore:
Timestamp:
2008-04-07T22:04:53+02:00 (18 years ago)
Author:
ramack
Message:
  • implement ticket #671: add option to draw only interesting direction arrows, where interesting means: they way is tagged with a key oneway, incline, incline_steep or aerialway
File:
1 edited

Legend:

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

    r529 r597  
    8383       
    8484        /**
     85         * true if this object has direction dependant tags (e.g. oneway)
     86         */
     87        public boolean hasDirectionKeys = false;
     88       
     89        /**
    8590         * If set to true, this object is currently selected.
    8691         */
     
    112117        public static Collection<String> uninteresting =
    113118                new HashSet<String>(Arrays.asList(new String[] {"source", "note", "created_by"}));
     119       
     120        /**
     121         * Contains a list of direction-dependent keys that do not make an object
     122         * direction dependent.
     123         */
     124        public static Collection<String> directionKeys =
     125                new HashSet<String>(Arrays.asList(new String[] {"oneway", "incline", "incline_steep", "aerialway"}));
    114126       
    115127        /**
     
    186198                }
    187199                checkTagged();
     200                checkDirectionTagged();
    188201        }
    189202        /**
     
    197210                }
    198211                checkTagged();
     212                checkDirectionTagged();
    199213        }
    200214
     
    266280                }
    267281        }
     282    /**
     283     * Updates the "hasDirectionKeys" flag. "keys" property should probably be made private
     284     * to make sure this gets called when keys are set.
     285     */
     286    public void checkDirectionTagged() {
     287        hasDirectionKeys = false;
     288        if (keys != null) {
     289            for (Entry<String,String> e : keys.entrySet()) {
     290                if (directionKeys.contains(e.getKey())) {
     291                    hasDirectionKeys = true;
     292                    break;
     293                }
     294            }
     295        }
     296
     297    }
    268298       
    269299}
Note: See TracChangeset for help on using the changeset viewer.