Changeset 2686 in josm for trunk/src/org/openstreetmap/josm/data/osm/history
- Timestamp:
- 2009-12-28T00:14:33+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/history
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryNode.java
r2512 r2686 34 34 this.coords = coords; 35 35 } 36 37 @Override 38 public String getDisplayName(HistoryNameFormatter formatter) { 39 return formatter.format(this); 40 } 36 41 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryOsmPrimitive.java
r2626 r2686 7 7 import java.util.Date; 8 8 import java.util.HashMap; 9 import java.util.Locale; 9 10 import java.util.Map; 10 11 … … 146 147 } 147 148 149 /** 150 * Replies the name of this primitive. The default implementation replies the value 151 * of the tag <tt>name</tt> or null, if this tag is not present. 152 * 153 * @return the name of this primitive 154 */ 155 public String getName() { 156 if (get("name") != null) 157 return get("name"); 158 return null; 159 } 160 161 /** 162 * Replies the display name of a primitive formatted by <code>formatter</code> 163 * 164 * @return the display name 165 */ 166 public abstract String getDisplayName(HistoryNameFormatter formatter); 167 168 /** 169 * Replies the a localized name for this primitive given by the value of the tags (in this order) 170 * <ul> 171 * <li>name:lang_COUNTRY_Variant of the current locale</li> 172 * <li>name:lang_COUNTRY of the current locale</li> 173 * <li>name:lang of the current locale</li> 174 * <li>name of the current locale</li> 175 * </ul> 176 * 177 * null, if no such tag exists 178 * 179 * @return the name of this primitive 180 */ 181 public String getLocalName() { 182 String key = "name:" + Locale.getDefault().toString(); 183 if (get(key) != null) 184 return get(key); 185 key = "name:" + Locale.getDefault().getLanguage() + "_" + Locale.getDefault().getCountry(); 186 if (get(key) != null) 187 return get(key); 188 key = "name:" + Locale.getDefault().getLanguage(); 189 if (get(key) != null) 190 return get(key); 191 return getName(); 192 } 193 194 195 148 196 @Override 149 197 public int hashCode() { -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryRelation.java
r2512 r2686 111 111 members.add(member); 112 112 } 113 114 @Override 115 public String getDisplayName(HistoryNameFormatter formatter) { 116 return formatter.format(this); 117 } 113 118 } -
trunk/src/org/openstreetmap/josm/data/osm/history/HistoryWay.java
r2512 r2686 77 77 nodeIds.add(ref); 78 78 } 79 80 /** 81 * Replies true if this way is closed. 82 * 83 * @return true if this way is closed. 84 */ 85 public boolean isClosed() { 86 return getNumNodes() >= 3 && nodeIds.get(0) == nodeIds.get(nodeIds.size()-1); 87 } 88 89 @Override 90 public String getDisplayName(HistoryNameFormatter formatter) { 91 return formatter.format(this); 92 } 79 93 }
Note:
See TracChangeset
for help on using the changeset viewer.