Ignore:
Timestamp:
11.07.2009 09:32:42 (3 years ago)
Author:
Gubaer
Message:

added: improved tag editor grid in relation editor (borrowed code from tag editor plugin)
removed: realEqual() on OsmPrimitive, Node, etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/corrector/ReverseWayTagCorrector.java

    r1706 r1762  
    4444        public String apply(String text) { 
    4545            Matcher m = startPattern.matcher(text); 
    46             if (!m.lookingAt()) 
     46            if (!m.lookingAt()) { 
    4747                m = endPattern.matcher(text); 
     48            } 
    4849 
    4950            if (m.lookingAt()) { 
     
    6263 
    6364    private static PrefixSuffixSwitcher[] prefixSuffixSwitchers = 
    64             new PrefixSuffixSwitcher[] { 
    65                 new PrefixSuffixSwitcher("left", "right"), 
    66                 new PrefixSuffixSwitcher("forward", "backward"), 
    67                 new PrefixSuffixSwitcher("forwards", "backwards") 
    68             }; 
     65        new PrefixSuffixSwitcher[] { 
     66        new PrefixSuffixSwitcher("left", "right"), 
     67        new PrefixSuffixSwitcher("forward", "backward"), 
     68        new PrefixSuffixSwitcher("forwards", "backwards") 
     69    }; 
    6970 
    7071    @Override 
    7172    public Collection<Command> execute(Way oldway, Way way) throws UserCancelException { 
    7273        Map<OsmPrimitive, List<TagCorrection>> tagCorrectionsMap = 
    73                 new HashMap<OsmPrimitive, List<TagCorrection>>(); 
     74            new HashMap<OsmPrimitive, List<TagCorrection>>(); 
    7475 
    7576        ArrayList<OsmPrimitive> primitives = new ArrayList<OsmPrimitive>(); 
     
    8687 
    8788                if (key.equals("oneway")) { 
    88                     if (value.equals("-1")) 
     89                    if (value.equals("-1")) { 
    8990                        newValue = OsmUtils.trueval; 
    90                     else { 
     91                    } else { 
    9192                        Boolean boolValue = OsmUtils.getOsmBoolean(value); 
    9293                        if (boolValue != null && boolValue.booleanValue()) { 
     
    9798                    for (PrefixSuffixSwitcher prefixSuffixSwitcher : prefixSuffixSwitchers) { 
    9899                        newKey = prefixSuffixSwitcher.apply(key); 
    99                         if (!key.equals(newKey)) 
     100                        if (!key.equals(newKey)) { 
    100101                            break; 
     102                        } 
    101103                    } 
    102104                } 
    103105 
    104                 if (!key.equals(newKey) || !value.equals(newValue)) 
     106                if (!key.equals(newKey) || !value.equals(newValue)) { 
    105107                    tagCorrectionsMap.get(primitive).add( 
    106108                            new TagCorrection(key, value, newKey, newValue)); 
     109                } 
    107110            } 
    108111        } 
    109112 
    110113        Map<OsmPrimitive, List<RoleCorrection>> roleCorrectionMap = 
    111                 new HashMap<OsmPrimitive, List<RoleCorrection>>(); 
     114            new HashMap<OsmPrimitive, List<RoleCorrection>>(); 
    112115        roleCorrectionMap.put(way, new ArrayList<RoleCorrection>()); 
    113116 
     
    115118            int position = 0; 
    116119            for (RelationMember member : relation.members) { 
    117                 if (!member.member.realEqual(oldway, true) 
     120                if (!member.member.hasEqualSemanticAttributes(oldway) 
    118121                        || member.role.length() == 0) { 
    119122                    position++; 
     
    131134                } 
    132135 
    133                 if (found) 
     136                if (found) { 
    134137                    roleCorrectionMap.get(way).add( 
    135138                            new RoleCorrection(relation, position, member, newRole)); 
     139                } 
    136140 
    137141                position++; 
Note: See TracChangeset for help on using the changeset viewer.