Changeset 3159 in josm for trunk


Ignore:
Timestamp:
2010-03-27T18:37:41+01:00 (10 years ago)
Author:
bastiK
Message:

fixed #2801 - Display junction nodes with a different style à la Potlatch

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

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

    r2932 r3159  
    196196        // Do nothing for now, but in future replace CachedLatLon with simple doubles and update precalculated EastNorth value here
    197197    }
     198
     199    public boolean isJunctionNode() {
     200        return (OsmPrimitive.getFilteredList(getReferrers(), Way.class)).size() > 1;
     201    }
    198202}
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java

    r3083 r3159  
    2222    private int showIconsDistance;
    2323    private int selectedNodeSize;
    24     private int taggedNodeSize;
     24    private int junctionNodeSize;
    2525    private int unselectedNodeSize;
    2626    private boolean fillSelectedNode;
    2727    private boolean fillUnselectedNode;
    28 
     28    private boolean fillTaggedNode;
    2929    private Color selectedColor;
    3030    private Color highlightColor;
     
    5757        selectedNodeSize = Main.pref.getInteger("mappaint.node.selected-size", 5);
    5858        unselectedNodeSize = Main.pref.getInteger("mappaint.node.unselected-size", 3);
    59         taggedNodeSize = Main.pref.getInteger("mappaint.node.tagged-size", 5);
     59        junctionNodeSize = Main.pref.getInteger("mappaint.node.junction-size", 5);
    6060        fillSelectedNode = Main.pref.getBoolean("mappaint.node.fill-selected", true);
    6161        fillUnselectedNode = Main.pref.getBoolean("mappaint.node.fill-unselected", false);
     62        fillTaggedNode = Main.pref.getBoolean("mappaint.node.fill-tagged", true);
    6263    }
    6364
     
    126127    }
    127128
    128     public int getTaggedNodeSize() {
    129         return taggedNodeSize;
     129    public int getJunctionNodeSize() {
     130        return junctionNodeSize;
    130131    }
    131132
     
    141142        return fillUnselectedNode;
    142143    }
     144
     145    public boolean isFillTaggedNode() {
     146        return fillTaggedNode;
     147    }
    143148}
  • trunk/src/org/openstreetmap/josm/gui/mappaint/SimpleNodeElemStyle.java

    r3116 r3159  
    2525        } else if (selected) {
    2626            painter.drawNode(n, settings.getSelectedColor(), settings.getSelectedNodeSize(), settings.isFillSelectedNode(), name);
    27         } else if (n.isTagged()) {
    28             painter.drawNode(n, settings.getNodeColor(), settings.getTaggedNodeSize(), settings.isFillUnselectedNode(), name);
    29         } else if (painter.isInactive() || n.isDisabled()) {
    30             painter.drawNode(n, settings.getInactiveColor(), settings.getUnselectedNodeSize(), settings.isFillUnselectedNode(), name);
    3127        } else {
    32             painter.drawNode(n, settings.getNodeColor(), settings.getUnselectedNodeSize(), settings.isFillUnselectedNode(), name);
     28            painter.drawNode(
     29                n,
     30                (painter.isInactive() || n.isDisabled()) ? settings.getInactiveColor() : settings.getNodeColor(),
     31                n.isJunctionNode() ? settings.getJunctionNodeSize() : settings.getUnselectedNodeSize(),
     32                n.isTagged() ? settings.isFillTaggedNode() : settings.isFillUnselectedNode(),
     33                name);
    3334        }
    3435    }
Note: See TracChangeset for help on using the changeset viewer.