Changeset 9231 in josm for trunk/src/org


Ignore:
Timestamp:
2016-01-01T02:35:34+01:00 (8 years ago)
Author:
Don-vip
Message:

javadoc update

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

Legend:

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

    r9070 r9231  
    909909     * For dual align, calculates positions of new nodes, aligning them to neighboring segments.
    910910     * Elsewhere, just adds the vetor returned by calculateBestMovement to {@link #initialN1en},  {@link #initialN2en}.
     911     * @param mouseEn mouse coordinates
    911912     * @return best movement vector
    912913     */
     
    11091110
    11101111    /**
    1111      * Determines if from1-to1 and from2-to2 vertors directions are opposite
    1112      * @return true if from1-to1 and from2-to2 vertors directions are opposite
     1112     * Determines if from1-to1 and from2-to2 vectors directions are opposite
     1113     * @param from1 vector1 start
     1114     * @param to1 vector1 end
     1115     * @param from2 vector2 start
     1116     * @param to2 vector2 end
     1117     * @return true if from1-to1 and from2-to2 vectors directions are opposite
    11131118     */
    11141119    private static boolean isOppositeDirection(EastNorth from1, EastNorth to1, EastNorth from2, EastNorth to2) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java

    r9059 r9231  
    1818/**
    1919 * A class implementing MapMode is able to be selected as an mode for map editing.
    20  * As example scrolling the map is a MapMode, connecting Nodes to new Ways
    21  * is another.
     20 * As example scrolling the map is a MapMode, connecting Nodes to new Ways is another.
    2221 *
    2322 * MapModes should register/deregister all necessary listeners on the map's view control.
     
    3029
    3130    /**
    32      * Constructor for mapmodes without an menu
     31     * Constructor for mapmodes without a menu
     32     * @param name the action's text
     33     * @param iconName icon filename in {@code mapmode} directory
     34     * @param tooltip  a longer description of the action that will be displayed in the tooltip.
     35     * @param shortcut a ready-created shortcut object or null if you don't want a shortcut.
    3336     * @param mapFrame unused but kept for plugin compatibility. Can be {@code null}
     37     * @param cursor cursor displayed when map mode is active
    3438     */
    3539    public MapMode(String name, String iconName, String tooltip, Shortcut shortcut, MapFrame mapFrame, Cursor cursor) {
     
    4044
    4145    /**
    42      * Constructor for mapmodes with an menu (no shortcut will be registered)
     46     * Constructor for mapmodes with a menu (no shortcut will be registered)
     47     * @param name the action's text
     48     * @param iconName icon filename in {@code mapmode} directory
     49     * @param tooltip  a longer description of the action that will be displayed in the tooltip.
    4350     * @param mapFrame unused but kept for plugin compatibility. Can be {@code null}
     51     * @param cursor cursor displayed when map mode is active
    4452     */
    4553    public MapMode(String name, String iconName, String tooltip, MapFrame mapFrame, Cursor cursor) {
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r9073 r9231  
    887887     * key is pressed. If there is no such node, no action will be done and no error will be
    888888     * reported. If there is, it will execute the merge and add it to the undo buffer.
     889     * @param p mouse position
    889890     */
    890891    private void mergePrims(Point p) {
     
    935936     * Tries to find a node to merge to when in move-merge mode for the current mouse
    936937     * position. Either returns the node or null, if no suitable one is nearby.
     938     * @param p mouse position
    937939     * @return node to merge to, or null
    938940     */
     
    12611263
    12621264    /**
    1263      * @return o as collection of o's type.
     1265     * Returns {@code o} as collection of {@code o}'s type.
     1266     * @param o any object
     1267     * @return {@code o} as collection of {@code o}'s type.
    12641268     */
    12651269    protected static <T> Collection<T> asColl(T o) {
  • trunk/src/org/openstreetmap/josm/command/MoveCommand.java

    r9067 r9231  
    139139    }
    140140
     141    /**
     142     * Move again to the specified coordinates.
     143     * @param x X coordinate
     144     * @param y Y coordinate
     145     * @see #moveAgain
     146     */
    141147    public void moveAgainTo(double x, double y) {
    142148        moveAgain(x - this.x, y - this.y);
     
    144150
    145151    /**
    146      * Change the displacement vector to have endpoint @param currentEN
    147      * starting point is  startEN
     152     * Change the displacement vector to have endpoint {@code currentEN}.
     153     * starting point is startEN
     154     * @param currentEN the new endpoint
    148155     */
    149156    public void applyVectorTo(EastNorth currentEN) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/SearchBasedRowFilter.java

    r8985 r9231  
    1414/**
    1515 * A {@link RowFilter} implementation which matches tags w.r.t. the specified filter's
    16  * {@link SearchCompiler.Match#match(org.openstreetmap.josm.data.osm.Tagged)} method.
     16 * {@link org.openstreetmap.josm.actions.search.SearchCompiler.Match#match(org.openstreetmap.josm.data.osm.Tagged)} method.
    1717 *
    1818 * <p>An {@link javax.swing.RowFilter.Entry}'s column 0 is considered as key, and column 1 is considered as value.</p>
  • trunk/src/org/openstreetmap/josm/gui/layer/Layer.java

    r8958 r9231  
    408408    /**
    409409     * allows to check whether a projection is supported or not
     410     * @param proj projection
    410411     *
    411412     * @return True if projection is supported for this layer
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSetting.java

    r8958 r9231  
    1010     * Add the GUI elements to the dialog. The elements should be initialized after
    1111     * the current preferences.
     12     * @param gui the preferences tab pane
    1213     */
    1314    void addGui(PreferenceTabbedPane gui);
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r9224 r9231  
    808808        /**
    809809         * Constructs a new {@code OffsetBookmarksPanel}.
     810         * @param gui the preferences tab pane
    810811         */
    811812        OffsetBookmarksPanel(final PreferenceTabbedPane gui) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java

    r9059 r9231  
    168168    }
    169169
     170    /**
     171     * Returns title from a source entry.
     172     * @param entry source entry
     173     * @return title
     174     * @see MapCSSStyleSource#title
     175     */
    170176    public static String getTitleFromSourceEntry(SourceEntry entry) {
    171177        try {
     
    233239         * the new entries to the user-configured list. Remember the known URLs,
    234240         * so an item that was deleted explicitly is not added again.
     241         * @param list new defaults
     242         * @return {@code true} if a change occurred
    235243         */
    236244        private boolean insertNewDefaults(List<SourceEntry> list) {
  • trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java

    r9078 r9231  
    108108    /**
    109109     * Constructs a new {@code PleaseWaitProgressMonitor}.
     110     * @param windowTitle window title
    110111     */
    111112    public PleaseWaitProgressMonitor(String windowTitle) {
     
    116117    /**
    117118     * Constructs a new {@code PleaseWaitProgressMonitor}.
     119     * @param dialogParent component to get parent frame from
    118120     */
    119121    public PleaseWaitProgressMonitor(Component dialogParent) {
     
    129131    /**
    130132     * Constructs a new {@code PleaseWaitProgressMonitor}.
     133     * @param dialogParent component to get parent frame from
     134     * @param windowTitle window title
    131135     */
    132136    public PleaseWaitProgressMonitor(Component dialogParent, String windowTitle) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java

    r9078 r9231  
    413413    /**
    414414     * applies the current state of the tag editor model to a map of tags
     415     * @param keepEmpty {@code true} to keep empty tags
    415416     *
    416417     * @return the map of key/value pairs
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java

    r8863 r9231  
    5959    }
    6060
     61    /**
     62     * Sets the next component to request focus after navigation (with tab or enter).
     63     * @param nextFocusComponent next component to request focus after navigation (with tab or enter)
     64     * @see TagTable#setNextFocusComponent
     65     */
    6166    public void setNextFocusComponent(Component nextFocusComponent) {
    6267        tagTable.setNextFocusComponent(nextFocusComponent);
     
    9196    }
    9297
     98    /**
     99     * Returns the paste action.
     100     * @return the paste action
     101     */
    93102    public AbstractAction getPasteAction() {
    94103        return tagTable.getPasteAction();
     
    141150     * Creates a new tag editor panel. The editor model is created
    142151     * internally and can be retrieved with {@link #getModel()}.
     152     * @param presetHandler tagging preset handler
    143153     */
    144154    public TagEditorPanel(TaggingPresetHandler presetHandler) {
     
    147157
    148158    /**
    149      * Creates a new tag editor panel with a supplied model. If
    150      * {@code model} is null, a new model is created.
     159     * Creates a new tag editor panel with a supplied model. If {@code model} is null, a new model is created.
    151160     *
    152161     * @param model the tag editor model
     162     * @param presetHandler tagging preset handler
    153163     * @param maxCharacters maximum number of characters allowed, 0 for unlimited
    154164     */
  • trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java

    r9078 r9231  
    504504    }
    505505
     506    /**
     507     * Sets the next component to request focus after navigation (with tab or enter).
     508     * @param nextFocusComponent next component to request focus after navigation (with tab or enter)
     509     */
    506510    public void setNextFocusComponent(Component nextFocusComponent) {
    507511        this.nextFocusComponent = nextFocusComponent;
     
    512516    }
    513517
    514     public void  addOKAccelatorListener(KeyListener l) {
     518    public void addOKAccelatorListener(KeyListener l) {
    515519        addKeyListener(l);
    516520        if (editor != null) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPriority.java

    r8958 r9231  
    106106     * Merges two priorities.
    107107     * The resulting priority is always &gt;= the original ones.
     108     * @param other other priority
    108109     * @return the merged priority
    109110     */
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java

    r8959 r9231  
    204204    /**
    205205     * Called from the XML parser to set the types this preset affects.
     206     * @param types comma-separated primitive types ("node", "way", "relation" or "closedway")
    206207     * @throws SAXException if any SAX error occurs
     208     * @see TaggingPresetType#fromString
    207209     */
    208210    public void setType(String types) throws SAXException {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetMenu.java

    r8870 r9231  
    108108    /**
    109109     * Sorts the menu items using the translated item text
     110     * @param menu menu to sort
    110111     */
    111112    public static void sortMenu(JMenu menu) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java

    r8870 r9231  
    215215    /**
    216216     * Constructs a new {@code TaggingPresetSelector}.
     217     * @param displayOnlyApplicable if {@code true} display "Show only applicable to selection" checkbox
     218     * @param displaySearchInTags if {@code true} display "Search in tags" checkbox
    217219     */
    218220    public TaggingPresetSelector(boolean displayOnlyApplicable, boolean displaySearchInTags) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java

    r9044 r9231  
    258258     *      must be escaped within one entry
    259259     * @param s the string
     260     * @return splitted items
    260261     */
    261262    public static String[] splitEscaped(char delimiter, String s) {
  • trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Roles.java

    r8863 r9231  
    6868        /**
    6969         * Return either argument, the highest possible value or the lowest allowed value
     70         * @param c count
     71         * @return the highest possible value or the lowest allowed value
     72         * @see #required
    7073         */
    7174        public long getValidCount(long c) {
  • trunk/src/org/openstreetmap/josm/gui/util/AdjustmentSynchronizer.java

    r8509 r9231  
    7272
    7373    /**
    74      * Sets whether adjustable participates in adjustment synchronization or not
     74     * Sets whether {@code adjustable} participates in adjustment synchronization or not
    7575     *
    7676     * @param adjustable the adjustable
     77     * @param isParticipating {@code true} if {@code adjustable} participates in adjustment synchronization
    7778     */
    7879    protected void setParticipatingInSynchronizedScrolling(Adjustable adjustable, boolean isParticipating) {
  • trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java

    r9223 r9231  
    6262    /**
    6363     * disable / enable a component and all its child components
     64     * @param root component
     65     * @param enabled enabled state
    6466     */
    6567    public static void setEnabledRec(Container root, boolean enabled) {
  • trunk/src/org/openstreetmap/josm/gui/util/TableHelper.java

    r8510 r9231  
    2020     * adjust the preferred width of column col to the maximum preferred width of the cells
    2121     * requires JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
     22     * @param tbl table
     23     * @param col column index
     24     * @param maxColumnWidth maximum column width
    2225     */
    2326    public static void adjustColumnWidth(JTable tbl, int col, int maxColumnWidth) {
  • trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java

    r9059 r9231  
    9292     * Alternative constructor that allows to turn off the actionListener.
    9393     * This can be useful if the enter key stroke needs to be forwarded to the default button in a dialog.
     94     * @param tc text component
     95     * @param addActionListener {@code true} to add the action listener
    9496     */
    9597    public AbstractTextComponentValidator(JTextComponent tc, boolean addActionListener) {
     
    9799    }
    98100
     101    /**
     102     * Constructs a new {@code AbstractTextComponentValidator}.
     103     * @param tc text component
     104     * @param addFocusListener {@code true} to add the focus listener
     105     * @param addDocumentListener {@code true} to add the document listener
     106     * @param addActionListener {@code true} to add the action listener
     107     */
    99108    public AbstractTextComponentValidator(JTextComponent tc, boolean addFocusListener, boolean addDocumentListener, boolean addActionListener) {
    100109        CheckParameterUtil.ensureParameterNotNull(tc, "tc");
  • trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java

    r9074 r9231  
    9494     *
    9595     * #see setModel
     96     * @param model model
    9697     */
    9798    public MultiSplitLayout(Node model) {
     
    196197     * Split and Leaf nodes.  Typically this property is set to false
    197198     * after the (MultiSplitPane) user has dragged a Divider.
     199     * @param floatingDividers boolean value
    198200     *
    199201     * @see #getFloatingDividers
     
    690692        private final transient Node node;
    691693
     694        /**
     695         * Constructs a new {@code InvalidLayoutException}.
     696         * @param msg the detail message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
     697         * @param node node
     698         */
    692699        public InvalidLayoutException(String msg, Node node) {
    693700            super(msg);
     
    12341241
    12351242    /**
    1236      * A convenience method that converts a string to a
    1237      * MultiSplitLayout model (a tree of Nodes) using a
    1238      * a simple syntax.  Nodes are represented by
    1239      * parenthetical expressions whose first token
    1240      * is one of ROW/COLUMN/LEAF.  ROW and COLUMN specify
    1241      * horizontal and vertical Split nodes respectively,
    1242      * LEAF specifies a Leaf node.  A Leaf's name and
    1243      * weight can be specified with attributes,
     1243     * A convenience method that converts a string to a MultiSplitLayout model (a tree of Nodes) using a
     1244     * a simple syntax.  Nodes are represented by parenthetical expressions whose first token
     1245     * is one of ROW/COLUMN/LEAF.  ROW and COLUMN specify horizontal and vertical Split nodes respectively,
     1246     * LEAF specifies a Leaf node.  A Leaf's name and weight can be specified with attributes,
    12441247     * name=<i>myLeafName</i> weight=<i>myLeafWeight</i>.
    1245      * Similarly, a Split's weight can be specified with
    1246      * weight=<i>mySplitWeight</i>.
    1247      *
    1248      * <p> For example, the following expression generates
    1249      * a horizontal Split node with three children:
    1250      * the Leafs named left and right, and a Divider in
    1251      * between:
     1248     * Similarly, a Split's weight can be specified with weight=<i>mySplitWeight</i>.
     1249     *
     1250     * <p> For example, the following expression generates a horizontal Split node with three children:
     1251     * the Leafs named left and right, and a Divider in between:
    12521252     * <pre>
    12531253     * (ROW (LEAF name=left) (LEAF name=right weight=1.0))
    12541254     * </pre>
    12551255     *
    1256      * <p> Dividers should not be included in the string,
    1257      * they're added automatcially as needed.  Because
    1258      * Leaf nodes often only need to specify a name, one
    1259      * can specify a Leaf by just providing the name.
     1256     * <p> Dividers should not be included in the string, they're added automatcially as needed.  Because
     1257     * Leaf nodes often only need to specify a name, one can specify a Leaf by just providing the name.
    12601258     * The previous example can be written like this:
    12611259     * <pre>
     
    12631261     * </pre>
    12641262     *
    1265      * <p>Here's a more complex example.  One row with
    1266      * three elements, the first and last of which are columns
     1263     * <p>Here's a more complex example.  One row with three elements, the first and last of which are columns
    12671264     * with two leaves each:
    12681265     * <pre>
     
    12721269     * </pre>
    12731270     *
    1274      *
    1275      * <p> This syntax is not intended for archiving or
    1276      * configuration files .  It's just a convenience for
     1271     * <p> This syntax is not intended for archiving or configuration files .  It's just a convenience for
    12771272     * examples and tests.
     1273     * @param s model as string
    12781274     *
    12791275     * @return the Node root of a tree based on s.
  • trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java

    r8840 r9231  
    8181     * A menu can only be attached to a single component.
    8282     * @param component The text component that will display the menu and handle its actions.
     83     * @param undoRedo {@code true} if undo/redo must be supported
    8384     * @return {@code this}
    8485     * @see #detach()
  • trunk/src/org/openstreetmap/josm/io/FileImporter.java

    r8929 r9231  
    1919import org.openstreetmap.josm.gui.util.GuiHelper;
    2020
     21/**
     22 * Abstract file importer.
     23 * @since 1637
     24 */
    2125public abstract class FileImporter implements Comparable<FileImporter>, LayerChangeListener {
    2226
     
    7781
    7882    /**
    79      * Wrapper to give meaningful output if things go wrong.
     83     * Wrapper to {@link #importData(File, ProgressMonitor)} to give meaningful output if things go wrong.
     84     * @param f data file to import
     85     * @param progressMonitor progress monitor
    8086     * @return true if data import was successful
    8187     */
     
    121127    }
    122128
     129    /**
     130     * Wrapper to {@link #importData(List, ProgressMonitor)} to give meaningful output if things go wrong.
     131     * @param files data files to import
     132     * @param progressMonitor progress monitor
     133     * @return true if data import was successful
     134     */
    123135    public boolean importDataHandleExceptions(List<File> files, ProgressMonitor progressMonitor) {
    124136        try {
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r8870 r9231  
    248248    /**
    249249     * Add all those listeners to handle the enable state of the fields.
     250     * @param data GPX data
     251     * @param author Author checkbox
     252     * @param authorName Author name textfield
     253     * @param email E-mail textfield
     254     * @param copyright Copyright textfield
     255     * @param predefined Predefined button
     256     * @param copyrightYear Copyright year textfield
     257     * @param nameLabel Name label
     258     * @param emailLabel E-mail label
     259     * @param copyrightLabel Copyright label
     260     * @param copyrightYearLabel Copyright year label
     261     * @param warning Warning label
    250262     */
    251263    private static void addDependencies(
  • trunk/src/org/openstreetmap/josm/io/GpxReader.java

    r9078 r9231  
    499499        /**
    500500         * convert url/urlname to link element (GPX 1.0 -&gt; GPX 1.1).
     501         * @param attr attributes
    501502         */
    502503        private void convertUrlToLink(Map<String, Object> attr) {
     
    509510                GpxLink link = new GpxLink(url);
    510511                link.text = urlname;
    511                 @SuppressWarnings({ "unchecked", "rawtypes" })
     512                @SuppressWarnings("unchecked")
    512513                Collection<GpxLink> links = (Collection<GpxLink>) attr.get(META_LINKS);
    513514                links.add(link);
     
    531532     * @throws IOException if an IO error occurs, e.g. the input stream is closed.
    532533     */
    533     @SuppressWarnings("resource")
    534534    public GpxReader(InputStream source) throws IOException {
    535535        Reader utf8stream = UTFInputStreamReader.create(source);
  • trunk/src/org/openstreetmap/josm/io/GpxWriter.java

    r8846 r9231  
    248248     * if content not null, open tag, write encoded content, and close tag
    249249     * else do nothing.
     250     * @param tag GPX tag
     251     * @param content content
    250252     */
    251253    private void simpleTag(String tag, String content) {
     
    260262    /**
    261263     * output link
     264     * @param link link
    262265     */
    263266    private void gpxLink(GpxLink link) {
     
    272275    /**
    273276     * output a point
     277     * @param pnt waypoint
     278     * @param mode {@code WAY_POINT} for {@code wpt}, {@code ROUTE_POINT} for {@code rtept}, {@code TRACK_POINT} for {@code trkpt}
    274279     */
    275280    private void wayPoint(WayPoint pnt, int mode) {
  • trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java

    r9078 r9231  
    299299     * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY},
    300300     * {@link OsmPrimitiveType#RELATION RELATION}
     301     * @param progressMonitor progress monitor
    301302     * @throws OsmTransferException if an error occurs while communicating with the API server
    302303     */
     
    485486         * {@link OsmPrimitiveType#RELATION RELATION}
    486487         * @param pkg the package of ids
     488         * @param progressMonitor progress monitor
    487489         * @return the {@link FetchResult} of this operation
    488490         * @throws OsmTransferException if an error occurs while communicating with the API server
     
    513515         * {@link OsmPrimitiveType#RELATION RELATION}
    514516         * @param id the id
     517         * @param progressMonitor progress monitor
    515518         * @return the {@link DataSet} resulting of this operation
    516519         * @throws OsmTransferException if an error occurs while communicating with the API server
     
    544547         * {@link OsmPrimitiveType#RELATION RELATION}
    545548         * @param pkg the set of ids
     549         * @param progressMonitor progress monitor
    546550         * @return the {@link FetchResult} of this operation
    547551         * @throws OsmTransferException if an error occurs while communicating with the API server
  • trunk/src/org/openstreetmap/josm/io/OsmReader.java

    r9087 r9231  
    5757    private static volatile List<OsmServerReadPostprocessor> postprocessors;
    5858
    59     /** register a new postprocessor */
     59    /** Register a new postprocessor.
     60     * @param pp postprocessor
     61     * @see #deregisterPostprocessor
     62     */
    6063    public static void registerPostprocessor(OsmServerReadPostprocessor pp) {
    6164        if (postprocessors == null) {
     
    6568    }
    6669
    67     /** deregister a postprocessor previously registered with registerPostprocessor */
     70    /**
     71     * Deregister a postprocessor previously registered with {@link #registerPostprocessor}.
     72     * @param pp postprocessor
     73     * @see #registerPostprocessor
     74     */
    6875    public static void deregisterPostprocessor(OsmServerReadPostprocessor pp) {
    6976        if (postprocessors != null) {
     
    399406     * This is basically the same code as parseUnknown(), except for the warnings, which
    400407     * are displayed for inner elements and not at top level.
     408     * @param printWarning if {@code true}, a warning message will be printed if an unknown element is met
    401409     * @throws XMLStreamException if there is an error processing the underlying XML source
    402410     */
     
    432440    /**
    433441     * Read out the common attributes and put them into current OsmPrimitive.
     442     * @param current primitive to update
    434443     * @throws XMLStreamException if there is an error processing the underlying XML source
    435444     */
  • trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java

    r8510 r9231  
    148148     * Reads referring ways from the API server and replies them in a {@link DataSet}
    149149     *
     150     * @param progressMonitor progress monitor
    150151     * @return the data set
    151152     * @throws OsmTransferException if any error occurs during dialog with OSM API
  • trunk/src/org/openstreetmap/josm/io/OsmServerHistoryReader.java

    r9078 r9231  
    5050    /**
    5151     * Fetches the history from the OSM API and parses it
     52     * @param progressMonitor progress monitor
    5253     *
    5354     * @return the data set with the parsed history data
  • trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java

    r9078 r9231  
    256256    /**
    257257     * Calls all registered upload postprocessors.
     258     * @param pm progress monitor
    258259     */
    259260    public void executePostprocessors(ProgressMonitor pm) {
  • trunk/src/org/openstreetmap/josm/io/OsmWriter.java

    r9078 r9231  
    4646
    4747    /**
    48      * Do not call this directly. Use OsmWriterFactory instead.
     48     * Constructs a new {@code OsmWriter}.
     49     * Do not call this directly. Use {@link OsmWriterFactory} instead.
     50     * @param out print writer
     51     * @param version OSM API version (0.6)
    4952     */
    5053    protected OsmWriter(PrintWriter out, boolean osmConform, String version) {
     
    279282     * Add the common part as the form of the tag as well as the XML attributes
    280283     * id, action, user, and visible.
     284     * @param osm osm primitive
     285     * @param tagname XML tag matching osm primitive (node, way, relation)
    281286     */
    282287    protected void addCommon(IPrimitive osm, String tagname) {
  • trunk/src/org/openstreetmap/josm/io/UTFInputStreamReader.java

    r8926 r9231  
    1515    /**
    1616     * Creates a new {@link InputStreamReader} from the {@link InputStream} with UTF-8 as default encoding.
     17     * @param input input stream
    1718     * @return A reader with the correct encoding. Starts to read after the BOM.
    1819     * @throws IOException if any I/O error occurs
     
    2526    /**
    2627     * Creates a new {@link InputStreamReader} from the {@link InputStream}.
     28     * @param input input stream
    2729     * @param defaultEncoding Used, when no BOM was recognized. Can be null.
    2830     * @return A reader with the correct encoding. Starts to read after the BOM.
  • trunk/src/org/openstreetmap/josm/io/XmlWriter.java

    r8929 r9231  
    1717    protected final PrintWriter out;
    1818
     19    /**
     20     * Constructs a new {@code XmlWriter}.
     21     * @param out print writer
     22     */
    1923    public XmlWriter(PrintWriter out) {
    2024        this.out = out;
     
    3034    }
    3135
     36    /**
     37     * Encode the given string in XML1.0 format.
     38     * Optimized to fast pass strings that don't need encoding (normal case).
     39     *
     40     * @param unencoded the unencoded input string
     41     * @return XML1.0 string
     42     */
    3243    public static String encode(String unencoded) {
    3344        return encode(unencoded, false);
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r9078 r9231  
    119119    /**
    120120     * Constructs a new {@code AddTagsDialog}.
     121     * @param tags tags to add
     122     * @param senderName String for skipping confirmations. Use empty string for always confirmed adding.
     123     * @param primitives OSM objects that will be modified
    121124     */
    122125    public AddTagsDialog(String[][] tags, String senderName, Collection<? extends OsmPrimitive> primitives) {
     
    260263     * parse addtags parameters Example URL (part):
    261264     * addtags=wikipedia:de%3DResidenzschloss Dresden|name:en%3DDresden Castle
     265     * @param args request arguments
     266     * @param sender is a string for skipping confirmations. Use empty string for always confirmed adding.
     267     * @param primitives OSM objects that will be modified
    262268     */
    263269    public static void addTags(final Map<String, String> args, final String sender, final Collection<? extends OsmPrimitive> primitives) {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r9078 r9231  
    301301     * @param out
    302302     *            The writer where the error is written
     303     * @param help
     304     *            Optional HTML help content to display, can be null
    303305     * @throws IOException
    304306     *             If the error can not be written
     
    323325     * @param out
    324326     *            The writer where the error is written
     327     * @param help
     328     *            Optional HTML help content to display, can be null
    325329     * @throws IOException
    326330     *             If the error can not be written
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java

    r8929 r9231  
    122122     * Find the node with almost the same coords in dataset or in already added nodes
    123123     * @param ll coordinates
     124     * @param commands list of commands that will be modified if needed
    124125     * @return node with almost the same coords
    125126     * @since 5845
    126127     */
    127     Node findOrCreateNode(LatLon ll,  List<Command> commands) {
     128    Node findOrCreateNode(LatLon ll, List<Command> commands) {
    128129        Node nd = null;
    129130
  • trunk/src/org/openstreetmap/josm/io/session/SessionReader.java

    r9087 r9231  
    145145         * Add a task, e.g. a message dialog, that should
    146146         * be executed in EDT after all layers have been added.
     147         * @param task task to run in EDT
    147148         */
    148149        public void addPostLayersTask(Runnable task) {
  • trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java

    r9078 r9231  
    6565     *
    6666     * The exporter class must have a one-argument constructor with layerClass as formal parameter type.
     67     * @param layerClass layer class
     68     * @param exporter exporter for this layer class
    6769     */
    6870    public static void registerSessionLayerExporter(Class<? extends Layer> layerClass, Class<? extends SessionLayerExporter> exporter) {
     
    9597     * @param active The index of active layer in {@code layers} (starts at 0). Ignored if set to -1
    9698     * @param exporters The exporters to use to save layers
     99     * @param dependencies layer dependencies
    97100     * @param zip {@code true} if a joz archive has to be created, {@code false otherwise}
    98101     * @since 6271
  • trunk/src/org/openstreetmap/josm/plugins/Plugin.java

    r8928 r9231  
    101101     * Called in the download dialog to give the plugin a chance to modify the list
    102102     * of bounding box selectors.
     103     * @param list list of bounding box selectors
    103104     */
    104105    public void addDownloadSelection(List<DownloadSelection> list) {}
     
    106107    /**
    107108     * Copies the resource 'from' to the file in the plugin directory named 'to'.
     109     * @param from source file
     110     * @param to target file
    108111     * @throws FileNotFoundException if the file exists but is a directory rather than a regular file,
    109112     * does not exist but cannot be created, or cannot be opened for any other reason
     
    149152        final URL pluginJarUrl = Utils.fileToURL(pluginJar);
    150153        return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
     154              @Override
    151155              public ClassLoader run() {
    152156                  return new URLClassLoader(new URL[] {pluginJarUrl}, Main.class.getClassLoader());
  • trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java

    r8506 r9231  
    9898     * Ensures that the condition {@code condition} holds.
    9999     * @param condition The condition to check
     100     * @param message error message
    100101     * @throws IllegalArgumentException if the condition does not hold
    101102     */
  • trunk/src/org/openstreetmap/josm/tools/CopyList.java

    r8840 r9231  
    1616 *
    1717 * @author nenik
     18 * @param <E> the type of elements in this list
    1819 */
    1920public final class CopyList<E> extends AbstractList<E> implements RandomAccess, Cloneable {
     
    2425    /**
    2526     * Create a List over given array.
    26      * @param array The initial List content. The array is never modified
    27      * by the {@code CopyList}.
     27     * @param array The initial List content. The array is never modified by the {@code CopyList}.
    2828     */
    2929    public CopyList(E[] array) {
     
    3131    }
    3232
     33    /**
     34     * Create a List over given array and size.
     35     * @param array The initial List content. The array is never modified by the {@code CopyList}.
     36     * @param size number of items
     37     */
    3338    public CopyList(E[] array, int size) {
    3439        this.array = array;
  • trunk/src/org/openstreetmap/josm/tools/Diff.java

    r8976 r9231  
    152152     * the worst this can do is cause suboptimal diff output.
    153153     * It cannot cause incorrect diff output.
     154     * @param xoff xoff
     155     * @param xlim xlim
     156     * @param yoff yoff
     157     * @param ylim ylim
     158     * @return midpoint of the shortest edit script
    154159     */
    155160    private int diag(int xoff, int xlim, int yoff, int ylim) {
     
    164169        int fmin = fmid, fmax = fmid;   // Limits of top-down search.
    165170        int bmin = bmid, bmax = bmid;   // Limits of bottom-up search.
    166         /* True if southeast corner is on an odd
    167                      diagonal with respect to the northwest. */
     171        // True if southeast corner is on an odd diagonal with respect to the northwest.
    168172        final boolean odd = (fmid - bmid & 1) != 0;
    169173
     
    315319    }
    316320
    317     /** Compare in detail contiguous subsequences of the two files
    318      which are known, as a whole, to match each other.
    319 
    320      The results are recorded in the vectors filevec[N].changed_flag, by
    321      storing a 1 in the element for each line that is an insertion or deletion.
    322 
    323      The subsequence of file 0 is [XOFF, XLIM) and likewise for file 1.
    324 
    325      Note that XLIM, YLIM are exclusive bounds.
    326      All line numbers are origin-0 and discarded lines are not counted.  */
    327 
     321    /**
     322     * Compare in detail contiguous subsequences of the two files
     323     * which are known, as a whole, to match each other.
     324     *
     325     * The results are recorded in the vectors filevec[N].changed_flag, by
     326     * storing a 1 in the element for each line that is an insertion or deletion.
     327     *
     328     * The subsequence of file 0 is [XOFF, XLIM) and likewise for file 1.
     329     *
     330     * Note that XLIM, YLIM are exclusive bounds.
     331     * All line numbers are origin-0 and discarded lines are not counted.
     332     * @param xoff xoff
     333     * @param xlim xlim
     334     * @param yoff yoff
     335     * @param ylim ylim
     336     */
    328337    private void compareseq(int xoff, int xlim, int yoff, int ylim) {
    329338        /* Slide down the bottom initial diagonal. */
     
    379388    private boolean inhibit;
    380389
    381     /** Adjust inserts/deletes of blank lines to join changes
    382        as much as possible.
     390    /**
     391     * Adjust inserts/deletes of blank lines to join changes as much as possible.
    383392     */
    384393    private void shift_boundaries() {
     
    389398    }
    390399
     400    /**
     401     * Script builder.
     402     */
    391403    public interface ScriptBuilder {
    392         /** Scan the tables of which lines are inserted and deleted,
    393            producing an edit script.
    394            @param changed0 true for lines in first file which do not match 2nd
    395            @param len0 number of lines in first file
    396            @param changed1 true for lines in 2nd file which do not match 1st
    397            @param len1 number of lines in 2nd file
    398            @return a linked list of changes - or null
     404        /**
     405         * Scan the tables of which lines are inserted and deleted, producing an edit script.
     406         * @param changed0 true for lines in first file which do not match 2nd
     407         * @param len0 number of lines in first file
     408         * @param changed1 true for lines in 2nd file which do not match 1st
     409         * @param len1 number of lines in 2nd file
     410         * @return a linked list of changes - or null
    399411         */
    400412        Change build_script(
     
    472484    }
    473485
    474     /** Standard ScriptBuilders. */
    475     public static final ScriptBuilder
    476     forwardScript = new ForwardScript(),
    477     reverseScript = new ReverseScript();
    478 
    479     /** Report the differences of two files. DEPTH is the current directory depth. */
     486    /** Standard Forward ScriptBuilder. */
     487    public static final ScriptBuilder forwardScript = new ForwardScript();
     488    /** Standard Reverse ScriptBuilder. */
     489    public static final ScriptBuilder reverseScript = new ReverseScript();
     490
     491    /**
     492     * Report the differences of two files. DEPTH is the current directory depth.
     493     * @param reverse if {@code true} use {@link #reverseScript} else use {@link #forwardScript}
     494     * @return the differences of two files
     495     */
    480496    public final Change diff_2(final boolean reverse) {
    481497        return diff(reverse ? reverseScript : forwardScript);
    482498    }
    483499
    484     /** Get the results of comparison as an edit script.  The script
    485      is described by a list of changes.  The standard ScriptBuilder
    486      implementations provide for forward and reverse edit scripts.
    487      Alternate implementations could, for instance, list common elements
    488      instead of differences.
    489      @param bld an object to build the script from change flags
    490      @return the head of a list of changes
     500    /**
     501     * Get the results of comparison as an edit script.  The script
     502     * is described by a list of changes.  The standard ScriptBuilder
     503     * implementations provide for forward and reverse edit scripts.
     504     * Alternate implementations could, for instance, list common elements
     505     * instead of differences.
     506     * @param bld an object to build the script from change flags
     507     * @return the head of a list of changes
    491508     */
    492509    public Change diff(final ScriptBuilder bld) {
    493510
    494         /* Some lines are obviously insertions or deletions
    495        because they don't match anything.  Detect them now,
    496        and avoid even thinking about them in the main comparison algorithm.  */
    497 
     511        // Some lines are obviously insertions or deletions because they don't match anything.
     512        // Detect them now, and avoid even thinking about them in the main comparison algorithm.
    498513        discard_confusing_lines();
    499514
    500         /* Now do the main comparison algorithm, considering just the
    501        undiscarded lines.  */
    502 
     515        // Now do the main comparison algorithm, considering just the undiscarded lines.
    503516        xvec = filevec[0].undiscarded;
    504517        yvec = filevec[1].undiscarded;
    505518
    506         int diags =
    507             filevec[0].nondiscardedLines + filevec[1].nondiscardedLines + 3;
     519        int diags = filevec[0].nondiscardedLines + filevec[1].nondiscardedLines + 3;
    508520        fdiag = new int[diags];
    509521        fdiagoff = filevec[1].nondiscardedLines + 1;
     
    512524
    513525        compareseq(0, filevec[0].nondiscardedLines,
    514                 0, filevec[1].nondiscardedLines);
     526                   0, filevec[1].nondiscardedLines);
    515527        fdiag = null;
    516528        bdiag = null;
    517529
    518         /* Modify the results slightly to make them prettier
    519        in cases where that can validly be done.  */
    520 
     530        // Modify the results slightly to make them prettier in cases where that can validly be done.
    521531        shift_boundaries();
    522532
    523         /* Get the results of comparison in the form of a chain
    524        of `struct change's -- an edit script.  */
     533        // Get the results of comparison in the form of a chain of `struct change's -- an edit script.
    525534        return bld.build_script(
    526535                filevec[0].changedFlag,
     
    529538                filevec[1].bufferedLines
    530539        );
    531 
    532540    }
    533541
     
    555563        public final int line1;
    556564
    557         /** Cons an additional entry onto the front of an edit script OLD.
    558        LINE0 and LINE1 are the first affected lines in the two files (origin 0).
    559        DELETED is the number of lines deleted here from file 0.
    560        INSERTED is the number of lines inserted here in file 1.
    561 
    562        If DELETED is 0 then LINE0 is the number of the line before
    563        which the insertion was done; vice versa for INSERTED and LINE1.  */
     565        /**
     566         * Cons an additional entry onto the front of an edit script OLD.
     567         * LINE0 and LINE1 are the first affected lines in the two files (origin 0).
     568         * DELETED is the number of lines deleted here from file 0.
     569         * INSERTED is the number of lines inserted here in file 1.
     570         *
     571         * If DELETED is 0 then LINE0 is the number of the line before
     572         * which the insertion was done; vice versa for INSERTED and LINE1.
     573         * @param line0 first affected lines in the two files (origin 0)
     574         * @param line1 first affected lines in the two files (origin 0)
     575         * @param deleted the number of lines deleted here from file 0
     576         * @param inserted the number of lines inserted here in file 1
     577         * @param old edit script
     578         */
    564579        public Change(int line0, int line1, int deleted, int inserted, Change old) {
    565580            this.line0 = line0;
     
    573588         * Returns the number of insertions and deletions of this change as well as
    574589         * (recursively) the changes linked via {@link #link}.
     590         * @return recursive number of insertions and deletions
    575591         */
    576592        public int getTotalNumberOfChanges() {
     
    585601    }
    586602
    587     /** Data on one input file being compared.
     603    /**
     604     * Data on one input file being compared.
    588605     */
    589606    class FileData {
     
    591608        /** Allocate changed array for the results of comparison.  */
    592609        void clear() {
    593             /* Allocate a flag for each line of each file, saying whether that line
    594                is an insertion or deletion.
    595                Allocate an extra element, always zero, at each end of each vector.
    596              */
     610            // Allocate a flag for each line of each file, saying whether that line is an insertion or deletion.
     611            // Allocate an extra element, always zero, at each end of each vector.
    597612            changedFlag = new boolean[bufferedLines + 2];
    598613        }
    599614
    600         /** Return equiv_count[I] as the number of lines in this file
    601          that fall in equivalence class I.
    602          @return the array of equivalence class counts.
     615        /**
     616         * Return equiv_count[I] as the number of lines in this file that fall in equivalence class I.
     617         * @return the array of equivalence class counts.
    603618         */
    604619        int[] equivCount() {
     
    610625        }
    611626
    612         /** Discard lines that have no matches in another file.
    613 
    614        A line which is discarded will not be considered by the actual
    615        comparison algorithm; it will be as if that line were not in the file.
    616        The file's `realindexes' table maps virtual line numbers
    617        (which don't count the discarded lines) into real line numbers;
    618        this is how the actual comparison algorithm produces results
    619        that are comprehensible when the discarded lines are counted.
    620 <p>
    621        When we discard a line, we also mark it as a deletion or insertion
    622        so that it will be printed in the output.
    623       @param f the other file
     627        /**
     628         * Discard lines that have no matches in another file.
     629         *
     630         * A line which is discarded will not be considered by the actual comparison algorithm;
     631         * it will be as if that line were not in the file.
     632         * The file's `realindexes' table maps virtual line numbers
     633         * (which don't count the discarded lines) into real line numbers;
     634         * this is how the actual comparison algorithm produces results
     635         * that are comprehensible when the discarded lines are counted.
     636         * <p>
     637         * When we discard a line, we also mark it as a deletion or insertion so that it will be printed in the output.
     638         * @param f the other file
    624639         */
    625640        void discard_confusing_lines(FileData f) {
    626641            clear();
    627             /* Set up table of which lines are going to be discarded. */
     642            // Set up table of which lines are going to be discarded.
    628643            final byte[] discarded = discardable(f.equivCount());
    629644
    630             /* Don't really discard the provisional lines except when they occur
    631        in a run of discardables, with nonprovisionals at the beginning
    632        and end.  */
     645            // Don't really discard the provisional lines except when they occur in a run of discardables,
     646            // with nonprovisionals at the beginning and end.
    633647            filterDiscards(discarded);
    634648
    635             /* Actually discard the lines. */
     649            // Actually discard the lines.
    636650            discard(discarded);
    637651        }
     
    674688        /**
    675689         * Don't really discard the provisional lines except when they occur
    676          * in a run of discardables, with nonprovisionals at the beginning
    677          * and end.
     690         * in a run of discardables, with nonprovisionals at the beginning and end.
     691         * @param discards discards
    678692         */
    679693        private void filterDiscards(final byte[] discards) {
  • trunk/src/org/openstreetmap/josm/tools/GBC.java

    r8911 r9231  
    124124    /**
    125125     * Sets the constraint's {@code gridx}, {@code gridy}.
     126     * @param gridx cell containing the leading edge of the component's display area
     127     * @param gridy cell at the top of the component's display area
    126128     * @return This constraint for chaining.
    127129     * @see #gridx
     
    136138    /**
    137139     * Sets the constraint's {@code gridwidth}, {@code gridheight}.
     140     * @param gridwidth number of cells in a row for the component's display area
     141     * @param gridheight number of cells in a column for the component's display area
    138142     * @return This constraint for chaining.
    139143     * @see #gridwidth
     
    148152    /**
    149153     * Sets the constraint's {@code gridwidth}.
     154     * @param gridwidth number of cells in a row for the component's display area
    150155     * @return This constraint for chaining.
    151156     * @see #gridwidth
     
    160165     *
    161166     * Is equivalent to {@code std().grid(gridx, gridy)}
     167     * @param gridx cell containing the leading edge of the component's display area
     168     * @param gridy cell at the top of the component's display area
    162169     * @return A standard constraint.
    163170     * @see #std()
     
    169176        return std().grid(gridx, gridy);
    170177    }
    171 
    172178}
  • trunk/src/org/openstreetmap/josm/tools/Geometry.java

    r9108 r9231  
    258258
    259259    /**
    260      * Finds the intersection of two line segments
     260     * Finds the intersection of two line segments.
     261     * @param p1 the coordinates of the start point of the first specified line segment
     262     * @param p2 the coordinates of the end point of the first specified line segment
     263     * @param p3 the coordinates of the start point of the second specified line segment
     264     * @param p4 the coordinates of the end point of the second specified line segment
    261265     * @return EastNorth null if no intersection was found, the EastNorth coordinates of the intersection otherwise
    262266     */
  • trunk/src/org/openstreetmap/josm/tools/Shortcut.java

    r9059 r9231  
    123123
    124124    /**
    125      * FOR PREF PANE ONLY
     125     * FOR PREF PANE ONLY.<p>
     126     * Sets the modifiers that are used.
     127     * @param assignedModifier assigned modifier
    126128     */
    127129    public void setAssignedModifier(int assignedModifier) {
     
    130132
    131133    /**
    132      * FOR PREF PANE ONLY
     134     * FOR PREF PANE ONLY.<p>
     135     * Sets the key that actually is used.
     136     * @param assignedKey assigned key
    133137     */
    134138    public void setAssignedKey(int assignedKey) {
     
    137141
    138142    /**
    139      * FOR PREF PANE ONLY
     143     * FOR PREF PANE ONLY.<p>
     144     * Sets whether the user has changed this shortcut.
     145     * @param assignedUser {@code true} if the user has changed this shortcut
    140146     */
    141147    public void setAssignedUser(boolean assignedUser) {
     
    202208    /**
    203209     * use this to set a menu's mnemonic
     210     * @param menu menu
    204211     */
    205212    public void setMnemonic(JMenu menu) {
     
    211218    /**
    212219     * use this to set a buttons's mnemonic
     220     * @param button button
    213221     */
    214222    public void setMnemonic(AbstractButton button) {
     
    220228    /**
    221229     * Sets the mnemonic key on a text component.
     230     * @param component component
    222231     */
    223232    public void setFocusAccelerator(JTextComponent component) {
     
    229238    /**
    230239     * use this to set a actions's accelerator
     240     * @param action action
    231241     */
    232242    public void setAccelerator(AbstractAction action) {
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r9217 r9231  
    7777public final class Utils {
    7878
     79    /** Pattern matching white spaces */
    7980    public static final Pattern WHITE_SPACES_PATTERN = Pattern.compile("\\s+");
    8081
     
    311312     * convert float range 0 &lt;= x &lt;= 1 to integer range 0..255
    312313     * when dealing with colors and color alpha value
     314     * @param val float value between 0 and 1
    313315     * @return null if val is null, the corresponding int if val is in the
    314316     *         range 0...1. If val is outside that range, return 255
     
    336338    }
    337339
     340    /**
     341     * Returns the complementary color of {@code clr}.
     342     * @param clr the color to complement
     343     * @return the complementary color of {@code clr}
     344     */
    338345    public static Color complement(Color clr) {
    339346        return new Color(255 - clr.getRed(), 255 - clr.getGreen(), 255 - clr.getBlue(), clr.getAlpha());
Note: See TracChangeset for help on using the changeset viewer.