Ignore:
Timestamp:
2015-06-03T13:24:59+02:00 (5 years ago)
Author:
Don-vip
Message:

javadoc / Unit test fixes

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
8 edited

Legend:

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

    r8443 r8459  
    3838 * Case 4.1: Only nodes selected, part of a non-closed way: align these nodes on the line passing through the
    3939 *   extremity nodes (most distant in the way sequence). See https://josm.openstreetmap.de/ticket/9605#comment:3
    40  * Case 4.2: Only nodes selected, part of a closed way: align these nodes on the line passing through the most distant
    41  *   nodes.
    42  * Case 4.3: Only nodes selected, part of multiple ways: align these nodes on the line passing through the most distant
    43  *   nodes.
     40 * Case 4.2: Only nodes selected, part of a closed way: align these nodes on the line passing through the most distant nodes.
     41 * Case 4.3: Only nodes selected, part of multiple ways: align these nodes on the line passing through the most distant nodes.
    4442 * </pre>
    4543 *
     
    8583     */
    8684    private Node[] nodePairFurthestApart(List<Node> nodes) {
    87         Node nodea = null;
    88         Node nodeb = null;
    89 
    9085        // Detect if selected nodes are on the same way.
    9186
     
    111106            return nodeFurthestAppart(nodes);
    112107        }
     108
     109        Node nodea = null;
     110        Node nodeb = null;
    113111
    114112        // The way is open, align nodes on the line passing through the extremity nodes (most distant in the way
     
    231229     * @param ways Collection of way to align
    232230     * @return Command that perform action
    233      * @throws InvalidSelection
     231     * @throws InvalidSelection if a polygon is selected, or if a node is used by 3 or more ways
    234232     */
    235233    private Command alignMultiWay(Collection<Way> ways) throws InvalidSelection {
     
    268266     * @param refWays Ways where useful lines will be searched
    269267     * @return List of useful lines
    270      * @throws InvalidSelection
     268     * @throws InvalidSelection if a node got more than 4 neighbours (self-crossing way)
    271269     */
    272270    private List<Line> getInvolvedLines(Node node, List<Way> refWays) throws InvalidSelection {
     
    314312                }
    315313            } else
    316                 throw new InvalidSelection();
     314                throw new InvalidSelection("cannot treat more than 4 neighbours, got "+neighbors.size());
    317315        }
    318316        return lines;
     
    324322     * @param lines Lines to align node on
    325323     * @return Command that perform action
    326      * @throws InvalidSelection
     324     * @throws InvalidSelection if more than 2 lines
    327325     */
    328326    private Command alignSingleNode(Node node, List<Line> lines) throws InvalidSelection {
     
    351349        /**
    352350         * Init a line by 2 nodes.
    353          * @param first On point of the line
     351         * @param first One point of the line
    354352         * @param last Other point of the line
    355          * @throws InvalidSelection
     353         * @throws InvalidSelection if nodes have same coordinates
    356354         */
    357355        public Line(Node first, Node last) throws InvalidSelection {
     
    364362            double norm = Math.sqrt(a*a + b*b);
    365363            if (norm == 0)
    366                 // Nodes have same coordinates !
    367                 throw new InvalidSelection();
     364                throw new InvalidSelection("Nodes have same coordinates!");
    368365            a /= norm;
    369366            b /= norm;
     
    374371         * Init a line equation from a way.
    375372         * @param way Use extremity of this way to compute line equation
    376          * @throws InvalidSelection
     373         * @throws InvalidSelection if nodes have same coordinates
    377374         */
    378375        public Line(Way way) throws InvalidSelection {
     
    395392         * @param other Second line for intersection
    396393         * @return The command that move the node
    397          * @throws InvalidSelection
     394         * @throws InvalidSelection if two parallels ways found
    398395         */
    399396        public Command intersectionCommand(Node n, Line other) throws InvalidSelection {
  • trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java

    r8443 r8459  
    9696     * Combine multiple ways into one.
    9797     * @param ways the way to combine to one way
    98      * @return null if ways cannot be combined. Otherwise returns the combined
    99      *              ways and the commands to combine
    100      * @throws UserCancelException
     98     * @return null if ways cannot be combined. Otherwise returns the combined ways and the commands to combine
     99     * @throws UserCancelException if the user cancelled a dialog.
    101100     */
    102101    public static Pair<Way, Command> combineWaysWorker(Collection<Way> ways) throws UserCancelException {
     
    111110        ways = new LinkedHashSet<>(ways);
    112111
    113         // try to build a new way which includes all the combined
    114         // ways
     112        // try to build a new way which includes all the combined ways
    115113        //
    116114        NodeGraph graph = NodeGraph.createNearlyUndirectedGraphFromNodeWays(ways);
     
    641639            // graph built up from way segments is likely to include such
    642640            // nodes, unless all ways are closed.
    643             // In the worst case this loops over all nodes which is
    644             // very slow for large ways.
     641            // In the worst case this loops over all nodes which is very slow for large ways.
    645642            //
    646643            Set<Node> nodes = getTerminalNodes();
  • trunk/src/org/openstreetmap/josm/actions/JoinAreasAction.java

    r8449 r8459  
    10021002     * Collects outer way and corresponding inner ways from all boundaries.
    10031003     * @param level depth level
    1004      * @param boundaryWays
    1005      * @return the outermostWay.
     1004     * @param boundaryWays list of joined boundaries to search in
     1005     * @return the outermost Way.
    10061006     */
    10071007    private List<PolygonLevel> findOuterWaysImpl(int level, Collection<AssembledPolygon> boundaryWays) {
  • trunk/src/org/openstreetmap/josm/actions/OpenLocationAction.java

    r8308 r8459  
    8080     * Restore the current history from the preferences
    8181     *
    82      * @param cbHistory
     82     * @param cbHistory the history combo box
    8383     */
    8484    protected void restoreUploadAddressHistory(HistoryComboBox cbHistory) {
     
    9393    /**
    9494     * Remind the current history in the preferences
    95      * @param cbHistory
     95     * @param cbHistory the history combo box
    9696     */
    9797    protected void remindUploadAddressHistory(HistoryComboBox cbHistory) {
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r8443 r8459  
    419419         * heading of the entire way.
    420420         * @param pInitialDirection initial direction
    421          * @throws InvalidUserInputException
     421         * @throws InvalidUserInputException if selected ways have an angle different from 90 or 180 degrees
    422422         */
    423423        public void calcDirections(Direction pInitialDirection) throws InvalidUserInputException {
  • trunk/src/org/openstreetmap/josm/actions/RestartAction.java

    r8390 r8459  
    7575    /**
    7676     * Restarts the current Java application
    77      * @throws IOException
     77     * @throws IOException in case of any error
    7878     */
    7979    public static void restartJOSM() throws IOException {
  • trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java

    r8443 r8459  
    166166     *
    167167     * @param w the way to simplify
     168     * @param threshold the max error threshold
    168169     * @return The sequence of commands to run
    169170     * @since 6411
     
    187188            }
    188189            // ... and simplify them
    189             buildSimplifiedNodeList(w.getNodes(), lower, Math.min(w.getNodesCount()-1, i), threshold,newNodes);
     190            buildSimplifiedNodeList(w.getNodes(), lower, Math.min(w.getNodesCount()-1, i), threshold, newNodes);
    190191            lower=i;
    191192            i++;
     
    214215     * @param from the lower index
    215216     * @param to the upper index
    216      * @param threshold
     217     * @param threshold the max error threshold
    217218     */
    218219    protected void buildSimplifiedNodeList(List<Node> wnew, int from, int to, double threshold, List<Node> simplifiedNodes) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java

    r8378 r8459  
    126126    /**
    127127     * Offsets the way(s) d units. Positive d means to the left (relative to the reference way)
    128      * @param d
     128     * @param d offset
    129129     */
    130130    public void changeOffset(double d) {
Note: See TracChangeset for help on using the changeset viewer.