removeAll(); // listener is removed in Marker.removeNotify()
Map markerMap = new HashMap();
List notices = textArea.getParserNotices();
for (Iterator i=notices.iterator(); i.hasNext(); ) {
ParserNotice notice = (ParserNotice)i.next();
if (notice.getLevel()<=levelThreshold ||
(notice instanceof TaskNotice)) {
// 1.5: Use Integer.valueOf(notice.getLine())
Integer key = new Integer(notice.getLine());
Marker m = (Marker)markerMap.get(key);
if (m==null) {
m = new Marker(notice);
m.addMouseListener(listener);
markerMap.put(key, m);
add(m);
}
else {
m.addNotice(notice);
}
}
}
if (getShowMarkedOccurrences() && textArea.getMarkOccurrences()) {
List occurrences = textArea.getMarkedOccurrences();
for (Iterator i=occurrences.iterator(); i.hasNext(); ) {
DocumentRange range = (DocumentRange)i.next();
int line = 0;
try {
line = textArea.getLineOfOffset(range.getStartOffset());
} catch (BadLocationException ble) { // Never happens
continue;
}
ParserNotice notice = new MarkedOccurrenceNotice(range);
// 1.5: Use Integer.valueOf(notice.getLine())
Integer key = new Integer(line);
Marker m = (Marker)markerMap.get(key);
if (m==null) {
m = new Marker(notice);