Ignore:
Timestamp:
2017-04-24T18:59:33+02:00 (7 years ago)
Author:
stoecker
Message:

fix display issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery-xml-bounds/src/net/boplicity/xmleditor/XmlView.java

    r30735 r33276  
    1818import java.awt.Color;
    1919import java.awt.Graphics;
     20import java.util.Collection;
    2021import java.util.LinkedHashMap;
    2122import java.util.Map;
     
    6364        patternColors.put(Pattern.compile(TAG_ATTRIBUTE_PATTERN), new Color(
    6465                127, 0, 127));
    65         patternColors.put(Pattern.compile(TAG_END_PATTERN), new Color(63, 127,
    66                 127));
    6766        patternColors.put(Pattern.compile(TAG_ATTRIBUTE_VALUE), new Color(42,
    6867                0, 255));
     
    104103            }
    105104        }
     105        /* Fix end tag duplication for CDATA and comments */
     106        Matcher matcher = Pattern.compile(TAG_END_PATTERN).matcher(text);
     107        Color c = new Color(63, 127, 127);
     108        Collection<Integer> ends = startMap.values();
     109
     110        while (matcher.find()) {
     111            if(!ends.contains(matcher.end())) {
     112                startMap.put(matcher.start(1), matcher.end());
     113                colorMap.put(matcher.start(1), c);
     114            }
     115        }
    106116
    107117        // TODO: check the map for overlapping parts
Note: See TracChangeset for help on using the changeset viewer.