Changeset 4100 in josm for trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
- Timestamp:
- 2011-05-29T21:04:54+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r4070 r4100 17 17 import org.openstreetmap.josm.data.coor.CoordinateFormat; 18 18 import org.openstreetmap.josm.data.osm.Changeset; 19 import org.openstreetmap.josm.data.osm.INode; 20 import org.openstreetmap.josm.data.osm.IPrimitive; 21 import org.openstreetmap.josm.data.osm.IRelation; 22 import org.openstreetmap.josm.data.osm.IWay; 19 23 import org.openstreetmap.josm.data.osm.NameFormatter; 20 24 import org.openstreetmap.josm.data.osm.Node; … … 83 87 * @return the decorated name 84 88 */ 85 protected String decorateNameWithId(String name, OsmPrimitive primitive) {89 protected String decorateNameWithId(String name, IPrimitive primitive) { 86 90 if (Main.pref.getBoolean("osm-primitives.showid")) 87 91 if (Main.pref.getBoolean("osm-primitives.showid.new-primitives")) … … 99 103 * @return the name 100 104 */ 101 public String format(Node node) { 105 public String format(INode node) { 102 106 String name = ""; 103 107 if (node.isIncomplete()) { … … 157 161 * @return the name 158 162 */ 159 public String format(Way way) { 163 public String format(IWay way) { 160 164 String name = ""; 161 165 if (way.isIncomplete()) { … … 233 237 * @return the name 234 238 */ 235 public String format(Relation relation) { 239 public String format(IRelation relation) { 236 240 String name; 237 241 if (relation.isIncomplete()) { … … 250 254 name += trn("{0} member", "{0} members", mbno, mbno); 251 255 252 if (relationHasIncompleteMember(relation)) { 253 name += ", "+tr("incomplete"); 256 if (relation instanceof Relation) { 257 if (relationHasIncompleteMember((Relation) relation)) { 258 name += ", "+tr("incomplete"); 259 } 254 260 } 255 261 … … 325 331 } 326 332 327 private String getRelationTypeName(Relation relation) { 333 private String getRelationTypeName(IRelation relation) { 328 334 String name = trc("Relation type", relation.get("type")); 329 335 if (name == null) { … … 353 359 } 354 360 355 private String getNameTagValue(Relation relation, String nameTag) { 361 private String getNameTagValue(IRelation relation, String nameTag) { 356 362 if (nameTag.equals("name")) { 357 363 if (Main.pref.getBoolean("osm-primitives.localize-name", true)) … … 369 375 } 370 376 371 private String getRelationName(Relation relation) { 377 private String getRelationName(IRelation relation) { 372 378 String nameTag = null; 373 379 for (String n : getNamingtagsForRelations()) { … … 403 409 * @return the tooltip text 404 410 */ 405 public String buildDefaultToolTip( OsmPrimitive primitive) {411 public String buildDefaultToolTip(IPrimitive primitive) { 406 412 StringBuilder sb = new StringBuilder(); 407 413 sb.append("<html>");
Note:
See TracChangeset
for help on using the changeset viewer.
