Changeset 2803 in osm
- Timestamp:
- 2007-05-06T22:03:36+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/validator/src/org/openstreetmap/josm/plugins/validator/ErrorLayer.java
r2792 r2803 1 1 package org.openstreetmap.josm.plugins.validator; 2 2 3 import static org.openstreetmap.josm.tools.I18n.trn; 4 import static org.openstreetmap.josm.tools.I18n.tr; 3 5 import java.awt.Component; 4 6 import java.awt.Graphics; 5 import java.util. Enumeration;7 import java.util.*; 6 8 7 9 import javax.swing.*; … … 16 18 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; 17 19 import org.openstreetmap.josm.gui.layer.Layer; 20 import org.openstreetmap.josm.plugins.validator.util.Bag; 18 21 import org.openstreetmap.josm.tools.ImageProvider; 19 22 … … 78 81 public String getToolTipText() 79 82 { 80 return null; 83 Bag<Severity, TestError> errorTree = new Bag<Severity, TestError>(); 84 for(TestError e : OSMValidatorPlugin.getPlugin().errors) 85 { 86 errorTree.add(e.getSeverity(), e); 87 } 88 89 StringBuilder b = new StringBuilder(); 90 for(Severity s : Severity.values()) 91 { 92 if( errorTree.containsKey(s) ) 93 b.append(tr(s.toString())).append(": ").append(errorTree.get(s).size()).append("<br>"); 94 } 95 96 if( b.length() == 0 ) 97 return "<html>"+tr("No validation errors") + "</html>"; 98 else 99 return "<html>" + tr("Validation errors") + ":<br>" + b + "</html>"; 81 100 } 82 101 … … 91 110 @Override public Object getInfoComponent() 92 111 { 93 /* 94 StringBuilder b = new StringBuilder(); 95 int points = 0; 96 for (Collection<GpsPoint> c : data) { 97 b.append(" "+trn("a track with {0} point","a track with {0} points", c.size(), c.size())+"<br>"); 98 points += c.size(); 99 } 100 b.append("</html>"); 101 return "<html>"+trn("{0} consists of {1} track", "{0} consists of {1} tracks", data.size(), name, data.size())+" ("+trn("{0} point", "{0} points", points, points)+")<br>"+b.toString(); 102 */ 103 return "<html>Validation errors</html>"; // TODO 112 return getToolTipText(); 104 113 } 105 114
Note:
See TracChangeset
for help on using the changeset viewer.