Changeset 30738 in osm for applications/editors/josm/plugins/reltoolbox/src/relcontext/ExtraNameFormatHook.java
- Timestamp:
- 2014-10-19T01:27:04+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/reltoolbox/src/relcontext/ExtraNameFormatHook.java
r26802 r30738 14 14 15 15 public String checkRelationTypeName( IRelation relation, String defaultName ) { 16 return null;16 return null; 17 17 } 18 18 19 19 public String checkFormat( INode node, String defaultName ) { 20 return null;20 return null; 21 21 } 22 22 23 23 public String checkFormat( IWay way, String defaultName ) { 24 if( way.get("place") != null && way.get("name") == null && way.get("place_name") != null )25 return way.get("place_name") + " " + defaultName;26 return null;24 if( way.get("place") != null && way.get("name") == null && way.get("place_name") != null ) 25 return way.get("place_name") + " " + defaultName; 26 return null; 27 27 } 28 28 29 29 public String checkFormat( IRelation relation, String defaultName ) { 30 String type = relation.get("type");31 if( type != null ) {32 String name = relation.get("destination");33 if( type.equals("destination_sign") && name != null ) {34 if( relation.get("distance") != null )35 name += " " + relation.get("distance");36 if( defaultName.indexOf('"') < 0 )37 return '"' + name + "\" " + defaultName;38 else39 return defaultName.replaceFirst("\".?+\"", '"'+name+'"');40 }41 }42 return null;30 String type = relation.get("type"); 31 if( type != null ) { 32 String name = relation.get("destination"); 33 if( type.equals("destination_sign") && name != null ) { 34 if( relation.get("distance") != null ) 35 name += " " + relation.get("distance"); 36 if( defaultName.indexOf('"') < 0 ) 37 return '"' + name + "\" " + defaultName; 38 else 39 return defaultName.replaceFirst("\".?+\"", '"'+name+'"'); 40 } 41 } 42 return null; 43 43 } 44 44 }
Note:
See TracChangeset
for help on using the changeset viewer.
