Ignore:
Timestamp:
2009-11-05T20:33:45+01:00 (14 years ago)
Author:
bastiK
Message:

Objects on inactive osm-layers should be painted in a shade of gray.
(The same goes for filtered / deactivated primitives.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java

    r2381 r2392  
    114114            return (styles != null) ? styles.getIcon(osm) : null;
    115115
    116             if(osm.mappaintStyle == null && styles != null) {
    117                 osm.mappaintStyle = styles.getIcon(osm);
    118             }
    119 
    120             return (IconElemStyle)osm.mappaintStyle;
     116        if(osm.mappaintStyle == null && styles != null) {
     117            osm.mappaintStyle = styles.getIcon(osm);
     118        }
     119
     120        return (IconElemStyle)osm.mappaintStyle;
    121121    }
    122122
     
    158158
    159159        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            }
    161165        } else if (n.highlighted) {
    162166            drawNode(n, highlightColor, selectedNodeSize, selectedNodeRadius, fillSelectedNode);
     
    165169        } else if (n.isTagged()) {
    166170            drawNode(n, nodeColor, taggedNodeSize, taggedNodeRadius, fillUnselectedNode);
    167         } else if (n.isDisabled()) {
     171        } else if (inactive || n.isDisabled()) {
    168172            drawNode(n, inactiveColor, unselectedNodeSize, unselectedNodeRadius, fillUnselectedNode);
    169173        } else {
     
    12511255            if (name!=null && annotate)
    12521256            {
    1253                 g.setColor(textColor);
     1257                if (inactive || n.isDisabled()) {
     1258                    g.setColor(inactiveColor);
     1259                } else {
     1260                    g.setColor(textColor);
     1261                }
    12541262                Font defaultFont = g.getFont();
    12551263                g.setFont (orderFont);
     
    13711379            //profilerVisibleNodes++;
    13721380
    1373             g.setColor(color);
     1381            if (inactive || n.isDisabled()) {
     1382                g.setColor(inactiveColor);
     1383            } else {
     1384                g.setColor(color);
     1385            }
    13741386            if (fill) {
    13751387                g.fillRect(p.x - radius, p.y - radius, size, size);
     
    13841396                if (name!=null /* && annotate */)
    13851397                {
    1386                     g.setColor(textColor);
     1398                    if (inactive || n.isDisabled()) {
     1399                        g.setColor(inactiveColor);
     1400                    } else {
     1401                        g.setColor(textColor);
     1402                    }
    13871403                    Font defaultFont = g.getFont();
    13881404                    g.setFont (orderFont);
Note: See TracChangeset for help on using the changeset viewer.