Changeset 9230 in josm


Ignore:
Timestamp:
2015-12-31T16:37:24+01:00 (9 years ago)
Author:
Don-vip
Message:

fix javadoc errors/warnings

Location:
trunk/src/org/openstreetmap/josm
Files:
18 edited

Legend:

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

    r8840 r9230  
    8282    /**
    8383     * Open a list of files. The complete list will be passed to batch importers.
     84     * Filenames will not be saved in history.
    8485     * @param fileList A list of files
    8586     */
     
    8889    }
    8990
     91    /**
     92     * Open a list of files. The complete list will be passed to batch importers.
     93     * @param fileList A list of files
     94     * @param recordHistory {@code true} to save filename in history (default: false)
     95     */
    9096    public static void openFiles(List<File> fileList, boolean recordHistory) {
    9197        OpenFileTask task = new OpenFileTask(fileList, null);
     
    94100    }
    95101
     102    /**
     103     * Task to open files.
     104     */
    96105    public static class OpenFileTask extends PleaseWaitRunnable {
    97106        private final List<File> files;
     
    103112        private boolean recordHistory;
    104113
     114        /**
     115         * Constructs a new {@code OpenFileTask}.
     116         * @param files files to open
     117         * @param fileFilter file filter
     118         * @param title message for the user
     119         */
    105120        public OpenFileTask(final List<File> files, final FileFilter fileFilter, final String title) {
    106121            super(title, false /* don't ignore exception */);
     
    130145        }
    131146
     147        /**
     148         * Constructs a new {@code OpenFileTask}.
     149         * @param files files to open
     150         * @param fileFilter file filter
     151         */
    132152        public OpenFileTask(List<File> files, FileFilter fileFilter) {
    133153            this(files, fileFilter, tr("Opening files"));
     
    135155
    136156        /**
    137          * save filename in history (for list of recently opened files)
    138          * default: false
     157         * Sets whether to save filename in history (for list of recently opened files).
     158         * @param recordHistory {@code true} to save filename in history (default: false)
    139159         */
    140160        public void setRecordHistory(boolean recordHistory) {
     
    142162        }
    143163
     164        /**
     165         * Determines if filename must be saved in history (for list of recently opened files).
     166         * @return {@code true} if filename must be saved in history
     167         */
    144168        public boolean isRecordHistory() {
    145169            return recordHistory;
     
    319343        }
    320344
     345        /**
     346         * Import data files with the given importer.
     347         * @param importer file importer
     348         * @param files data files to import
     349         */
    321350        public void importData(FileImporter importer, List<File> files) {
    322351            if (importer.isBatchImporter()) {
  • trunk/src/org/openstreetmap/josm/actions/OrthogonalizeAction.java

    r8931 r9230  
    199199    /**
    200200     * Collect groups of ways with common nodes in order to orthogonalize each group separately.
     201     * @param wayDataList list of ways
    201202     * @return groups of ways with common nodes
    202203     */
     
    246247     *      - The same for vertical segments.
    247248     *  5. Rotate back.
     249     * @param wayDataList list of ways
     250     * @param headingNodes list of heading nodes
    248251     * @return list of commands to perform
    249252     * @throws InvalidUserInputException if selected ways have an angle different from 90 or 180 degrees
     
    398401
    399402    /**
    400      * Class contains everything we need to know about a singe way.
     403     * Class contains everything we need to know about a single way.
    401404     */
    402405    private static class WayData {
     
    477480    /**
    478481     * Make sure angle (up to 2*Pi) is in interval [ 0, 2*Pi ).
     482     * @param a angle
    479483     * @return correct angle
    480484     */
     
    491495    /**
    492496     * Make sure angle (up to 2*Pi) is in interval ( -Pi, Pi ].
     497     * @param a angle
    493498     * @return correct angle
    494499     */
     
    513518        /**
    514519         * Rotate counter-clock-wise.
     520         * @param pivot pivot
     521         * @param en original east/north
     522         * @param angle angle, in radians
    515523         * @return new east/north
    516524         */
     
    541549     * Recognize angle to be approximately 0, 90, 180 or 270 degrees.
    542550     * returns an integral value, corresponding to a counter clockwise turn.
     551     * @param a angle, in radians
     552     * @param deltaMax maximum tolerance, in radians
    543553     * @return an integral value, corresponding to a counter clockwise turn
    544554     * @throws RejectedAngleException in case of invalid angle
  • trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java

    r8975 r9230  
    5959        private final List<Tag> tags = new ArrayList<>();
    6060
     61        /**
     62         * Constructs a new {@code TagPaster}.
     63         * @param source source primitives
     64         * @param target target primitives
     65         */
    6166        public TagPaster(Collection<PrimitiveData> source, Collection<OsmPrimitive> target) {
    6267            this.source = source;
     
    6974         * @return true if the source for tag pasting is heterogeneous
    7075         */
    71         protected boolean isHeteogeneousSource() {
     76        protected boolean isHeterogeneousSource() {
    7277            int count = 0;
    7378            count = !getSourcePrimitivesByType(OsmPrimitiveType.NODE).isEmpty() ? count + 1 : count;
     
    230235        }
    231236
     237        /**
     238         * Performs the paste operation.
     239         * @return list of tags
     240         */
    232241        public List<Tag> execute() {
    233242            tags.clear();
    234             if (isHeteogeneousSource()) {
     243            if (isHeterogeneousSource()) {
    235244                pasteFromHeterogeneousSource();
    236245            } else {
     
    258267    }
    259268
    260     /** Paste tags from arbitrary text, not using JOSM buffer
     269    /**
     270     * Paste tags from arbitrary text, not using JOSM buffer
     271     * @param selection selected primitives
     272     * @param text text containing tags
    261273     * @return true if action was successful
     274     * @see TextTagParser#readTagsFromText
    262275     */
    263276    public static boolean pasteTagsFromText(Collection<OsmPrimitive> selection, String text) {
     
    278291    }
    279292
    280     /** Paste tags from JOSM buffer
     293    /**
     294     * Paste tags from JOSM buffer
    281295     * @param selection objects that will have the tags
    282296     * @return false if JOSM buffer was empty
     
    297311    /**
    298312     * Create and execute SequenceCommand with descriptive title
     313     * @param selection selected primitives
    299314     * @param commands the commands to perform in a sequential command
    300315     */
  • trunk/src/org/openstreetmap/josm/actions/RenameLayerAction.java

    r9067 r9230  
    3232
    3333    /**
     34     * Constructs a new {@code RenameLayerAction}.
    3435     * @param file The file of the original location of this layer.
    3536     *      If null, no possibility to "rename the file as well" is provided.
     37     * @param layer layer to rename
    3638     */
    3739    public RenameLayerAction(File file, Layer layer) {
  • trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java

    r8540 r9230  
    2727import org.openstreetmap.josm.data.osm.OsmPrimitive;
    2828import org.openstreetmap.josm.data.osm.Way;
     29import org.openstreetmap.josm.data.projection.Ellipsoid;
    2930import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    3031import org.openstreetmap.josm.gui.HelpAwareOptionPane.ButtonSpec;
     
    217218     * @param to the upper index
    218219     * @param threshold the max error threshold
     220     * @param simplifiedNodes list that will contain resulting nodes
    219221     */
    220222    protected void buildSimplifiedNodeList(List<Node> wnew, int from, int to, double threshold, List<Node> simplifiedNodes) {
     
    228230        for (int i = from + 1; i < to; i++) {
    229231            Node n = wnew.get(i);
    230             double xte = Math.abs(EARTH_RAD
     232            double xte = Math.abs(Ellipsoid.WGS84.a
    231233                    * xtd(fromN.getCoor().lat() * Math.PI / 180, fromN.getCoor().lon() * Math.PI / 180, toN.getCoor().lat() * Math.PI
    232234                            / 180, toN.getCoor().lon() * Math.PI / 180, n.getCoor().lat() * Math.PI / 180, n.getCoor().lon() * Math.PI
     
    253255    }
    254256
    255     public static final double EARTH_RAD = 6378137.0;
    256 
    257257    /* From Aviaton Formulary v1.3
    258258     * http://williams.best.vwh.net/avform.htm
  • trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java

    r9062 r9230  
    5555 * original order.  Selected nodes at the end of a way are ignored.
    5656 */
    57 
    5857public class SplitWayAction extends JosmAction {
    5958
     
    320319        /**
    321320         * Returns a strategy which selects the way chunk with the highest node count to keep.
     321         * @return strategy which selects the way chunk with the highest node count to keep
    322322         */
    323323        public static Strategy keepLongestChunk() {
     
    338338        /**
    339339         * Returns a strategy which selects the first way chunk.
     340         * @return strategy which selects the first way chunk
    340341         */
    341342        public static Strategy keepFirstChunk() {
     
    348349        }
    349350    }
    350 
    351351
    352352    /**
  • trunk/src/org/openstreetmap/josm/actions/UnGlueAction.java

    r9087 r9230  
    165165     * Assumes there is one tagged Node stored in selectedNode that it will try to unglue.
    166166     * (i.e. copy node and remove all tags from the old one. Relations will not be removed)
     167     * @param e event that trigerred the action
    167168     */
    168169    private void unglueNode(ActionEvent e) {
     
    217218     * Checks only if the number and type of items selected looks good.
    218219     *
    219      * If this method returns "true", selectedNode and selectedWay will
    220      * be set.
     220     * If this method returns "true", selectedNode and selectedWay will be set.
    221221     *
    222222     * Returns true if either one node is selected or one node and one
    223223     * way are selected and the node is part of the way.
    224224     *
    225      * The way will be put into the object variable "selectedWay", the
    226      * node into "selectedNode".
     225     * The way will be put into the object variable "selectedWay", the node into "selectedNode".
     226     * @param selection selected primitives
    227227     * @return true if either one node is selected or one node and one way are selected and the node is part of the way
    228228     */
     
    255255     * Checks only if the number and type of items selected looks good.
    256256     *
    257      * Returns true if one way and any number of nodes that are part of
    258      * that way are selected. Note: "any" can be none, then all nodes of
    259      * the way are used.
    260      *
    261      * The way will be put into the object variable "selectedWay", the
    262      * nodes into "selectedNodes".
     257     * Returns true if one way and any number of nodes that are part of that way are selected.
     258     * Note: "any" can be none, then all nodes of the way are used.
     259     *
     260     * The way will be put into the object variable "selectedWay", the nodes into "selectedNodes".
     261     * @param selection selected primitives
    263262     * @return true if one way and any number of nodes that are part of that way are selected
    264263     */
     
    298297     * dupe the given node of the given way
    299298     *
    300      * assume that OrginalNode is in the way
     299     * assume that originalNode is in the way
    301300     * <ul>
    302301     * <li>the new node will be put into the parameter newNodes.</li>
     
    304303     * <li>the changed way will be returned and must be put into cmds by the caller!</li>
    305304     * </ul>
    306      * @return new way
     305     * @param originalNode original node to duplicate
     306     * @param w parent way
     307     * @param cmds List of commands that will contain the new "add node" command
     308     * @param newNodes List of nodes that will contain the new node
     309     * @return new way The modified way. Change command mus be handled by the caller
    307310     */
    308311    private static Way modifyWay(Node originalNode, Way w, List<Command> cmds, List<Node> newNodes) {
     
    327330    /**
    328331     * put all newNodes into the same relation(s) that originalNode is in
     332     * @param originalNode original node to duplicate
     333     * @param cmds List of commands that will contain the new "change relation" commands
     334     * @param newNodes List of nodes that contain the new node
    329335     */
    330336    private void fixRelations(Node originalNode, List<Command> cmds, List<Node> newNodes) {
     
    343349                        rolesToReAdd = new HashMap<>();
    344350                    }
    345                     rolesToReAdd.put(rm.getRole(), i);
     351                    if (rolesToReAdd != null) {
     352                        rolesToReAdd.put(rm.getRole(), i);
     353                    }
    346354                }
    347355                i++;
    348356            }
    349357            if (newRel != null) {
    350                 for (Node n : newNodes) {
    351                     for (Map.Entry<String, Integer> role : rolesToReAdd.entrySet()) {
    352                         newRel.addMember(role.getValue() + 1, new RelationMember(role.getKey(), n));
     358                if (rolesToReAdd != null) {
     359                    for (Node n : newNodes) {
     360                        for (Map.Entry<String, Integer> role : rolesToReAdd.entrySet()) {
     361                            newRel.addMember(role.getValue() + 1, new RelationMember(role.getKey(), n));
     362                        }
    353363                    }
    354364                }
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTask.java

    r8512 r9230  
    125125     * @param url The URL to be confirmed
    126126     * @return The HTML-formatted confirmation message to be shown to user
    127      * @since
     127     * @since 5691
    128128     */
    129129    String getConfirmationMessage(URL url);
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadTaskList.java

    r9067 r9230  
    120120
    121121    /**
    122      * Replies the set of ids of all complete, non-new primitives (i.e. those with !
    123      * primitive.incomplete)
     122     * Replies the set of ids of all complete, non-new primitives (i.e. those with !primitive.incomplete)
     123     * @param ds data set
    124124     *
    125125     * @return the set of ids of all complete, non-new primitives
     
    285285            for (DownloadTask task : tasks) {
    286286                if (task instanceof AbstractDownloadTask) {
    287                     AbstractDownloadTask absTask = (AbstractDownloadTask) task;
     287                    AbstractDownloadTask<?> absTask = (AbstractDownloadTask<?>) task;
    288288                    if (absTask.isCanceled() || absTask.isFailed())
    289289                        return;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java

    r8870 r9230  
    256256     * occurs. We can use AWTEvent to catch those but still lack a proper
    257257     * mouseevent. Instead we copy the previous event and only update the modifiers.
     258     * @param e mouse event
     259     * @param modifiers mouse modifiers
    258260     */
    259261    private void giveUserFeedback(MouseEvent e, int modifiers) {
     
    266268     * calls the cursor and target highlighting routines. Extracts modifiers
    267269     * from mouse event.
     270     * @param e mouse event
    268271     */
    269272    private void giveUserFeedback(MouseEvent e) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r9074 r9230  
    894894
    895895    /**
    896      * if one of the ends of @param way is given @param node ,
     896     * if one of the ends of {@code way} is given {@code  node},
    897897     * then set  currentBaseNode = node and previousNode = adjacent node of way
     898     * @param way way to continue
     899     * @param node starting node
    898900     */
    899901    private void continueWayFromNode(Way way, Node node) {
     
    926928
    927929    /**
     930     * @param n node
    928931     * @return If the node is the end of exactly one way, return this.
    929932     *  <code>null</code> otherwise.
  • trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java

    r8846 r9230  
    1717 *   {@link OsmPrimitive} from the dataset in another layer or the one retrieved from the server.</li>
    1818 * </ul>
    19  *
    20  *
     19 * @since 1750
    2120 */
    22 public class  Conflict<T extends OsmPrimitive> {
     21public class Conflict<T extends OsmPrimitive> {
    2322    private final T my;
    2423    private final T their;
  • trunk/src/org/openstreetmap/josm/data/projection/datum/NTV2GridShift.java

    r8415 r9230  
    2323
    2424import org.openstreetmap.josm.data.coor.LatLon;
     25import org.openstreetmap.josm.data.projection.Ellipsoid;
    2526
    2627/**
     
    3940    private static final long serialVersionUID = 1L;
    4041
    41     private static final double METRE_PER_SECOND = 2.0 * Math.PI * 6378137.0 / 3600.0 / 360.0;
     42    private static final double METRE_PER_SECOND = 2.0 * Math.PI * Ellipsoid.WGS84.a / 3600.0 / 360.0;
    4243    private static final double RADIANS_PER_SECOND = 2.0 * Math.PI / 3600.0 / 360.0;
    4344    private double lon;
  • trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java

    r9059 r9230  
    281281     * Distributes a "bounding box changed" from one DownloadSelection
    282282     * object to the others, so they may update or clear their input fields.
     283     * @param b new current bounds
    283284     *
    284285     * @param eventSource - the DownloadSelection object that fired this notification.
     
    429430    }
    430431
     432    /**
     433     * Automatically opens the download dialog, if autorun is enabled.
     434     * @see #isAutorunEnabled
     435     */
    431436    public static void autostartIfNeeded() {
    432437        if (isAutorunEnabled()) {
  • trunk/src/org/openstreetmap/josm/gui/layer/MapViewPaintable.java

    r6380 r9230  
    1111    /**
    1212     * Paint the dataset using the engine set.
     13     * @param g Graphics
    1314     * @param mv The object that can translate GeoPoints to screen coordinates.
     15     * @param bbox Bounding box
    1416     */
    1517    void paint(Graphics2D g, MapView mv, Bounds bbox);
    16 
    1718}
  • trunk/src/org/openstreetmap/josm/gui/util/KeyPressReleaseListener.java

    r8512 r9230  
    55
    66/**
    7  * Interface that is used to detect key pressing and releasing
     7 * Interface that is used to detect key pressing and releasing.
     8 * @since 7219
    89 */
    910public interface KeyPressReleaseListener {
     
    1112     * This is called when key press event is actually pressed
    1213     * (no fake events while holding key)
     14     * @param e key event
    1315     */
    1416    void doKeyPressed(KeyEvent e);
     
    1719     * This is called when key press event is actually released
    1820     * (no fake events while holding key)
     21     * @param e key event
    1922     */
    2023    void doKeyReleased(KeyEvent e);
  • trunk/src/org/openstreetmap/josm/tools/HttpClient.java

    r9227 r9230  
    437437    /**
    438438     * Sets whether not to set header {@code Connection=close}
    439      * <p/>
     439     * <p>
    440440     * This might fix #7640, see
    441441     * <a href='https://web.archive.org/web/20140118201501/http://www.tikalk.com/java/forums/httpurlconnection-disable-keep-alive'>here</a>.
  • trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java

    r9062 r9230  
    1212import org.openstreetmap.josm.data.Bounds;
    1313import org.openstreetmap.josm.data.coor.LatLon;
     14import org.openstreetmap.josm.data.projection.Ellipsoid;
    1415
    1516public final class OsmUrlToBounds {
     
    188189    }
    189190
    190     /** radius of the earth */
    191     public static final double R = 6378137.0;
    192 
    193191    public static Bounds positionToBounds(final double lat, final double lon, final int zoom) {
    194192        int tileSizeInPixels = 256;
     
    207205            width = 640;
    208206        }
    209         double scale = (1 << zoom) * tileSizeInPixels / (2 * Math.PI * R);
     207        double scale = (1 << zoom) * tileSizeInPixels / (2 * Math.PI * Ellipsoid.WGS84.a);
    210208        double deltaX = width / 2.0 / scale;
    211209        double deltaY = height / 2.0 / scale;
    212         double x = Math.toRadians(lon) * R;
     210        double x = Math.toRadians(lon) * Ellipsoid.WGS84.a;
    213211        double y = mercatorY(lat);
    214         return new Bounds(invMercatorY(y - deltaY), Math.toDegrees(x - deltaX) / R, invMercatorY(y + deltaY), Math.toDegrees(x + deltaX) / R);
     212        return new Bounds(
     213                invMercatorY(y - deltaY), Math.toDegrees(x - deltaX) / Ellipsoid.WGS84.a,
     214                invMercatorY(y + deltaY), Math.toDegrees(x + deltaX) / Ellipsoid.WGS84.a);
    215215    }
    216216
    217217    public static double mercatorY(double lat) {
    218         return Math.log(Math.tan(Math.PI/4 + Math.toRadians(lat)/2)) * R;
     218        return Math.log(Math.tan(Math.PI/4 + Math.toRadians(lat)/2)) * Ellipsoid.WGS84.a;
    219219    }
    220220
    221221    public static double invMercatorY(double north) {
    222         return Math.toDegrees(Math.atan(Math.sinh(north / R)));
     222        return Math.toDegrees(Math.atan(Math.sinh(north / Ellipsoid.WGS84.a)));
    223223    }
    224224
Note: See TracChangeset for help on using the changeset viewer.