- Timestamp:
- 2009-11-05T20:33:45+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r2381 r2392 114 114 return (styles != null) ? styles.getIcon(osm) : null; 115 115 116 117 118 119 120 116 if(osm.mappaintStyle == null && styles != null) { 117 osm.mappaintStyle = styles.getIcon(osm); 118 } 119 120 return (IconElemStyle)osm.mappaintStyle; 121 121 } 122 122 … … 158 158 159 159 if (nodeStyle != null && isZoomOk(nodeStyle) && showIcons > dist) { 160 drawNode(n, nodeStyle.icon, nodeStyle.annotate, data.isSelected(n)); 160 if (inactive || n.isDisabled()) { 161 drawNode(n, nodeStyle.getDisabledIcon(), nodeStyle.annotate, data.isSelected(n)); 162 } else { 163 drawNode(n, nodeStyle.icon, nodeStyle.annotate, data.isSelected(n)); 164 } 161 165 } else if (n.highlighted) { 162 166 drawNode(n, highlightColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode); … … 165 169 } else if (n.isTagged()) { 166 170 drawNode(n, nodeColor, taggedNodeSize, taggedNodeRadius, fillUnselectedNode); 167 } else if ( n.isDisabled()) {171 } else if (inactive || n.isDisabled()) { 168 172 drawNode(n, inactiveColor, unselectedNodeSize, unselectedNodeRadius, fillUnselectedNode); 169 173 } else { … … 1251 1255 if (name!=null && annotate) 1252 1256 { 1253 g.setColor(textColor); 1257 if (inactive || n.isDisabled()) { 1258 g.setColor(inactiveColor); 1259 } else { 1260 g.setColor(textColor); 1261 } 1254 1262 Font defaultFont = g.getFont(); 1255 1263 g.setFont (orderFont); … … 1371 1379 //profilerVisibleNodes++; 1372 1380 1373 g.setColor(color); 1381 if (inactive || n.isDisabled()) { 1382 g.setColor(inactiveColor); 1383 } else { 1384 g.setColor(color); 1385 } 1374 1386 if (fill) { 1375 1387 g.fillRect(p.x - radius, p.y - radius, size, size); … … 1384 1396 if (name!=null /* && annotate */) 1385 1397 { 1386 g.setColor(textColor); 1398 if (inactive || n.isDisabled()) { 1399 g.setColor(inactiveColor); 1400 } else { 1401 g.setColor(textColor); 1402 } 1387 1403 Font defaultFont = g.getFont(); 1388 1404 g.setFont (orderFont); -
trunk/src/org/openstreetmap/josm/gui/mappaint/IconElemStyle.java
r1747 r2392 1 1 package org.openstreetmap.josm.gui.mappaint; 2 3 import javax.swing.GrayFilter; 2 4 import javax.swing.ImageIcon; 3 5 … … 5 7 { 6 8 public ImageIcon icon; 9 private ImageIcon disabledIcon; 7 10 public boolean annotate; 8 11 … … 17 20 public IconElemStyle() { init(); } 18 21 19 public void init() 20 { 22 public void init() { 21 23 icon = null; 22 24 priority = 0; 23 25 annotate = true; 24 26 } 27 28 public ImageIcon getDisabledIcon() { 29 if (disabledIcon != null) 30 return disabledIcon; 31 if (icon == null) 32 return null; 33 return disabledIcon = new ImageIcon(GrayFilter.createDisabledImage(icon.getImage())); 34 } 25 35 }
Note:
See TracChangeset
for help on using the changeset viewer.