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/ChosenRelationComponent.java

    r30841 r32395  
     1// License: GPL. For details, see LICENSE file.
    12package relcontext;
    23
     
    1819    public ChosenRelationComponent(ChosenRelation rel) {
    1920        super("");
    20 /*        setBackground(Color.white);
     21        /*        setBackground(Color.white);
    2122        setOpaque(true);
    2223        setBorder(new LineBorder(Color.black, 1, true));*/
     
    2526    }
    2627
    27     public void chosenRelationChanged( Relation oldRelation, Relation newRelation ) {
     28    @Override
     29    public void chosenRelationChanged(Relation oldRelation, Relation newRelation) {
    2830        setText(prepareText(newRelation));
    2931        repaint();
    3032    }
    31    
     33
    3234    private final static String[] TYPE_KEYS = new String[] {
    33         "natural", "landuse", "place", "waterway", "leisure", "amenity", "restriction", "public_transport", "route", "enforcement"
     35            "natural", "landuse", "place", "waterway", "leisure", "amenity", "restriction", "public_transport", "route", "enforcement"
    3436    };
    3537
    3638    private final static String[] NAMING_TAGS = new String[] {
    37         "name", "place_name", "ref", "destination", "note"
     39            "name", "place_name", "ref", "destination", "note"
    3840    };
    3941
    40     protected String prepareText( Relation rel ) {
    41         if( rel == null )
     42    protected String prepareText(Relation rel) {
     43        if (rel == null )
    4244            return "";
    4345
    4446        String type = rel.get("type");
    45         if( type == null || type.length() == 0 )
     47        if (type == null || type.length() == 0 ) {
    4648            type = "-";
     49        }
    4750
    4851        String tag = null;
    49         for( int i = 0; i < TYPE_KEYS.length && tag == null; i++ )
    50             if( rel.hasKey(TYPE_KEYS[i]))
     52        for (int i = 0; i < TYPE_KEYS.length && tag == null; i++ )
     53            if (rel.hasKey(TYPE_KEYS[i])) {
    5154                tag = TYPE_KEYS[i];
    52         if( tag != null )
     55            }
     56        if (tag != null ) {
    5357            tag = tag.substring(0, 2) + "=" + rel.get(tag);
     58        }
    5459
    5560        String name = null;
    56         for( int i = 0; i < NAMING_TAGS.length && name == null; i++ )
    57             if( rel.hasKey(NAMING_TAGS[i]) )
     61        for (int i = 0; i < NAMING_TAGS.length && name == null; i++ )
     62            if (rel.hasKey(NAMING_TAGS[i]) ) {
    5863                name = rel.get(NAMING_TAGS[i]);
     64            }
    5965
    6066        StringBuilder sb = new StringBuilder();
    6167        sb.append(type.substring(0, 1));
    62         if( type.equals("boundary") && rel.hasKey("admin_level") )
     68        if (type.equals("boundary") && rel.hasKey("admin_level") ) {
    6369            sb.append(rel.get("admin_level"));
    64         if( name != null )
     70        }
     71        if (name != null ) {
    6572            sb.append(" \"").append(name).append('"');
    66         if( tag != null )
     73        }
     74        if (tag != null ) {
    6775            sb.append("; ").append(tag);
     76        }
    6877        sb.append(" (").append(rel.getMembersCount()).append(')');
    6978
Note: See TracChangeset for help on using the changeset viewer.