Changeset 3879 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
- Timestamp:
- 2011-02-09T19:13:04+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
r3871 r3879 240 240 return null; 241 241 242 Float size = c.get("symbol-size", null, Float.class);243 if (size == null || size<= 0)242 float size = c.get("symbol-size", 10f, Float.class); 243 if (size <= 0) 244 244 return null; 245 245 246 246 Float strokeWidth = c.get("symbol-stroke-width", null, Float.class); 247 if (strokeWidth != null && strokeWidth <= 0) { 248 strokeWidth = null; 249 } 247 250 Color strokeColor = c.get("symbol-stroke-color", null, Color.class); 251 252 if (strokeWidth == null && strokeColor != null) { 253 strokeWidth = 1f; 254 } else if (strokeWidth != null && strokeColor == null) { 255 strokeColor = Color.ORANGE; 256 } 257 258 Stroke stroke = null; 248 259 if (strokeColor != null) { 249 260 float strokeAlpha = c.get("symbol-stroke-opacity", 1f, Float.class); 250 261 strokeColor = new Color(strokeColor.getRed(), strokeColor.getGreen(), 251 262 strokeColor.getBlue(), Utils.color_float2int(strokeAlpha)); 252 }253 Stroke stroke = null;254 if (strokeWidth != null && strokeWidth > 0 && strokeColor != null) {255 263 stroke = new BasicStroke(strokeWidth); 256 264 } 257 265 258 266 Color fillColor = c.get("symbol-fill-color", null, Color.class); 267 if (stroke == null && fillColor == null) 268 fillColor = Color.BLUE; 269 259 270 if (fillColor != null) { 260 271 float fillAlpha = c.get("symbol-fill-opacity", 1f, Float.class); … … 263 274 } 264 275 265 if ((stroke == null || strokeColor == null) && fillColor == null) 266 return null; 267 268 return new Symbol(shape, size.intValue(), stroke, strokeColor, fillColor); 276 return new Symbol(shape, Math.round(size), stroke, strokeColor, fillColor); 269 277 } 270 278 … … 277 285 Utils.color_int2float(iconAlpha), selected, member, text); 278 286 } else if (symbol != null) { 279 painter.drawNodeSymbol(n, symbol, selected, member, text); 287 Color fillColor = symbol.fillColor; 288 if (fillColor != null) { 289 if (n.isHighlighted()) { 290 fillColor = settings.getHighlightColor(); 291 } else { 292 if (painter.isInactive() || n.isDisabled()) { 293 fillColor = settings.getInactiveColor(); 294 } else if (selected) { 295 fillColor = settings.getSelectedColor(fillColor.getAlpha()); 296 } else if (member) { 297 fillColor = settings.getRelationSelectedColor(fillColor.getAlpha()); 298 } 299 } 300 } 301 Color strokeColor = symbol.strokeColor; 302 if (strokeColor != null) { 303 if (n.isHighlighted()) { 304 strokeColor = settings.getHighlightColor(); 305 } else { 306 if (painter.isInactive() || n.isDisabled()) { 307 strokeColor = settings.getInactiveColor(); 308 } else if (selected) { 309 strokeColor = settings.getSelectedColor(strokeColor.getAlpha()); 310 } else if (member) { 311 strokeColor = settings.getRelationSelectedColor(strokeColor.getAlpha()); 312 } 313 } 314 } 315 painter.drawNodeSymbol(n, symbol, fillColor, strokeColor, text); 280 316 } else { 281 317 if (n.isHighlighted()) {
Note:
See TracChangeset
for help on using the changeset viewer.