Changeset 808 in josm


Ignore:
Timestamp:
Aug 18, 2008 11:09:36 PM (5 years ago)
Author:
stoecker
Message:

fixed virtual nodes a bit

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

Legend:

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

    r807 r808  
    334334 
    335335        synchronized public int getInteger(String key, int def) { 
     336                putDefault(key, Integer.toString(def)); 
    336337                String v = get(key); 
    337338                if(null == v) 
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java

    r805 r808  
    156156                                { 
    157157                                        // hack to make direction arrows visible against filled background 
    158                                         if (showDirection) 
    159                                                 drawSeg(lastN, n, w.selected ? selectedColor : untaggedColor, showDirection, width, true); 
     158                                        if (showDirection || virtualNodeSize != 0) 
     159                                                drawSeg(lastN, n, w.selected ? selectedColor : untaggedColor, showDirection, width, false, false); 
    160160                                } 
    161161                                else 
    162                                         drawSeg(lastN, n, w.selected ? selectedColor : colour, showDirection, width, true); 
     162                                        drawSeg(lastN, n, w.selected ? selectedColor : colour, showDirection, width, true, true); 
    163163                        } else { 
    164164                                if (realWidth > 0 && useRealWidth && !showDirection) { 
     
    166166                                        if (tmpWidth > width) width = tmpWidth; 
    167167                                } 
    168                                 drawSeg(lastN, n, w.selected ? selectedColor : colour, showDirection, width, dashed); 
     168                                drawSeg(lastN, n, w.selected ? selectedColor : colour, showDirection, width, dashed, true); 
    169169                        } 
    170170 
     
    227227        protected void drawSegment(Node n1, Node n2, Color col, boolean showDirection) { 
    228228                if (useRealWidth && showDirection) showDirection = false; 
    229                 drawSeg(n1, n2, col, showDirection, 1, false); 
    230         } 
    231  
    232         private void drawSeg(Node n1, Node n2, Color col, boolean showDirection, int width, boolean dashed) { 
     229                drawSeg(n1, n2, col, showDirection, 1, false, true); 
     230        } 
     231 
     232        private void drawSeg(Node n1, Node n2, Color col, boolean showDirection, int width, boolean dashed, boolean drawway) { 
    233233                if (col != currentColor || width != currentWidth || dashed != currentDashed) { 
    234234                        displaySegments(col, width, dashed); 
     
    241241                } 
    242242                drawVirtualNode(p1, p2, col); 
    243                 currentPath.moveTo(p1.x, p1.y); 
    244                 currentPath.lineTo(p2.x, p2.y); 
     243                if(drawway) 
     244                { 
     245                        currentPath.moveTo(p1.x, p1.y); 
     246                        currentPath.lineTo(p2.x, p2.y); 
     247                } 
    245248 
    246249                if (showDirection) { 
    247250                        double t = Math.atan2(p2.y-p1.y, p2.x-p1.x) + Math.PI; 
     251                        if(!drawway) 
     252                                currentPath.moveTo(p2.x, p2.y); 
    248253                        currentPath.lineTo((int)(p2.x + 10*Math.cos(t-PHI)), (int)(p2.y + 10*Math.sin(t-PHI))); 
    249254                        currentPath.moveTo((int)(p2.x + 10*Math.cos(t+PHI)), (int)(p2.y + 10*Math.sin(t+PHI))); 
     
    321326                        osm.visit(this); 
    322327 
     328                for (final OsmPrimitive osm : data.getSelected()) 
     329                        if (!osm.incomplete && !osm.deleted){ 
     330                                osm.visit(this); 
     331                        } 
     332 
    323333                for (final OsmPrimitive osm : data.nodes) 
    324334                        if (!osm.incomplete && !osm.deleted) 
    325335                                osm.visit(this); 
    326  
    327                 for (final OsmPrimitive osm : data.getSelected()) 
    328                         if (!osm.incomplete && !osm.deleted){ 
    329                                 osm.visit(this); 
    330                         } 
    331336                displaySegments(); 
    332337        } 
Note: See TracChangeset for help on using the changeset viewer.