Ignore:
Timestamp:
2016-06-25T11:56:57+02:00 (9 years ago)
Author:
donvip
Message:

checkstyle

File:
1 edited

Legend:

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

    r32395 r32398  
    1515public class ChosenRelationComponent extends JLabel implements ChosenRelationListener {
    1616
    17     //private ChosenRelation chRel;
    18 
    1917    public ChosenRelationComponent(ChosenRelation rel) {
    2018        super("");
    21         /*        setBackground(Color.white);
    22         setOpaque(true);
    23         setBorder(new LineBorder(Color.black, 1, true));*/
    24         //this.chRel = rel;
    2519        rel.addChosenRelationListener(this);
    2620    }
     
    3226    }
    3327
    34     private final static String[] TYPE_KEYS = new String[] {
     28    private static final String[] TYPE_KEYS = new String[] {
    3529            "natural", "landuse", "place", "waterway", "leisure", "amenity", "restriction", "public_transport", "route", "enforcement"
    3630    };
    3731
    38     private final static String[] NAMING_TAGS = new String[] {
     32    private static final String[] NAMING_TAGS = new String[] {
    3933            "name", "place_name", "ref", "destination", "note"
    4034    };
    4135
    4236    protected String prepareText(Relation rel) {
    43         if (rel == null )
     37        if (rel == null)
    4438            return "";
    4539
    4640        String type = rel.get("type");
    47         if (type == null || type.length() == 0 ) {
     41        if (type == null || type.length() == 0) {
    4842            type = "-";
    4943        }
    5044
    5145        String tag = null;
    52         for (int i = 0; i < TYPE_KEYS.length && tag == null; i++ )
     46        for (int i = 0; i < TYPE_KEYS.length && tag == null; i++) {
    5347            if (rel.hasKey(TYPE_KEYS[i])) {
    5448                tag = TYPE_KEYS[i];
    5549            }
    56         if (tag != null ) {
     50        }
     51        if (tag != null) {
    5752            tag = tag.substring(0, 2) + "=" + rel.get(tag);
    5853        }
    5954
    6055        String name = null;
    61         for (int i = 0; i < NAMING_TAGS.length && name == null; i++ )
    62             if (rel.hasKey(NAMING_TAGS[i]) ) {
     56        for (int i = 0; i < NAMING_TAGS.length && name == null; i++) {
     57            if (rel.hasKey(NAMING_TAGS[i])) {
    6358                name = rel.get(NAMING_TAGS[i]);
    6459            }
     60        }
    6561
    6662        StringBuilder sb = new StringBuilder();
    6763        sb.append(type.substring(0, 1));
    68         if (type.equals("boundary") && rel.hasKey("admin_level") ) {
     64        if (type.equals("boundary") && rel.hasKey("admin_level")) {
    6965            sb.append(rel.get("admin_level"));
    7066        }
    71         if (name != null ) {
     67        if (name != null) {
    7268            sb.append(" \"").append(name).append('"');
    7369        }
    74         if (tag != null ) {
     70        if (tag != null) {
    7571            sb.append("; ").append(tag);
    7672        }
Note: See TracChangeset for help on using the changeset viewer.