- Timestamp:
- 2020-03-09T00:35:05+01:00 (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/RenderingHelper.java
r15731 r16100 11 11 import java.awt.image.BufferedImage; 12 12 import java.io.IOException; 13 import java.io.PrintStream; 13 14 import java.util.Collection; 14 15 import java.util.HashMap; … … 19 20 import org.openstreetmap.josm.data.ProjectionBounds; 20 21 import org.openstreetmap.josm.data.osm.DataSet; 22 import org.openstreetmap.josm.data.osm.OsmPrimitive; 21 23 import org.openstreetmap.josm.data.osm.visitor.paint.StyledMapRenderer; 22 24 import org.openstreetmap.josm.data.projection.Projection; … … 24 26 import org.openstreetmap.josm.gui.NavigatableComponent; 25 27 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 28 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement; 26 29 import org.openstreetmap.josm.io.IllegalDataException; 27 30 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 41 44 private Color backgroundColor; 42 45 private boolean fillBackground = true; 46 private PrintStream debugStream; 43 47 44 48 /** … … 183 187 smr.setStyles(elemStyles); 184 188 smr.render(ds, false, bounds); 189 190 // For debugging, write computed StyleElement to debugStream for primitives marked with debug=yes 191 if (debugStream != null) { 192 for (OsmPrimitive primitive : ds.allPrimitives()) { 193 if (!primitive.isKeyTrue("debug")) { 194 continue; 195 } 196 debugStream.println(primitive); 197 for (StyleElement styleElement : elemStyles.get(primitive, scale, nc)) { 198 debugStream.append(" * ").println(styleElement); 199 } 200 } 201 } 202 185 203 return image; 186 204 } 187 205 206 void setDebugStream(PrintStream debugStream) { 207 this.debugStream = debugStream; 208 } 188 209 } -
trunk/test/data/renderer/node-text2/data.osm
r12978 r16100 5 5 <tag k='name' v='Hgmpf' /> 6 6 <tag k='test' v='text-placement' /> 7 <tag k='debug' v='yes' /> 7 8 </node> 8 9 </osm> -
trunk/test/data/renderer/way-text/data.osm
r12476 r16100 44 44 <tag k='name' v='An der Actien-Zuckerfabrik' /> 45 45 <tag k='test' v='w1' /> 46 <tag k='debug' v='yes' /> 46 47 </way> 47 48 <way id='-41280' action='modify'> -
trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
r16094 r16100 192 192 RenderingHelper rh = new RenderingHelper(dataSet, testConfig.getTestArea(), scale, Collections.singleton(sd)); 193 193 rh.setFillBackground(false); 194 rh.setDebugStream(System.out); 195 System.out.println("Running " + getClass() + "[" + testConfig.testDirectory + "]"); 194 196 BufferedImage image = rh.render(); 195 197
Note:
See TracChangeset
for help on using the changeset viewer.