Ignore:
Timestamp:
2013-07-17T00:01:07+02:00 (13 years ago)
Author:
stoecker
Message:

see #8853 remove tabs, trailing spaces, windows line ends, strange characters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r6050 r6069  
    7373    private Color mainColor;
    7474    private Stroke mainStroke;
    75    
     75
    7676    /**
    7777     * drawing settings for helper lines
     
    8888    private List<ReferenceSegment> possibleMoveDirections;
    8989
    90    
     90
    9191    /**
    9292     * Collection of nodes that is moved
     
    238238        if (e.getButton() != MouseEvent.BUTTON1)
    239239            return;
    240        
     240
    241241        requestFocusInMapView();
    242242        updateKeyModifiers(e);
    243        
     243
    244244        selectedNode = Main.map.mapView.getNearestNode(e.getPoint(), OsmPrimitive.isSelectablePredicate);
    245245        selectedSegment = Main.map.mapView.getNearestWaySegment(e.getPoint(), OsmPrimitive.isSelectablePredicate);
    246        
     246
    247247        // If nothing gets caught, stay in select mode
    248248        if (selectedSegment == null && selectedNode == null) return;
    249        
     249
    250250        if (selectedNode != null) {
    251251            if (ctrl || nodeDragWithoutCtrl) {
     
    253253                movingNodeList.add(selectedNode);
    254254                calculatePossibleDirectionsByNode();
    255                 if (possibleMoveDirections.isEmpty()) { 
     255                if (possibleMoveDirections.isEmpty()) {
    256256                    // if no directions fould, do not enter dragging mode
    257257                    return;
     
    278278            calculatePossibleDirectionsBySegment();
    279279        }
    280        
     280
    281281        // Signifies that nothing has happened yet
    282282        newN1en = null;
     
    386386        }
    387387    }
    388    
     388
    389389    /**
    390390     * Insert node into nearby segment
    391      * @param e - current mouse point 
     391     * @param e - current mouse point
    392392     */
    393393    private void addNewNode(MouseEvent e) {
     
    488488        Main.main.undoRedo.add(c);
    489489    }
    490    
     490
    491491    /**
    492492     * This method tests if a node has other ways apart from the given one.
     
    502502        return false;
    503503    }
    504    
     504
    505505    /**
    506506     * Determine best movenemnt from initialMousePos  to current position @param mouseEn,
    507507     * choosing one of the directions @field possibleMoveDirections
    508      * @return movement vector 
     508     * @return movement vector
    509509     */
    510510    private EastNorth calculateBestMovement(EastNorth mouseEn) {
    511        
     511
    512512        EastNorth initialMouseEn = Main.map.mapView.getEastNorth(initialMousePos.x, initialMousePos.y);
    513513        EastNorth mouseMovement = initialMouseEn.sub(mouseEn);
    514        
     514
    515515        double bestDistance = Double.POSITIVE_INFINITY;
    516516        EastNorth bestMovement = null;
     
    565565        initialN1en = selectedSegment.getFirstNode().getEastNorth();
    566566        initialN2en = selectedSegment.getSecondNode().getEastNorth();
    567            
     567
    568568        //add direction perpendicular to the selected segment
    569569        possibleMoveDirections = new ArrayList<ReferenceSegment>();
     
    573573                ), initialN1en, initialN2en, true));
    574574
    575        
     575
    576576        //add directions parallel to neighbor segments
    577577        Node prevNode = getPreviousNode(selectedSegment.lowerIndex);
     
    593593        }
    594594    }
    595    
     595
    596596    /**
    597597     * Gather possible move directions - along all adjacent segments
     
    609609                        initialN1en.getX() - en.getX(),
    610610                        initialN1en.getY() - en.getY()
    611                     ), initialN1en, en, false));                                   
     611                    ), initialN1en, en, false));
    612612                }
    613613            }
    614614        }
    615615    }
    616    
     616
    617617    /**
    618618     * Gets a node from selected way before given index.
     
    685685
    686686                EastNorth normalUnitVector = getNormalUniVector();
    687                
     687
    688688                if (mode == Mode.extrude || mode == Mode.create_new) {
    689689                    g2.setColor(mainColor);
     
    722722                    if (p1.distance(p2) < 3) {
    723723                        g2.setStroke(mainStroke);
    724                         g2.drawOval((int)(p1.x-symbolSize/2), (int)(p1.y-symbolSize/2), 
     724                        g2.drawOval((int)(p1.x-symbolSize/2), (int)(p1.y-symbolSize/2),
    725725                                (int)(symbolSize), (int)(symbolSize));
    726726                    } else {
     
    752752        }
    753753    }
    754    
     754
    755755    private EastNorth getNormalUniVector() {
    756756        double fac = 1.0 / activeMoveDirection.en.distance(0,0);
     
    770770        return normalUnitVector;
    771771    }
    772    
     772
    773773    private void drawAngleSymbol(Graphics2D g2, Point2D center, EastNorth normal, boolean mirror) {
    774774        // EastNorth units per pixel
     
    776776        double raoffsetx = symbolSize*factor*normal.getX();
    777777        double raoffsety = symbolSize*factor*normal.getY();
    778        
    779         double cx = center.getX(), cy = center.getY(); 
     778
     779        double cx = center.getX(), cy = center.getY();
    780780        double k = (mirror ? -1 : 1);
    781781        Point2D ra1 = new Point2D.Double(cx + raoffsetx, cy + raoffsety);
    782782        Point2D ra3 = new Point2D.Double(cx - raoffsety*k, cy + raoffsetx*k);
    783783        Point2D ra2 = new Point2D.Double(ra1.getX() - raoffsety*k, ra1.getY() + raoffsetx*k);
    784        
     784
    785785        GeneralPath ra = new GeneralPath();
    786786        ra.moveTo((float)ra1.getX(), (float)ra1.getY());
Note: See TracChangeset for help on using the changeset viewer.