Changeset 3862 in josm for trunk/src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2011-02-06T15:48:58+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java
r3858 r3862 81 81 82 82 outlineOnly = Main.pref.getBoolean("draw.data.area_outline_only", false); 83 83 84 84 } 85 85 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintVisitor.java
r3836 r3862 101 101 styles = MapPaintStyles.getStyles(); 102 102 103 this.paintSettings = MapPaintSettings.INSTANCE; 104 103 105 circum = nc.getDist100Pixel(); 104 boolean drawArea = circum <= Main.pref.getInteger("mappaint.fillareas", 10000000) ;106 boolean drawArea = circum <= Main.pref.getInteger("mappaint.fillareas", 10000000) && !paintSettings.isOutlineOnly(); 105 107 boolean drawMultipolygon = drawArea && Main.pref.getBoolean("mappaint.multipolygon", true); 106 108 styles.setDrawMultipolygon(drawMultipolygon); … … 112 114 RenderingHints.VALUE_ANTIALIAS_ON : RenderingHints.VALUE_ANTIALIAS_OFF); 113 115 114 this.paintSettings = MapPaintSettings.INSTANCE;115 116 this.painter = new MapPainter(paintSettings, g, inactive, nc, virtual, circum, leftHandTraffic); 116 117 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
r3860 r3862 11 11 import java.awt.Polygon; 12 12 import java.awt.Rectangle; 13 import java.awt.TexturePaint; 13 14 import java.awt.geom.GeneralPath; 14 15 import java.awt.geom.Rectangle2D; 16 import java.awt.image.BufferedImage; 15 17 import java.util.Arrays; 16 18 import java.util.Collection; … … 42 44 private final boolean showNames; 43 45 private final boolean showIcons; 44 private final boolean outlineOnly;45 46 46 47 private final Color inactiveColor; … … 78 79 this.showNames = settings.getShowNamesDistance() > circum; 79 80 this.showIcons = settings.getShowIconsDistance() > circum; 80 this.outlineOnly = settings.isOutlineOnly();81 81 82 82 this.inactiveColor = PaintColors.INACTIVE.get(); … … 258 258 } 259 259 260 public void drawArea(Way w, Color color, String name) {260 public void drawArea(Way w, Color color, BufferedImage fillImage, String name) { 261 261 Polygon polygon = getPolygon(w); 262 drawArea(polygon, color, name); 263 } 264 265 protected void drawArea(Polygon polygon, Color color, String name) { 266 267 g.setColor(color); 268 269 if (outlineOnly) { 270 g.drawPolygon(polygon); 262 drawArea(polygon, color, fillImage, name); 263 } 264 265 protected void drawArea(Polygon polygon, Color color, BufferedImage fillImage, String name) { 266 267 if (fillImage == null) { 268 g.setColor(color); 269 g.fillPolygon(polygon); 271 270 } else { 272 g.fillPolygon(polygon); 273 } 274 271 TexturePaint texture = new TexturePaint(fillImage, 272 new Rectangle(polygon.xpoints[0], polygon.ypoints[0], fillImage.getWidth(), fillImage.getHeight())); 273 274 g.setPaint(texture); 275 g.fill(polygon); 276 } 275 277 276 278 if (name != null) { … … 311 313 } 312 314 313 public void drawArea(Relation r, Color color, String name) {315 public void drawArea(Relation r, Color color, BufferedImage fillImage, String name) { 314 316 Multipolygon multipolygon = new Multipolygon(nc); 315 317 multipolygon.load(r); … … 320 322 continue; 321 323 } 322 drawArea(p, color, getAreaName(r));324 drawArea(p, color, fillImage, getAreaName(r)); 323 325 } 324 326 }
Note:
See TracChangeset
for help on using the changeset viewer.