Changeset 12210 in josm


Ignore:
Timestamp:
2017-05-18T23:05:39+02:00 (7 months ago)
Author:
michael2402
Message:

Documentation of ReverseWayAction

File:
1 edited

Legend:

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

    r12209 r12210  
    2929import org.openstreetmap.josm.tools.UserCancelException;
    3030
     31/**
     32 * Reverses the ways that are currently selected by the user
     33 */
    3134public final class ReverseWayAction extends JosmAction {
    3235
     36    /**
     37     * The resulting way after reversing it and the commands to get there.
     38     */
    3339    public static class ReverseWayResult {
    3440        private final Way newWay;
     
    3642        private final Command reverseCommand;
    3743
     44        /**
     45         * Create a new {@link ReverseWayResult}
     46         * @param newWay The new way primitive
     47         * @param tagCorrectionCommands The commands to correct the tags
     48         * @param reverseCommand The command to reverse the way
     49         */
    3850        public ReverseWayResult(Way newWay, Collection<Command> tagCorrectionCommands, Command reverseCommand) {
    3951            this.newWay = newWay;
     
    4254        }
    4355
     56        /**
     57         * Gets the new way object
     58         * @return The new, reversed way
     59         */
    4460        public Way getNewWay() {
    4561            return newWay;
    4662        }
    4763
     64        /**
     65         * Gets the commands that will be required to do a full way reversal including changing the tags
     66         * @return The comamnds
     67         */
    4868        public Collection<Command> getCommands() {
    4969            List<Command> c = new ArrayList<>();
     
    5373        }
    5474
     75        /**
     76         * Gets a single sequence command for reversing this way including changing the tags
     77         * @return the command
     78         */
    5579        public Command getAsSequenceCommand() {
    5680            return new SequenceCommand(tr("Reverse way"), getCommands());
    5781        }
    5882
     83        /**
     84         * Gets the basic reverse command that only changes the order of the nodes.
     85         * @return The reorder nodes command
     86         */
    5987        public Command getReverseCommand() {
    6088            return reverseCommand;
    6189        }
    6290
     91        /**
     92         * Gets the command to change the tags of the way
     93         * @return The command to reverse the tags
     94         */
    6395        public Collection<Command> getTagCorrectionCommands() {
    6496            return tagCorrectionCommands;
     
    6698    }
    6799
     100    /**
     101     * Creates a new {@link ReverseWayAction} and binds the shortcut
     102     */
    68103    public ReverseWayAction() {
    69104        super(tr("Reverse Ways"), "wayflip", tr("Reverse the direction of all selected ways."),
Note: See TracChangeset for help on using the changeset viewer.