diff --git a/src/org/openstreetmap/josm/data/validation/PaintVisitor.java b/src/org/openstreetmap/josm/data/validation/PaintVisitor.java
index 42c0b9b..795b6c1 100644
a
|
b
|
public class PaintVisitor extends AbstractVisitor implements ValidatorVisitor {
|
120 | 120 | |
121 | 121 | if (!paintedPoints.contains(pp)) { |
122 | 122 | Point p = mv.getPoint(n); |
123 | | g.setColor(color); |
124 | 123 | |
125 | 124 | if (selected) { |
| 125 | g.setColor(getHighlightColor()); |
126 | 126 | g.fillOval(p.x - 5, p.y - 5, 10, 10); |
127 | | } else { |
128 | | g.drawOval(p.x - 5, p.y - 5, 10, 10); |
129 | 127 | } |
| 128 | g.setColor(color); |
| 129 | g.drawOval(p.x - 5, p.y - 5, 10, 10); |
130 | 130 | paintedPoints.add(pp); |
131 | 131 | } |
132 | 132 | } |
… |
… |
public class PaintVisitor extends AbstractVisitor implements ValidatorVisitor {
|
139 | 139 | * @param color The color |
140 | 140 | */ |
141 | 141 | protected void drawSegment(Point p1, Point p2, Color color) { |
142 | | g.setColor(color); |
143 | 142 | |
144 | 143 | double t = Math.atan2(p2.x - p1.x, p2.y - p1.y); |
145 | 144 | double cosT = 5 * Math.cos(t); |
146 | 145 | double sinT = 5 * Math.sin(t); |
147 | 146 | int deg = (int) Math.toDegrees(t); |
148 | 147 | if (selected) { |
| 148 | g.setColor(getHighlightColor()); |
149 | 149 | int[] x = new int[] {(int) (p1.x + cosT), (int) (p2.x + cosT), |
150 | 150 | (int) (p2.x - cosT), (int) (p1.x - cosT)}; |
151 | 151 | int[] y = new int[] {(int) (p1.y - sinT), (int) (p2.y - sinT), |
… |
… |
public class PaintVisitor extends AbstractVisitor implements ValidatorVisitor {
|
153 | 153 | g.fillPolygon(x, y, 4); |
154 | 154 | g.fillArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180); |
155 | 155 | g.fillArc(p2.x - 5, p2.y - 5, 10, 10, deg, -180); |
156 | | } else { |
157 | | g.drawLine((int) (p1.x + cosT), (int) (p1.y - sinT), |
158 | | (int) (p2.x + cosT), (int) (p2.y - sinT)); |
159 | | g.drawLine((int) (p1.x - cosT), (int) (p1.y + sinT), |
160 | | (int) (p2.x - cosT), (int) (p2.y + sinT)); |
161 | | g.drawArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180); |
162 | | g.drawArc(p2.x - 5, p2.y - 5, 10, 10, deg, -180); |
163 | 156 | } |
| 157 | g.setColor(color); |
| 158 | g.drawLine((int) (p1.x + cosT), (int) (p1.y - sinT), |
| 159 | (int) (p2.x + cosT), (int) (p2.y - sinT)); |
| 160 | g.drawLine((int) (p1.x - cosT), (int) (p1.y + sinT), |
| 161 | (int) (p2.x - cosT), (int) (p2.y + sinT)); |
| 162 | g.drawArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180); |
| 163 | g.drawArc(p2.x - 5, p2.y - 5, 10, 10, deg, -180); |
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
… |
… |
public class PaintVisitor extends AbstractVisitor implements ValidatorVisitor {
|
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
| 261 | * Gets the color to draw highlight markers with. |
| 262 | * @return The color. |
| 263 | */ |
| 264 | private Color getHighlightColor() { |
| 265 | return new Color(color.getRed(), color.getGreen(), color.getBlue(), (int) (color.getAlpha() * .4)); |
| 266 | } |
| 267 | |
| 268 | /** |
261 | 269 | * Clears the internal painted objects collections. |
262 | 270 | */ |
263 | 271 | public void clearPaintedObjects() { |