Changeset 1340 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2009-01-25T18:27:54+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1333 r1340 55 55 protected Color textColor; 56 56 protected int currentDashed = 0; 57 protected Color currentDashedColor; 57 58 protected int currentWidth = 0; 58 59 protected Stroke currentStroke = null; … … 247 248 int realWidth = 0; //the real width of the element in meters 248 249 int dashed = 0; 250 Color dashedColor = null; 249 251 Node lastN; 250 252 … … 255 257 realWidth = l.realWidth; 256 258 dashed = l.dashed; 259 dashedColor = l.dashedColor; 257 260 } 258 261 if(selected) … … 279 282 { 280 283 drawSeg(lastN, n, s.color != null && !w.selected ? s.color : color, 281 false, s.getWidth(width), s.dashed );284 false, s.getWidth(width), s.dashed, s.dashedColor); 282 285 } 283 286 lastN = n; … … 295 298 if(lastN != null) 296 299 drawSeg(lastN, n, color, 297 showOnlyHeadArrowOnly ? !it.hasNext() : showDirection, width, dashed );300 showOnlyHeadArrowOnly ? !it.hasNext() : showDirection, width, dashed, dashedColor); 298 301 lastN = n; 299 302 } … … 312 315 { 313 316 drawSeg(lastN, n, s.color != null && !w.selected ? s.color : color, 314 false, s.getWidth(width), s.dashed );317 false, s.getWidth(width), s.dashed, s.dashedColor); 315 318 } 316 319 lastN = n; … … 1084 1087 } 1085 1088 1086 private void drawSeg(Node n1, Node n2, Color col, boolean showDirection, int width, int dashed ) {1089 private void drawSeg(Node n1, Node n2, Color col, boolean showDirection, int width, int dashed, Color dashedColor) { 1087 1090 profilerSegments++; 1088 if (col != currentColor || width != currentWidth || dashed != currentDashed ) {1089 displaySegments(col, width, dashed );1091 if (col != currentColor || width != currentWidth || dashed != currentDashed || dashedColor != currentDashedColor) { 1092 displaySegments(col, width, dashed, dashedColor); 1090 1093 } 1091 1094 Point p1 = nc.getPoint(n1.eastNorth); … … 1108 1111 1109 1112 protected void displaySegments() { 1110 displaySegments(null, 0, 0 );1111 } 1112 1113 protected void displaySegments(Color newColor, int newWidth, int newDash ) {1113 displaySegments(null, 0, 0, null); 1114 } 1115 1116 protected void displaySegments(Color newColor, int newWidth, int newDash, Color newDashedColor) { 1114 1117 if (currentPath != null) { 1115 1118 Graphics2D g2d = (Graphics2D)g; … … 1122 1125 } 1123 1126 g2d.draw(currentPath); 1127 1128 if(currentDashedColor != null) { 1129 g2d.setColor(currentDashedColor); 1130 if (currentStroke == null && useStrokes > dist) { 1131 if (currentDashed != 0) 1132 g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,new float[] {currentDashed},currentDashed)); 1133 else 1134 g2d.setStroke(new BasicStroke(currentWidth,BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND)); 1135 } 1136 g2d.draw(currentPath); 1137 } 1138 1124 1139 if(useStrokes > dist) 1125 1140 g2d.setStroke(new BasicStroke(1)); … … 1129 1144 currentWidth = newWidth; 1130 1145 currentDashed = newDash; 1146 currentDashedColor = newDashedColor; 1131 1147 currentStroke = null; 1132 1148 }
Note:
See TracChangeset
for help on using the changeset viewer.