Ignore:
Timestamp:
2009-01-17T23:45:34+01:00 (16 years ago)
Author:
stoecker
Message:

close #2028. patch by robome

Location:
trunk/src/org/openstreetmap/josm/data/osm/visitor
Files:
2 edited

Legend:

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

    r1282 r1289  
    1717import java.util.LinkedList;
    1818import java.util.Locale;
     19import java.util.Iterator;
    1920
    2021import javax.swing.ImageIcon;
     
    225226        boolean showDirection = w.selected || ((!useRealWidth) && (showDirectionArrow
    226227        && (!showRelevantDirectionsOnly || w.hasDirectionKeys)));
     228        // head only takes over control if the option is true,
     229        // the direction should be shown at all and not only because it's selected
     230        boolean showOnlyHeadArrowOnly = showDirection && !w.selected && showHeadArrowOnly;
    227231        int width = defaultSegmentWidth;
    228232        int realWidth = 0; //the real width of the element in meters
     
    270274        // draw the way
    271275        lastN = null;
    272         for(Node n : w.nodes)
    273         {
     276        Iterator<Node> it = w.nodes.iterator();
     277        while (it.hasNext())
     278        {
     279            Node n = it.next();
    274280            if(lastN != null)
    275                 drawSeg(lastN, n, color, showDirection, width, dashed);
     281                drawSeg(lastN, n, color,
     282                    showOnlyHeadArrowOnly ? !it.hasNext() : showDirection, width, dashed);
    276283            lastN = n;
    277284        }
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java

    r1251 r1289  
    6464    protected boolean showDirectionArrow;
    6565    protected boolean showRelevantDirectionsOnly;
     66    protected boolean showHeadArrowOnly;
    6667    protected boolean showOrderNumber;
    6768    protected boolean fillSelectedNode;
     
    101102        showDirectionArrow = Main.pref.getBoolean("draw.segment.direction", true);
    102103        showRelevantDirectionsOnly = Main.pref.getBoolean("draw.segment.relevant_directions_only", true);
     104        showHeadArrowOnly = Main.pref.getBoolean("draw.segment.head_only", false);
    103105        showOrderNumber = Main.pref.getBoolean("draw.segment.order_number", false);
    104106        selectedNodeRadius = Main.pref.getInteger("mappaint.node.selected-size", 5) / 2;
     
    292294        boolean showThisDirectionArrow = w.selected
    293295        || (showDirectionArrow && (!showRelevantDirectionsOnly || w.hasDirectionKeys));
     296        // head only takes over control if the option is true,
     297        // the direction should be shown at all and not only because it's selected
     298        boolean showOnlyHeadArrowOnly = showThisDirectionArrow && !w.selected && showHeadArrowOnly;
    294299        Color wayColor;
    295300
     
    307312            for (int orderNumber = 1; it.hasNext(); orderNumber++) {
    308313                Point p = nc.getPoint(it.next().eastNorth);
    309                 drawSegment(lastP, p, w.selected && !inactive ? selectedColor : wayColor, showThisDirectionArrow);
     314                drawSegment(lastP, p, w.selected && !inactive ? selectedColor : wayColor,
     315                    showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow);
    310316                if (showOrderNumber)
    311317                    drawOrderNumber(lastP, p, orderNumber);
Note: See TracChangeset for help on using the changeset viewer.