Changeset 3879 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2011-02-09T19:13:04+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
r3871 r3879 211 211 } 212 212 213 public void drawNodeSymbol(Node n, Symbol s, boolean selected, boolean member, TextElement text) {213 public void drawNodeSymbol(Node n, Symbol s, Color fillColor, Color strokeColor, TextElement text) { 214 214 Point p = nc.getPoint(n); 215 215 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return; 216 216 int radius = s.size / 2; 217 217 218 if (s.fillColor != null) { 219 if (inactive || n.isDisabled()) { 220 g.setColor(inactiveColor); 221 } else { 222 g.setColor(s.fillColor); 223 } 218 if (fillColor != null) { 219 g.setColor(fillColor); 224 220 switch (s.symbol) { 225 221 case SQUARE: … … 235 231 if (s.stroke != null) { 236 232 g.setStroke(s.stroke); 237 if (inactive || n.isDisabled()) { 238 g.setColor(inactiveColor); 239 } else { 240 g.setColor(s.strokeColor); 241 } 233 g.setColor(strokeColor); 242 234 switch (s.symbol) { 243 235 case SQUARE: … … 353 345 } 354 346 355 public void drawArea(Way w, Color color, BufferedImage fillImage, String name) {347 public void drawArea(Way w, Color color, BufferedImage fillImage, float fillImageAlpha, String name) { 356 348 Polygon polygon = getPolygon(w); 357 drawArea(polygon, color, fillImage, name);358 } 359 360 protected void drawArea(Polygon polygon, Color color, BufferedImage fillImage, String name) {349 drawArea(polygon, color, fillImage, fillImageAlpha, name); 350 } 351 352 protected void drawArea(Polygon polygon, Color color, BufferedImage fillImage, float fillImageAlpha, String name) { 361 353 362 354 if (fillImage == null) { … … 367 359 new Rectangle(polygon.xpoints[0], polygon.ypoints[0], fillImage.getWidth(), fillImage.getHeight())); 368 360 g.setPaint(texture); 369 if ( color.getAlpha() != 255) {370 g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, Utils.color_int2float(color.getAlpha())));361 if (fillImageAlpha != 1f) { 362 g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, fillImageAlpha)); 371 363 } 372 364 g.fill(polygon); … … 411 403 } 412 404 413 public void drawArea(Relation r, Color color, BufferedImage fillImage, String name) {405 public void drawArea(Relation r, Color color, BufferedImage fillImage, float fillImageAlpha, String name) { 414 406 Multipolygon multipolygon = new Multipolygon(nc); 415 407 multipolygon.load(r); … … 420 412 continue; 421 413 } 422 drawArea(p, color, fillImage, getAreaName(r));414 drawArea(p, color, fillImage, fillImageAlpha, getAreaName(r)); 423 415 } 424 416 }
Note:
See TracChangeset
for help on using the changeset viewer.