diff --git a/src/org/openstreetmap/josm/data/gpx/WayPoint.java b/src/org/openstreetmap/josm/data/gpx/WayPoint.java
index 4dfa7fd..cc94d47 100644
|
a
|
b
|
public class WayPoint extends WithAttributes implements Comparable<WayPoint>, Te
|
| 24 | 24 | |
| 25 | 25 | public double time; |
| 26 | 26 | public Color customColoring; |
| | 27 | public Color customColoringTransparent; |
| 27 | 28 | public boolean drawLine; |
| 28 | 29 | public int dir; |
| 29 | 30 | |
| … |
… |
public class WayPoint extends WithAttributes implements Comparable<WayPoint>, Te
|
| 35 | 36 | north = p.north; |
| 36 | 37 | time = p.time; |
| 37 | 38 | customColoring = p.customColoring; |
| | 39 | customColoringTransparent = p.customColoringTransparent; |
| 38 | 40 | drawLine = p.drawLine; |
| 39 | 41 | dir = p.dir; |
| 40 | 42 | } |
diff --git a/src/org/openstreetmap/josm/gui/layer/GpxLayer.java b/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
index 5ccbcfd..45ee328 100644
|
a
|
b
|
public class GpxLayer extends Layer {
|
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | private final static Color[] colors = new Color[256]; |
| | 366 | /** Colors (with custom alpha channel, if given) for HDOP painting. */ |
| | 367 | private final static Color[] hdopColors; |
| 366 | 368 | static { |
| 367 | 369 | for (int i = 0; i < colors.length; i++) { |
| 368 | 370 | colors[i] = Color.getHSBColor(i / 300.0f, 1, 1); |
| 369 | 371 | } |
| | 372 | final int hdopAlpha = Main.pref.getInteger("hdop.color.alpha", -1); |
| | 373 | if (hdopAlpha >= 0) { |
| | 374 | hdopColors = new Color[256]; |
| | 375 | for (int i = 0; i < hdopColors.length; i++) { |
| | 376 | hdopColors[i] = new Color((colors[i].getRGB() & 0xFFFFFF) | ((hdopAlpha & 0xFF) << 24), true); |
| | 377 | } |
| | 378 | } else { |
| | 379 | hdopColors = colors; |
| | 380 | } |
| 370 | 381 | } |
| 371 | 382 | |
| 372 | 383 | private final static Color[] colors_cyclic = new Color[256]; |
| … |
… |
public class GpxLayer extends Layer {
|
| 563 | 574 | // Therefore inverse the logic |
| 564 | 575 | int hdopcolor = 255 - (hdoplvl > 255 ? 255 : hdoplvl); |
| 565 | 576 | trkPnt.customColoring = colors[hdopcolor]; |
| | 577 | trkPnt.customColoringTransparent = hdopColors[hdopcolor]; |
| 566 | 578 | } |
| 567 | 579 | if (oldWp != null) { |
| 568 | 580 | double dist = c.greatCircleDistance(oldWp.getCoor()); |
| … |
… |
public class GpxLayer extends Layer {
|
| 738 | 750 | continue; |
| 739 | 751 | } |
| 740 | 752 | Point screen = mv.getPoint(trkPnt.getEastNorth()); |
| 741 | | g.setColor(trkPnt.customColoring); |
| | 753 | g.setColor(trkPnt.customColoringTransparent); |
| 742 | 754 | if (hdopcircle && trkPnt.attr.get("hdop") != null) { |
| 743 | 755 | // hdop value |
| 744 | 756 | float hdop = ((Float)trkPnt.attr.get("hdop")).floatValue(); |