Changeset 9231 in josm for trunk/src/org
- Timestamp:
- 2016-01-01T02:35:34+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r9070 r9231 909 909 * For dual align, calculates positions of new nodes, aligning them to neighboring segments. 910 910 * Elsewhere, just adds the vetor returned by calculateBestMovement to {@link #initialN1en}, {@link #initialN2en}. 911 * @param mouseEn mouse coordinates 911 912 * @return best movement vector 912 913 */ … … 1109 1110 1110 1111 /** 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 1113 1118 */ 1114 1119 private static boolean isOppositeDirection(EastNorth from1, EastNorth to1, EastNorth from2, EastNorth to2) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
r9059 r9231 18 18 /** 19 19 * 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. 22 21 * 23 22 * MapModes should register/deregister all necessary listeners on the map's view control. … … 30 29 31 30 /** 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. 33 36 * @param mapFrame unused but kept for plugin compatibility. Can be {@code null} 37 * @param cursor cursor displayed when map mode is active 34 38 */ 35 39 public MapMode(String name, String iconName, String tooltip, Shortcut shortcut, MapFrame mapFrame, Cursor cursor) { … … 40 44 41 45 /** 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. 43 50 * @param mapFrame unused but kept for plugin compatibility. Can be {@code null} 51 * @param cursor cursor displayed when map mode is active 44 52 */ 45 53 public MapMode(String name, String iconName, String tooltip, MapFrame mapFrame, Cursor cursor) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r9073 r9231 887 887 * key is pressed. If there is no such node, no action will be done and no error will be 888 888 * reported. If there is, it will execute the merge and add it to the undo buffer. 889 * @param p mouse position 889 890 */ 890 891 private void mergePrims(Point p) { … … 935 936 * Tries to find a node to merge to when in move-merge mode for the current mouse 936 937 * position. Either returns the node or null, if no suitable one is nearby. 938 * @param p mouse position 937 939 * @return node to merge to, or null 938 940 */ … … 1261 1263 1262 1264 /** 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. 1264 1268 */ 1265 1269 protected static <T> Collection<T> asColl(T o) { -
trunk/src/org/openstreetmap/josm/command/MoveCommand.java
r9067 r9231 139 139 } 140 140 141 /** 142 * Move again to the specified coordinates. 143 * @param x X coordinate 144 * @param y Y coordinate 145 * @see #moveAgain 146 */ 141 147 public void moveAgainTo(double x, double y) { 142 148 moveAgain(x - this.x, y - this.y); … … 144 150 145 151 /** 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 148 155 */ 149 156 public void applyVectorTo(EastNorth currentEN) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/SearchBasedRowFilter.java
r8985 r9231 14 14 /** 15 15 * 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. 17 17 * 18 18 * <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 408 408 /** 409 409 * allows to check whether a projection is supported or not 410 * @param proj projection 410 411 * 411 412 * @return True if projection is supported for this layer -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceSetting.java
r8958 r9231 10 10 * Add the GUI elements to the dialog. The elements should be initialized after 11 11 * the current preferences. 12 * @param gui the preferences tab pane 12 13 */ 13 14 void addGui(PreferenceTabbedPane gui); -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r9224 r9231 808 808 /** 809 809 * Constructs a new {@code OffsetBookmarksPanel}. 810 * @param gui the preferences tab pane 810 811 */ 811 812 OffsetBookmarksPanel(final PreferenceTabbedPane gui) { -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r9059 r9231 168 168 } 169 169 170 /** 171 * Returns title from a source entry. 172 * @param entry source entry 173 * @return title 174 * @see MapCSSStyleSource#title 175 */ 170 176 public static String getTitleFromSourceEntry(SourceEntry entry) { 171 177 try { … … 233 239 * the new entries to the user-configured list. Remember the known URLs, 234 240 * so an item that was deleted explicitly is not added again. 241 * @param list new defaults 242 * @return {@code true} if a change occurred 235 243 */ 236 244 private boolean insertNewDefaults(List<SourceEntry> list) { -
trunk/src/org/openstreetmap/josm/gui/progress/PleaseWaitProgressMonitor.java
r9078 r9231 108 108 /** 109 109 * Constructs a new {@code PleaseWaitProgressMonitor}. 110 * @param windowTitle window title 110 111 */ 111 112 public PleaseWaitProgressMonitor(String windowTitle) { … … 116 117 /** 117 118 * Constructs a new {@code PleaseWaitProgressMonitor}. 119 * @param dialogParent component to get parent frame from 118 120 */ 119 121 public PleaseWaitProgressMonitor(Component dialogParent) { … … 129 131 /** 130 132 * Constructs a new {@code PleaseWaitProgressMonitor}. 133 * @param dialogParent component to get parent frame from 134 * @param windowTitle window title 131 135 */ 132 136 public PleaseWaitProgressMonitor(Component dialogParent, String windowTitle) { -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r9078 r9231 413 413 /** 414 414 * applies the current state of the tag editor model to a map of tags 415 * @param keepEmpty {@code true} to keep empty tags 415 416 * 416 417 * @return the map of key/value pairs -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java
r8863 r9231 59 59 } 60 60 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 */ 61 66 public void setNextFocusComponent(Component nextFocusComponent) { 62 67 tagTable.setNextFocusComponent(nextFocusComponent); … … 91 96 } 92 97 98 /** 99 * Returns the paste action. 100 * @return the paste action 101 */ 93 102 public AbstractAction getPasteAction() { 94 103 return tagTable.getPasteAction(); … … 141 150 * Creates a new tag editor panel. The editor model is created 142 151 * internally and can be retrieved with {@link #getModel()}. 152 * @param presetHandler tagging preset handler 143 153 */ 144 154 public TagEditorPanel(TaggingPresetHandler presetHandler) { … … 147 157 148 158 /** 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. 151 160 * 152 161 * @param model the tag editor model 162 * @param presetHandler tagging preset handler 153 163 * @param maxCharacters maximum number of characters allowed, 0 for unlimited 154 164 */ -
trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java
r9078 r9231 504 504 } 505 505 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 */ 506 510 public void setNextFocusComponent(Component nextFocusComponent) { 507 511 this.nextFocusComponent = nextFocusComponent; … … 512 516 } 513 517 514 public void 518 public void addOKAccelatorListener(KeyListener l) { 515 519 addKeyListener(l); 516 520 if (editor != null) { -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletionItemPriority.java
r8958 r9231 106 106 * Merges two priorities. 107 107 * The resulting priority is always >= the original ones. 108 * @param other other priority 108 109 * @return the merged priority 109 110 */ -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPreset.java
r8959 r9231 204 204 /** 205 205 * Called from the XML parser to set the types this preset affects. 206 * @param types comma-separated primitive types ("node", "way", "relation" or "closedway") 206 207 * @throws SAXException if any SAX error occurs 208 * @see TaggingPresetType#fromString 207 209 */ 208 210 public void setType(String types) throws SAXException { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetMenu.java
r8870 r9231 108 108 /** 109 109 * Sorts the menu items using the translated item text 110 * @param menu menu to sort 110 111 */ 111 112 public static void sortMenu(JMenu menu) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/TaggingPresetSelector.java
r8870 r9231 215 215 /** 216 216 * 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 217 219 */ 218 220 public TaggingPresetSelector(boolean displayOnlyApplicable, boolean displaySearchInTags) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/ComboMultiSelect.java
r9044 r9231 258 258 * must be escaped within one entry 259 259 * @param s the string 260 * @return splitted items 260 261 */ 261 262 public static String[] splitEscaped(char delimiter, String s) { -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Roles.java
r8863 r9231 68 68 /** 69 69 * 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 70 73 */ 71 74 public long getValidCount(long c) { -
trunk/src/org/openstreetmap/josm/gui/util/AdjustmentSynchronizer.java
r8509 r9231 72 72 73 73 /** 74 * Sets whether adjustableparticipates in adjustment synchronization or not74 * Sets whether {@code adjustable} participates in adjustment synchronization or not 75 75 * 76 76 * @param adjustable the adjustable 77 * @param isParticipating {@code true} if {@code adjustable} participates in adjustment synchronization 77 78 */ 78 79 protected void setParticipatingInSynchronizedScrolling(Adjustable adjustable, boolean isParticipating) { -
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r9223 r9231 62 62 /** 63 63 * disable / enable a component and all its child components 64 * @param root component 65 * @param enabled enabled state 64 66 */ 65 67 public static void setEnabledRec(Container root, boolean enabled) { -
trunk/src/org/openstreetmap/josm/gui/util/TableHelper.java
r8510 r9231 20 20 * adjust the preferred width of column col to the maximum preferred width of the cells 21 21 * requires JTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); 22 * @param tbl table 23 * @param col column index 24 * @param maxColumnWidth maximum column width 22 25 */ 23 26 public static void adjustColumnWidth(JTable tbl, int col, int maxColumnWidth) { -
trunk/src/org/openstreetmap/josm/gui/widgets/AbstractTextComponentValidator.java
r9059 r9231 92 92 * Alternative constructor that allows to turn off the actionListener. 93 93 * 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 94 96 */ 95 97 public AbstractTextComponentValidator(JTextComponent tc, boolean addActionListener) { … … 97 99 } 98 100 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 */ 99 108 public AbstractTextComponentValidator(JTextComponent tc, boolean addFocusListener, boolean addDocumentListener, boolean addActionListener) { 100 109 CheckParameterUtil.ensureParameterNotNull(tc, "tc"); -
trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitLayout.java
r9074 r9231 94 94 * 95 95 * #see setModel 96 * @param model model 96 97 */ 97 98 public MultiSplitLayout(Node model) { … … 196 197 * Split and Leaf nodes. Typically this property is set to false 197 198 * after the (MultiSplitPane) user has dragged a Divider. 199 * @param floatingDividers boolean value 198 200 * 199 201 * @see #getFloatingDividers … … 690 692 private final transient Node node; 691 693 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 */ 692 699 public InvalidLayoutException(String msg, Node node) { 693 700 super(msg); … … 1234 1241 1235 1242 /** 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, 1244 1247 * 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: 1252 1252 * <pre> 1253 1253 * (ROW (LEAF name=left) (LEAF name=right weight=1.0)) 1254 1254 * </pre> 1255 1255 * 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. 1260 1258 * The previous example can be written like this: 1261 1259 * <pre> … … 1263 1261 * </pre> 1264 1262 * 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 1267 1264 * with two leaves each: 1268 1265 * <pre> … … 1272 1269 * </pre> 1273 1270 * 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 1277 1272 * examples and tests. 1273 * @param s model as string 1278 1274 * 1279 1275 * @return the Node root of a tree based on s. -
trunk/src/org/openstreetmap/josm/gui/widgets/TextContextualPopupMenu.java
r8840 r9231 81 81 * A menu can only be attached to a single component. 82 82 * @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 83 84 * @return {@code this} 84 85 * @see #detach() -
trunk/src/org/openstreetmap/josm/io/FileImporter.java
r8929 r9231 19 19 import org.openstreetmap.josm.gui.util.GuiHelper; 20 20 21 /** 22 * Abstract file importer. 23 * @since 1637 24 */ 21 25 public abstract class FileImporter implements Comparable<FileImporter>, LayerChangeListener { 22 26 … … 77 81 78 82 /** 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 80 86 * @return true if data import was successful 81 87 */ … … 121 127 } 122 128 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 */ 123 135 public boolean importDataHandleExceptions(List<File> files, ProgressMonitor progressMonitor) { 124 136 try { -
trunk/src/org/openstreetmap/josm/io/GpxExporter.java
r8870 r9231 248 248 /** 249 249 * 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 250 262 */ 251 263 private static void addDependencies( -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r9078 r9231 499 499 /** 500 500 * convert url/urlname to link element (GPX 1.0 -> GPX 1.1). 501 * @param attr attributes 501 502 */ 502 503 private void convertUrlToLink(Map<String, Object> attr) { … … 509 510 GpxLink link = new GpxLink(url); 510 511 link.text = urlname; 511 @SuppressWarnings( { "unchecked", "rawtypes" })512 @SuppressWarnings("unchecked") 512 513 Collection<GpxLink> links = (Collection<GpxLink>) attr.get(META_LINKS); 513 514 links.add(link); … … 531 532 * @throws IOException if an IO error occurs, e.g. the input stream is closed. 532 533 */ 533 @SuppressWarnings("resource")534 534 public GpxReader(InputStream source) throws IOException { 535 535 Reader utf8stream = UTFInputStreamReader.create(source); -
trunk/src/org/openstreetmap/josm/io/GpxWriter.java
r8846 r9231 248 248 * if content not null, open tag, write encoded content, and close tag 249 249 * else do nothing. 250 * @param tag GPX tag 251 * @param content content 250 252 */ 251 253 private void simpleTag(String tag, String content) { … … 260 262 /** 261 263 * output link 264 * @param link link 262 265 */ 263 266 private void gpxLink(GpxLink link) { … … 272 275 /** 273 276 * 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} 274 279 */ 275 280 private void wayPoint(WayPoint pnt, int mode) { -
trunk/src/org/openstreetmap/josm/io/MultiFetchServerObjectReader.java
r9078 r9231 299 299 * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY}, 300 300 * {@link OsmPrimitiveType#RELATION RELATION} 301 * @param progressMonitor progress monitor 301 302 * @throws OsmTransferException if an error occurs while communicating with the API server 302 303 */ … … 485 486 * {@link OsmPrimitiveType#RELATION RELATION} 486 487 * @param pkg the package of ids 488 * @param progressMonitor progress monitor 487 489 * @return the {@link FetchResult} of this operation 488 490 * @throws OsmTransferException if an error occurs while communicating with the API server … … 513 515 * {@link OsmPrimitiveType#RELATION RELATION} 514 516 * @param id the id 517 * @param progressMonitor progress monitor 515 518 * @return the {@link DataSet} resulting of this operation 516 519 * @throws OsmTransferException if an error occurs while communicating with the API server … … 544 547 * {@link OsmPrimitiveType#RELATION RELATION} 545 548 * @param pkg the set of ids 549 * @param progressMonitor progress monitor 546 550 * @return the {@link FetchResult} of this operation 547 551 * @throws OsmTransferException if an error occurs while communicating with the API server -
trunk/src/org/openstreetmap/josm/io/OsmReader.java
r9087 r9231 57 57 private static volatile List<OsmServerReadPostprocessor> postprocessors; 58 58 59 /** register a new postprocessor */ 59 /** Register a new postprocessor. 60 * @param pp postprocessor 61 * @see #deregisterPostprocessor 62 */ 60 63 public static void registerPostprocessor(OsmServerReadPostprocessor pp) { 61 64 if (postprocessors == null) { … … 65 68 } 66 69 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 */ 68 75 public static void deregisterPostprocessor(OsmServerReadPostprocessor pp) { 69 76 if (postprocessors != null) { … … 399 406 * This is basically the same code as parseUnknown(), except for the warnings, which 400 407 * 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 401 409 * @throws XMLStreamException if there is an error processing the underlying XML source 402 410 */ … … 432 440 /** 433 441 * Read out the common attributes and put them into current OsmPrimitive. 442 * @param current primitive to update 434 443 * @throws XMLStreamException if there is an error processing the underlying XML source 435 444 */ -
trunk/src/org/openstreetmap/josm/io/OsmServerBackreferenceReader.java
r8510 r9231 148 148 * Reads referring ways from the API server and replies them in a {@link DataSet} 149 149 * 150 * @param progressMonitor progress monitor 150 151 * @return the data set 151 152 * @throws OsmTransferException if any error occurs during dialog with OSM API -
trunk/src/org/openstreetmap/josm/io/OsmServerHistoryReader.java
r9078 r9231 50 50 /** 51 51 * Fetches the history from the OSM API and parses it 52 * @param progressMonitor progress monitor 52 53 * 53 54 * @return the data set with the parsed history data -
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r9078 r9231 256 256 /** 257 257 * Calls all registered upload postprocessors. 258 * @param pm progress monitor 258 259 */ 259 260 public void executePostprocessors(ProgressMonitor pm) { -
trunk/src/org/openstreetmap/josm/io/OsmWriter.java
r9078 r9231 46 46 47 47 /** 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) 49 52 */ 50 53 protected OsmWriter(PrintWriter out, boolean osmConform, String version) { … … 279 282 * Add the common part as the form of the tag as well as the XML attributes 280 283 * id, action, user, and visible. 284 * @param osm osm primitive 285 * @param tagname XML tag matching osm primitive (node, way, relation) 281 286 */ 282 287 protected void addCommon(IPrimitive osm, String tagname) { -
trunk/src/org/openstreetmap/josm/io/UTFInputStreamReader.java
r8926 r9231 15 15 /** 16 16 * Creates a new {@link InputStreamReader} from the {@link InputStream} with UTF-8 as default encoding. 17 * @param input input stream 17 18 * @return A reader with the correct encoding. Starts to read after the BOM. 18 19 * @throws IOException if any I/O error occurs … … 25 26 /** 26 27 * Creates a new {@link InputStreamReader} from the {@link InputStream}. 28 * @param input input stream 27 29 * @param defaultEncoding Used, when no BOM was recognized. Can be null. 28 30 * @return A reader with the correct encoding. Starts to read after the BOM. -
trunk/src/org/openstreetmap/josm/io/XmlWriter.java
r8929 r9231 17 17 protected final PrintWriter out; 18 18 19 /** 20 * Constructs a new {@code XmlWriter}. 21 * @param out print writer 22 */ 19 23 public XmlWriter(PrintWriter out) { 20 24 this.out = out; … … 30 34 } 31 35 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 */ 32 43 public static String encode(String unencoded) { 33 44 return encode(unencoded, false); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
r9078 r9231 119 119 /** 120 120 * 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 121 124 */ 122 125 public AddTagsDialog(String[][] tags, String senderName, Collection<? extends OsmPrimitive> primitives) { … … 260 263 * parse addtags parameters Example URL (part): 261 264 * 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 262 268 */ 263 269 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 301 301 * @param out 302 302 * The writer where the error is written 303 * @param help 304 * Optional HTML help content to display, can be null 303 305 * @throws IOException 304 306 * If the error can not be written … … 323 325 * @param out 324 326 * The writer where the error is written 327 * @param help 328 * Optional HTML help content to display, can be null 325 329 * @throws IOException 326 330 * If the error can not be written -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java
r8929 r9231 122 122 * Find the node with almost the same coords in dataset or in already added nodes 123 123 * @param ll coordinates 124 * @param commands list of commands that will be modified if needed 124 125 * @return node with almost the same coords 125 126 * @since 5845 126 127 */ 127 Node findOrCreateNode(LatLon ll, 128 Node findOrCreateNode(LatLon ll, List<Command> commands) { 128 129 Node nd = null; 129 130 -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r9087 r9231 145 145 * Add a task, e.g. a message dialog, that should 146 146 * be executed in EDT after all layers have been added. 147 * @param task task to run in EDT 147 148 */ 148 149 public void addPostLayersTask(Runnable task) { -
trunk/src/org/openstreetmap/josm/io/session/SessionWriter.java
r9078 r9231 65 65 * 66 66 * 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 67 69 */ 68 70 public static void registerSessionLayerExporter(Class<? extends Layer> layerClass, Class<? extends SessionLayerExporter> exporter) { … … 95 97 * @param active The index of active layer in {@code layers} (starts at 0). Ignored if set to -1 96 98 * @param exporters The exporters to use to save layers 99 * @param dependencies layer dependencies 97 100 * @param zip {@code true} if a joz archive has to be created, {@code false otherwise} 98 101 * @since 6271 -
trunk/src/org/openstreetmap/josm/plugins/Plugin.java
r8928 r9231 101 101 * Called in the download dialog to give the plugin a chance to modify the list 102 102 * of bounding box selectors. 103 * @param list list of bounding box selectors 103 104 */ 104 105 public void addDownloadSelection(List<DownloadSelection> list) {} … … 106 107 /** 107 108 * Copies the resource 'from' to the file in the plugin directory named 'to'. 109 * @param from source file 110 * @param to target file 108 111 * @throws FileNotFoundException if the file exists but is a directory rather than a regular file, 109 112 * does not exist but cannot be created, or cannot be opened for any other reason … … 149 152 final URL pluginJarUrl = Utils.fileToURL(pluginJar); 150 153 return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() { 154 @Override 151 155 public ClassLoader run() { 152 156 return new URLClassLoader(new URL[] {pluginJarUrl}, Main.class.getClassLoader()); -
trunk/src/org/openstreetmap/josm/tools/CheckParameterUtil.java
r8506 r9231 98 98 * Ensures that the condition {@code condition} holds. 99 99 * @param condition The condition to check 100 * @param message error message 100 101 * @throws IllegalArgumentException if the condition does not hold 101 102 */ -
trunk/src/org/openstreetmap/josm/tools/CopyList.java
r8840 r9231 16 16 * 17 17 * @author nenik 18 * @param <E> the type of elements in this list 18 19 */ 19 20 public final class CopyList<E> extends AbstractList<E> implements RandomAccess, Cloneable { … … 24 25 /** 25 26 * 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}. 28 28 */ 29 29 public CopyList(E[] array) { … … 31 31 } 32 32 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 */ 33 38 public CopyList(E[] array, int size) { 34 39 this.array = array; -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r8976 r9231 152 152 * the worst this can do is cause suboptimal diff output. 153 153 * 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 154 159 */ 155 160 private int diag(int xoff, int xlim, int yoff, int ylim) { … … 164 169 int fmin = fmid, fmax = fmid; // Limits of top-down search. 165 170 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. 168 172 final boolean odd = (fmid - bmid & 1) != 0; 169 173 … … 315 319 } 316 320 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 */ 328 337 private void compareseq(int xoff, int xlim, int yoff, int ylim) { 329 338 /* Slide down the bottom initial diagonal. */ … … 379 388 private boolean inhibit; 380 389 381 /** Adjust inserts/deletes of blank lines to join changes382 390 /** 391 * Adjust inserts/deletes of blank lines to join changes as much as possible. 383 392 */ 384 393 private void shift_boundaries() { … … 389 398 } 390 399 400 /** 401 * Script builder. 402 */ 391 403 public interface ScriptBuilder { 392 /** Scan the tables of which lines are inserted and deleted,393 394 395 396 397 398 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 399 411 */ 400 412 Change build_script( … … 472 484 } 473 485 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 */ 480 496 public final Change diff_2(final boolean reverse) { 481 497 return diff(reverse ? reverseScript : forwardScript); 482 498 } 483 499 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 491 508 */ 492 509 public Change diff(final ScriptBuilder bld) { 493 510 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. 498 513 discard_confusing_lines(); 499 514 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. 503 516 xvec = filevec[0].undiscarded; 504 517 yvec = filevec[1].undiscarded; 505 518 506 int diags = 507 filevec[0].nondiscardedLines + filevec[1].nondiscardedLines + 3; 519 int diags = filevec[0].nondiscardedLines + filevec[1].nondiscardedLines + 3; 508 520 fdiag = new int[diags]; 509 521 fdiagoff = filevec[1].nondiscardedLines + 1; … … 512 524 513 525 compareseq(0, filevec[0].nondiscardedLines, 514 0, filevec[1].nondiscardedLines);526 0, filevec[1].nondiscardedLines); 515 527 fdiag = null; 516 528 bdiag = null; 517 529 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. 521 531 shift_boundaries(); 522 532 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. 525 534 return bld.build_script( 526 535 filevec[0].changedFlag, … … 529 538 filevec[1].bufferedLines 530 539 ); 531 532 540 } 533 541 … … 555 563 public final int line1; 556 564 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 */ 564 579 public Change(int line0, int line1, int deleted, int inserted, Change old) { 565 580 this.line0 = line0; … … 573 588 * Returns the number of insertions and deletions of this change as well as 574 589 * (recursively) the changes linked via {@link #link}. 590 * @return recursive number of insertions and deletions 575 591 */ 576 592 public int getTotalNumberOfChanges() { … … 585 601 } 586 602 587 /** Data on one input file being compared. 603 /** 604 * Data on one input file being compared. 588 605 */ 589 606 class FileData { … … 591 608 /** Allocate changed array for the results of comparison. */ 592 609 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. 597 612 changedFlag = new boolean[bufferedLines + 2]; 598 613 } 599 614 600 /** Return equiv_count[I] as the number of lines in this file601 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. 603 618 */ 604 619 int[] equivCount() { … … 610 625 } 611 626 612 /** Discard lines that have no matches in another file.613 614 A line which is discarded will not be considered by the actual615 comparison algorithm; it will be as if that line were not in the file.616 The file's `realindexes' table maps virtual line numbers617 (which don't count the discarded lines) into real line numbers;618 this is how the actual comparison algorithm produces results619 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 insertion622 so that it will be printed in the output.623 @param f the other file627 /** 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 624 639 */ 625 640 void discard_confusing_lines(FileData f) { 626 641 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. 628 643 final byte[] discarded = discardable(f.equivCount()); 629 644 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. 633 647 filterDiscards(discarded); 634 648 635 / * Actually discard the lines. */649 // Actually discard the lines. 636 650 discard(discarded); 637 651 } … … 674 688 /** 675 689 * 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 678 692 */ 679 693 private void filterDiscards(final byte[] discards) { -
trunk/src/org/openstreetmap/josm/tools/GBC.java
r8911 r9231 124 124 /** 125 125 * 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 126 128 * @return This constraint for chaining. 127 129 * @see #gridx … … 136 138 /** 137 139 * 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 138 142 * @return This constraint for chaining. 139 143 * @see #gridwidth … … 148 152 /** 149 153 * Sets the constraint's {@code gridwidth}. 154 * @param gridwidth number of cells in a row for the component's display area 150 155 * @return This constraint for chaining. 151 156 * @see #gridwidth … … 160 165 * 161 166 * 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 162 169 * @return A standard constraint. 163 170 * @see #std() … … 169 176 return std().grid(gridx, gridy); 170 177 } 171 172 178 } -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r9108 r9231 258 258 259 259 /** 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 261 265 * @return EastNorth null if no intersection was found, the EastNorth coordinates of the intersection otherwise 262 266 */ -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r9059 r9231 123 123 124 124 /** 125 * FOR PREF PANE ONLY 125 * FOR PREF PANE ONLY.<p> 126 * Sets the modifiers that are used. 127 * @param assignedModifier assigned modifier 126 128 */ 127 129 public void setAssignedModifier(int assignedModifier) { … … 130 132 131 133 /** 132 * FOR PREF PANE ONLY 134 * FOR PREF PANE ONLY.<p> 135 * Sets the key that actually is used. 136 * @param assignedKey assigned key 133 137 */ 134 138 public void setAssignedKey(int assignedKey) { … … 137 141 138 142 /** 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 140 146 */ 141 147 public void setAssignedUser(boolean assignedUser) { … … 202 208 /** 203 209 * use this to set a menu's mnemonic 210 * @param menu menu 204 211 */ 205 212 public void setMnemonic(JMenu menu) { … … 211 218 /** 212 219 * use this to set a buttons's mnemonic 220 * @param button button 213 221 */ 214 222 public void setMnemonic(AbstractButton button) { … … 220 228 /** 221 229 * Sets the mnemonic key on a text component. 230 * @param component component 222 231 */ 223 232 public void setFocusAccelerator(JTextComponent component) { … … 229 238 /** 230 239 * use this to set a actions's accelerator 240 * @param action action 231 241 */ 232 242 public void setAccelerator(AbstractAction action) { -
trunk/src/org/openstreetmap/josm/tools/Utils.java
r9217 r9231 77 77 public final class Utils { 78 78 79 /** Pattern matching white spaces */ 79 80 public static final Pattern WHITE_SPACES_PATTERN = Pattern.compile("\\s+"); 80 81 … … 311 312 * convert float range 0 <= x <= 1 to integer range 0..255 312 313 * when dealing with colors and color alpha value 314 * @param val float value between 0 and 1 313 315 * @return null if val is null, the corresponding int if val is in the 314 316 * range 0...1. If val is outside that range, return 255 … … 336 338 } 337 339 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 */ 338 345 public static Color complement(Color clr) { 339 346 return new Color(255 - clr.getRed(), 255 - clr.getGreen(), 255 - clr.getBlue(), clr.getAlpha());
Note:
See TracChangeset
for help on using the changeset viewer.