Ignore:
Timestamp:
2016-06-24T09:10:57+02:00 (9 years ago)
Author:
donvip
Message:

checkstyle, update to JOSM 10279

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/reltoolbox/src/relcontext/ExtraNameFormatHook.java

    r30841 r32395  
     1// License: GPL. For details, see LICENSE file.
    12package relcontext;
    23
     
    89/**
    910 * Formatter hook for some tags that Dirk does not want to support.
    10  * 
     11 *
    1112 * @author Zverik
    1213 */
    1314public class ExtraNameFormatHook implements NameFormatterHook {
    1415
    15     public String checkRelationTypeName( IRelation relation, String defaultName ) {
    16     return null;
     16    @Override
     17    public String checkRelationTypeName(IRelation relation, String defaultName) {
     18        return null;
    1719    }
    1820
    19     public String checkFormat( INode node, String defaultName ) {
    20     return null;
     21    @Override
     22    public String checkFormat(INode node, String defaultName) {
     23        return null;
    2124    }
    2225
    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;
     26    @Override
     27    public String checkFormat(IWay way, String defaultName) {
     28        if (way.get("place") != null && way.get("name") == null && way.get("place_name") != null )
     29            return way.get("place_name") + " " + defaultName;
     30        return null;
    2731    }
    2832
    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         else
    39             return defaultName.replaceFirst("\".?+\"", '"'+name+'"');
     33    @Override
     34    public String checkFormat(IRelation relation, String defaultName) {
     35        String type = relation.get("type");
     36        if (type != null) {
     37            String name = relation.get("destination");
     38            if (type.equals("destination_sign") && name != null) {
     39                if (relation.get("distance") != null ) {
     40                    name += " " + relation.get("distance");
     41                }
     42                if (defaultName.indexOf('"') < 0 )
     43                    return '"' + name + "\" " + defaultName;
     44                else
     45                    return defaultName.replaceFirst("\".?+\"", '"'+name+'"');
     46            }
    4047        }
    41     }
    42     return null;
     48        return null;
    4349    }
    4450}
Note: See TracChangeset for help on using the changeset viewer.