Changeset 1340 in josm for trunk/src/org
- Timestamp:
- 2009-01-25T18:27:54+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 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 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
r1333 r1340 110 110 } 111 111 } 112 } else if(atts.getQName(count).equals("priority")) 112 } else if (atts.getQName(count).equals("dashedcolour")) 113 line.dashedColor=convertColor(atts.getValue(count)); 114 else if(atts.getQName(count).equals("priority")) 113 115 line.priority = Integer.parseInt(atts.getValue(count)); 114 116 else if(atts.getQName(count).equals("mode")) -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r1333 r1340 10 10 public Color color; 11 11 public int dashed; 12 public Color dashedColor; 12 13 13 14 public boolean over; … … 22 23 this.color = s.color; 23 24 this.dashed = s.dashed; 25 this.dashedColor = s.dashedColor; 24 26 this.over = s.over; 25 27 this.widthMode = s.widthMode; … … 35 37 this.color = s.color; 36 38 this.dashed = s.dashed; 39 this.dashedColor = s.dashedColor; 37 40 this.over = s.over; 38 41 this.widthMode = s.widthMode; … … 55 58 realWidth = 0; 56 59 dashed = 0; 60 dashedColor = null; 57 61 priority = 0; 58 62 color = null;
Note:
See TracChangeset
for help on using the changeset viewer.