- Timestamp:
- 2016-03-18T01:12:00+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java
r9371 r10009 121 121 if (!paintedPoints.contains(pp)) { 122 122 Point p = mv.getPoint(n); 123 124 if (selected) { 125 g.setColor(getHighlightColor()); 126 g.fillOval(p.x - 5, p.y - 5, 10, 10); 127 } 123 128 g.setColor(color); 124 125 if (selected) { 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 } 129 g.drawOval(p.x - 5, p.y - 5, 10, 10); 130 130 paintedPoints.add(pp); 131 131 } … … 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); … … 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)}; … … 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 … … 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 */
Note:
See TracChangeset
for help on using the changeset viewer.