Ignore:
Timestamp:
2012-09-11T09:55:54+02:00 (14 years ago)
Author:
larry0ua
Message:

'RelToolbox: added warning messages to the warning icon hint'

File:
1 edited

Legend:

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

    r28693 r28703  
    11package relcontext.relationfix;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import org.openstreetmap.josm.command.ChangeCommand;
     
    1517
    1618        public BoundaryFixer() {
    17                 super(new String[]{"boundary", "multipolygon"});
     19                super("boundary", "multipolygon");
    1820        }
    19        
     21
    2022        /**
    21          * For boundary relations both "boundary" and "multipolygon" types are applicable, but 
     23         * For boundary relations both "boundary" and "multipolygon" types are applicable, but
    2224         * it should also have key boundary=administrative to be fully boundary.
    2325         * @see http://wiki.openstreetmap.org/wiki/Relation:boundary
     
    2729                return super.isFixerApplicable(rel) && "administrative".equals(rel.get("boundary"));
    2830        }
    29        
     31
    3032        @Override
    3133        public boolean isRelationGood(Relation rel) {
    3234                for( RelationMember m : rel.getMembers() ) {
    33             if (m.getType().equals(OsmPrimitiveType.RELATION) && !"subarea".equals(m.getRole()))
     35            if (m.getType().equals(OsmPrimitiveType.RELATION) && !"subarea".equals(m.getRole())) {
     36                setWarningMessage(tr("Relation without 'subarea' role found"));
    3437                return false;
    35             if (m.getType().equals(OsmPrimitiveType.NODE) && !("label".equals(m.getRole()) || "admin_centre".equals(m.getRole())))
     38            }
     39            if (m.getType().equals(OsmPrimitiveType.NODE) && !("label".equals(m.getRole()) || "admin_centre".equals(m.getRole()))) {
     40                setWarningMessage(tr("Node without 'label' or 'admin_centre' role found"));
    3641                return false;
    37             if (m.getType().equals(OsmPrimitiveType.WAY) && !("outer".equals(m.getRole()) || "inner".equals(m.getRole())))
     42            }
     43            if (m.getType().equals(OsmPrimitiveType.WAY) && !("outer".equals(m.getRole()) || "inner".equals(m.getRole()))) {
     44                setWarningMessage(tr("Way without 'inner' or 'outer' role found"));
    3845                                return false;
     46            }
    3947        }
     48                clearWarningMessage();
    4049                return true;
    4150        }
Note: See TracChangeset for help on using the changeset viewer.