Changeset 5275 in josm
- Timestamp:
- 2012-06-09T20:03:41+02:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/DeleteAction.java
r4982 r5275 2 2 package org.openstreetmap.josm.actions; 3 3 4 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;6 6 7 7 import java.awt.event.ActionEvent; -
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r5266 r5275 15 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 16 import org.openstreetmap.josm.gui.MapView; 17 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 17 18 import org.openstreetmap.josm.gui.layer.Layer; 18 19 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 25 26 * 26 27 * A JosmAction is a {@link LayerChangeListener} and a {@link SelectionChangedListener}. Upon 27 * a layer change event or a selection change event it invokes {@link #updateEnabled ()}.28 * Subclasses can override {@link #updateEnabled ()} in order to update the {@link #isEnabled()}-state28 * a layer change event or a selection change event it invokes {@link #updateEnabledState()}. 29 * Subclasses can override {@link #updateEnabledState()} in order to update the {@link #isEnabled()}-state 29 30 * of a JosmAction depending on the {@link #getCurrentDataSet()} and the current layers 30 31 * (see also {@link #getEditLayer()}). -
trunk/src/org/openstreetmap/josm/actions/PasteTagsAction.java
r5266 r5275 1 1 // License: GPL. Copyright 2007 by Immanuel Scholz and others 2 // Author: David Earl3 2 package org.openstreetmap.josm.actions; 4 3 … … 29 28 import org.openstreetmap.josm.tools.Shortcut; 30 29 30 /** 31 * Action, to paste all tags from one primitive to another. 32 * 33 * It will take the primitive from the copy-paste buffer an apply all its tags 34 * to the selected primitive(s). 35 * 36 * @author David Earl 37 */ 31 38 public final class PasteTagsAction extends JosmAction implements PasteBufferChangedListener { 32 39 … … 54 61 * Replies true if the source for tag pasting is heterogeneous, i.e. if it doesn't consist of 55 62 * {@link OsmPrimitive}s of exactly one type 56 *57 * @return58 63 */ 59 64 protected boolean isHeteogeneousSource() { … … 130 135 131 136 /** 132 * Pastes the tags from a homogeneous source ( i.e.the {@link Main#pasteBuffer}s selection consisting133 * of one type of {@link OsmPrimitive}s only .137 * Pastes the tags from a homogeneous source (the {@link Main#pasteBuffer}s selection consisting 138 * of one type of {@link OsmPrimitive}s only). 134 139 * 135 140 * Tags from a homogeneous source can be pasted to a heterogeneous target. All target primitives, 136 141 * regardless of their type, receive the same tags. 137 *138 * @param targets the collection of target primitives139 142 */ 140 143 protected void pasteFromHomogeneousSource() { … … 166 169 167 170 /** 168 * Replies true if there is at least one primitive of type <code>type</code> in the collection 169 * <code>selection</code> 170 * 171 * @param <T> 172 * @param selection the collection of primitives 171 * Replies true if there is at least one primitive of type <code>type</code> 172 * is in the target collection 173 * 174 * @param <T> 173 175 * @param type the type to look for 174 176 * @return true if there is at least one primitive of type <code>type</code> in the collection … … 199 201 * Pastes the tags in the current selection of the paste buffer to a set of target 200 202 * primitives. 201 *202 * @param targets the collection of target primitives203 203 */ 204 204 protected void pasteFromHeterogeneousSource() { -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/PostDownloadHandler.java
r5149 r5275 36 36 * constructor 37 37 * @param task the asynchronous download task 38 * @param future the futureon which the completion of the download task can be synchronized38 * @param futures the futures on which the completion of the download task can be synchronized 39 39 */ 40 40 public PostDownloadHandler(DownloadTask task, Future<?> ... futures) { … … 50 50 * constructor 51 51 * @param task the asynchronous download task 52 * @param future the futureon which the completion of the download task can be synchronized52 * @param futures the futures on which the completion of the download task can be synchronized 53 53 */ 54 54 public PostDownloadHandler(DownloadTask task, List<Future<?>> futures) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r5266 r5275 33 33 34 34 /** 35 * A n actionthat enables the user to delete nodes and other objects.35 * A map mode that enables the user to delete nodes and other objects. 36 36 * 37 37 * The user can click on an object, which gets deleted if possible. When Ctrl is … … 43 43 * 44 44 * If the user enters the mapmode and any object is selected, all selected 45 * objects that can be deleted will.45 * objects are deleted, if possible. 46 46 * 47 47 * @author imi … … 162 162 /** 163 163 * Listen to mouse move to be able to update the cursor (and highlights) 164 * @param MouseEventThe mouse event that has been captured164 * @param e The mouse event that has been captured 165 165 */ 166 166 @Override public void mouseMoved(MouseEvent e) { … … 256 256 * highlights 257 257 * 258 * @param MouseEvent259 * @param intmodifiers258 * @param e 259 * @param modifiers 260 260 */ 261 261 private void updateCursor(MouseEvent e, int modifiers) { … … 330 330 331 331 /** 332 * Deletes the relation in the context of the given layer. Also notifies 333 * {@link RelationDialogManager} and {@link OsmDataLayer#fireDataChange()} events. 332 * Deletes the relation in the context of the given layer. 334 333 * 335 334 * @param layer the layer in whose context the relation is deleted. Must not be null. … … 385 384 * that should be deleted but does not actually delete them. 386 385 * @param e MouseEvent from which modifiers and position are taken 387 * @param intmodifiers For explanation: @see updateCursor386 * @param modifiers For explanation: @see updateCursor 388 387 * @param silet Set to true if the user should not be bugged with additional 389 388 * dialogs -
trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
r5266 r5275 14 14 15 15 import org.openstreetmap.josm.Main; 16 import org.openstreetmap.josm.data.osm.OsmPrimitive; 16 17 import org.openstreetmap.josm.io.ChangesetClosedException; 17 18 import org.openstreetmap.josm.io.IllegalDataException; -
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r5266 r5275 42 42 * General configurable dialog window. 43 43 * 44 * If dialog is modal, you can use getValue()to retrieve the44 * If dialog is modal, you can use {@link #getValue()} to retrieve the 45 45 * button index. Note that the user can close the dialog 46 46 * by other means. This is usually equivalent to cancel action. 47 47 * 48 * For non-modal dialogs, buttonAction(int)can be overridden.48 * For non-modal dialogs, {@link #buttonAction(int, ActionEvent)} can be overridden. 49 49 * 50 50 * There are various options, see below. 51 51 * 52 52 * Note: The button indices are counted from 1 and upwards. 53 * So for getValue(), setDefaultButton(int) and setCancelButton(int) the54 * first button has index 1.53 * So for {@link #getValue()}, {@link #setDefaultButton(int)} and 54 * {@link #setCancelButton} the first button has index 1. 55 55 * 56 56 * Simple example: 57 * < code>57 * <pre> 58 58 * ExtendedDialog ed = new ExtendedDialog( 59 59 * Main.parent, tr("Dialog Title"), … … 66 66 * // proceed... 67 67 * } 68 * </ code>68 * </pre> 69 69 */ 70 70 public class ExtendedDialog extends JDialog { … … 171 171 172 172 /** 173 * Allows decorating the buttons with tooltips. Expects a n String[] with translated174 * t ooltip texts.173 * Allows decorating the buttons with tooltips. Expects a String array with 174 * translated tooltip texts. 175 175 * 176 176 * @param toolTipTexts the tool tip texts. Ignored, if null. … … 224 224 /** 225 225 * Decorate the dialog with an icon that is shown on the left part of 226 * the window area. (Similar to how it is done in JOptionPane)226 * the window area. (Similar to how it is done in {@link JOptionPane}) 227 227 */ 228 228 public ExtendedDialog setIcon(Icon icon) { … … 232 232 233 233 /** 234 * Convenience method to allow values that would be accepted by JOptionPaneas messageType.234 * Convenience method to allow values that would be accepted by {@link JOptionPane} as messageType. 235 235 */ 236 236 public ExtendedDialog setIcon(int messageType) { … … 253 253 /** 254 254 * Show the dialog to the user. Call this after you have set all options 255 * for the dialog. You can retrieve the result using <code>getValue</code>255 * for the dialog. You can retrieve the result using {@link #getValue()}. 256 256 */ 257 257 public ExtendedDialog showDialog() { … … 273 273 274 274 /** 275 * @return int * The selected button. The count starts with 1. 276 * * A return value of ExtendedDialog.DialogClosedOtherwise means the dialog has been closed otherwise. 275 * Retrieve the user choice after the dialog has been closed. 276 * 277 * @return <ul> <li>The selected button. The count starts with 1.</li> 278 * <li>A return value of {@link #DialogClosedOtherwise} means the dialog has been closed otherwise.</li> 279 * </ul> 277 280 */ 278 281 public int getValue() { … … 283 286 284 287 /** 285 * This is called by showDialog().288 * This is called by {@link #showDialog()}. 286 289 * Only invoke from outside if you need to modify the contentPane 287 290 */ … … 402 405 /** 403 406 * This gets performed whenever a button is clicked or activated 407 * @param buttonIndex the button index (first index is 0) 404 408 * @param evt the button event 405 409 */ … … 574 578 /** 575 579 * This function checks the state of the "Do not show again" checkbox and 576 * writes the corresponding pref 580 * writes the corresponding pref. 577 581 */ 578 582 private void toggleSaveState() { -
trunk/src/org/openstreetmap/josm/gui/FileDrop.java
r3710 r5275 134 134 * 135 135 * @param out PrintStream to record debugging info or null for no debugging. 136 * @param out137 136 * @param c Component on which files will be dropped. 138 137 * @param listener Listens for <tt>filesDropped</tt>. … … 161 160 * 162 161 * @param out PrintStream to record debugging info or null for no debugging. 163 * @param out164 162 * @param c Component on which files will be dropped. 165 163 * @param recursive Recursively set children as drop targets. -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r5266 r5275 42 42 import javax.swing.event.ChangeEvent; 43 43 import javax.swing.event.ChangeListener; 44 import javax.swing.event.ListDataEvent; 44 45 import javax.swing.event.ListSelectionEvent; 45 46 import javax.swing.event.ListSelectionListener; -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r5233 r5275 84 84 85 85 /** 86 * A layer holdingdata from a specific dataset.86 * A layer that holds OSM data from a specific dataset. 87 87 * The data can be fully edited. 88 88 * -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java
r5219 r5275 89 89 else 90 90 return ImageProvider.overlay(getSourceIcon(), 91 "dialogs/mappaint/error_small",91 ImageProvider.get("dialogs/mappaint/error_small"), 92 92 ImageProvider.OverlayPosition.SOUTHEAST); 93 93 } -
trunk/src/org/openstreetmap/josm/tools/GBC.java
r3894 r5275 98 98 /** 99 99 * Specifies how to distribute extra horizontal space. 100 * @param wei dhtx Weight in horizontal direction100 * @param weightx Weight in horizontal direction 101 101 * @param weighty Weight in vertical direction 102 102 * @return This constraint for chaining. … … 114 114 * @param y If higher than 0, this will be a vertical glue with y as minimum 115 115 * vertical strut. 116 * @return the glue component 116 117 */ 117 118 public static Component glue(int x, int y) { -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r5266 r5275 32 32 33 33 /** 34 * Will find all intersection and add nodes there for list of given ways. Handles self-intersections too.35 * And make commands to add the intersection points to ways.36 * @param List<Way> - a list of ways to test37 * @return ArrayList<Node> List of new nodes34 * Will find all intersection and add nodes there for list of given ways. 35 * Handles self-intersections too. 36 * And makes commands to add the intersection points to ways. 37 * 38 38 * Prerequisite: no two nodes have the same coordinates. 39 * 40 * @param ways a list of ways to test 41 * @param test if false, do not build list of Commands, just return nodes 42 * @param cmds list of commands, typically empty when handed to this method. 43 * Will be filled with commands that add intersection nodes to 44 * the ways. 45 * @return list of new nodes 39 46 */ 40 47 public static Set<Node> addIntersections(List<Way> ways, boolean test, List<Command> cmds) { … … 472 479 473 480 /** 474 * returns area of a closed way in square meters481 * Returns area of a closed way in square meters. 475 482 * (approximate(?), but should be OK for small areas) 483 * 484 * Relies on the current projection: Works correctly, when 485 * one unit in projected coordinates corresponds to one meter. 486 * This is true for most projections, but not for WGS84 and 487 * Mercator (EPSG:3857). 488 * 489 * @param way Way to measure, should be closed (first node is the same as last node) 490 * @return area of the closed way. 476 491 */ 477 492 public static double closedWayArea(Way way) { … … 532 547 * If the area is negative the way is ordered in a clockwise direction. 533 548 * 549 * See http://paulbourke.net/geometry/polyarea/ 550 * 534 551 * @param w the way to be checked. 535 552 * @return true if and only if way is oriented clockwise. 536 553 * @throws IllegalArgumentException if way is not closed (see {@link Way#isClosed}). 537 * @see http://paulbourke.net/geometry/polyarea/538 554 */ 539 555 public static boolean isClockwise(Way w) { -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r5056 r5275 115 115 116 116 /** 117 * @param subdir Subdirectory the image lies in.118 * @param name The name of the image. If it does not end with '.png' or '.svg',117 * @param subdir subdirectory the image lies in 118 * @param name the name of the image. If it does not end with '.png' or '.svg', 119 119 * both extensions are tried. 120 120 */ … … 137 137 138 138 /** 139 * An id used for caching. Id is not used for cache if name starts with http://. (URL is unique anyway.) 139 * Set an id used for caching. 140 * If name starts with <tt>http://</tt> Id is not used for the cache. 141 * (A URL is unique anyway.) 140 142 */ 141 143 public ImageProvider setId(String id) { … … 145 147 146 148 /** 147 * A zip file where the image is located. 149 * Specify a zip file where the image is located. 150 * 151 * (optional) 148 152 */ 149 153 public ImageProvider setArchive(File archive) { … … 153 157 154 158 /** 155 * The dimensions of the image.159 * Set the dimensions of the image. 156 160 * 157 161 * If not specified, the original size of the image is used. … … 166 170 167 171 /** 168 * seesetSize172 * @see #setSize 169 173 */ 170 174 public ImageProvider setWidth(int width) { … … 174 178 175 179 /** 176 * seesetSize180 * @see #setSize 177 181 */ 178 182 public ImageProvider setHeight(int height) { … … 182 186 183 187 /** 184 * The maximum size of the image.188 * Limit the maximum size of the image. 185 189 * 186 190 * It will shrink the image if necessary, but keep the aspect ratio. … … 196 200 197 201 /** 198 * seesetMaxSize202 * @see #setMaxSize 199 203 */ 200 204 public ImageProvider setMaxWidth(int maxWidth) { … … 204 208 205 209 /** 206 * seesetMaxSize210 * @see #setMaxSize 207 211 */ 208 212 public ImageProvider setMaxHeight(int maxHeight) { … … 212 216 213 217 /** 214 * The image URL comes from user data and the image may be missing. 215 * 216 * Set true, if JOSM should *not* throw a RuntimeException in case the image cannot be located. 218 * Decide, if an exception should be thrown, when the image cannot be located. 219 * 220 * Set to true, when the image URL comes from user data and the image may be missing. 221 * 222 * @param optional true, if JOSM should <b>not</b> throw a RuntimeException 223 * in case the image cannot be located. 224 * @return the current object, for convenience 217 225 */ 218 226 public ImageProvider setOptional(boolean optional) { … … 241 249 /** 242 250 * Execute the image request. 251 * @return the requested image or null if the request failed 243 252 */ 244 253 public ImageIcon get() { … … 267 276 * asynchronously. 268 277 * 269 * @param callback is called, when the image is ready. This can happen 270 * before the call to getInBackground returns or it may be invoked some 271 * time (seconds) later. 272 * If no image is available, a null value is returned to callback (just 273 * like ImageProvider.get). 278 * @param callback a callback. It is called, when the image is ready. 279 * This can happen before the call to this method returns or it may be 280 * invoked some time (seconds) later. If no image is available, a null 281 * value is returned to callback (just like {@link #get}). 274 282 */ 275 283 public void getInBackground(final ImageCallback callback) { … … 290 298 291 299 /** 292 * Return an image from the specified location. Throws a RuntimeException if 293 * the image cannot be located. 294 * 295 * @param subdir The position of the directory, e.g. 'layer' 296 * @param name The icons name (with or without '.png' or '.svg' extension) 300 * Load an image with a given file name. 301 * 302 * @param subdir subdirectory the image lies in 303 * @param name The icon name (base name with or without '.png' or '.svg' extension) 297 304 * @return The requested Image. 305 * @throws RuntimeException if the image cannot be located 298 306 */ 299 307 public static ImageIcon get(String subdir, String name) { … … 301 309 } 302 310 311 /** 312 * @see #get(java.lang.String, java.lang.String) 313 */ 303 314 public static ImageIcon get(String name) { 304 315 return new ImageProvider(name).get(); 305 316 } 306 317 318 /** 319 * Load an image with a given file name, but do not throw an exception 320 * when the image cannot be found. 321 * @see #get(java.lang.String, java.lang.String) 322 */ 323 public static ImageIcon getIfAvailable(String subdir, String name) { 324 return new ImageProvider(subdir, name).setOptional(true).get(); 325 } 326 327 /** 328 * @see #getIfAvailable(java.lang.String, java.lang.String) 329 */ 307 330 public static ImageIcon getIfAvailable(String name) { 308 331 return new ImageProvider(name).setOptional(true).get(); 309 }310 311 public static ImageIcon getIfAvailable(String subdir, String name) {312 return new ImageProvider(subdir, name).setOptional(true).get();313 332 } 314 333 … … 691 710 ImageIcon img = get("cursor", name); 692 711 if (overlay != null) { 693 img = overlay(img, "cursor/modifier/" + overlay, OverlayPosition.SOUTHEAST);712 img = overlay(img, ImageProvider.get("cursor/modifier/" + overlay), OverlayPosition.SOUTHEAST); 694 713 } 695 714 Cursor c = Toolkit.getDefaultToolkit().createCustomCursor(img.getImage(), … … 698 717 } 699 718 700 /** 719 @Deprecated 720 public static ImageIcon overlay(Icon ground, String overlayImage, OverlayPosition pos) { 721 return overlay(ground, ImageProvider.get(overlayImage), pos); 722 } 723 724 /** 725 * Decorate one icon with an overlay icon. 726 * 727 * @param ground the base image 728 * @param overlay the overlay image (can be smaller than the base image) 729 * @param pos position of the overlay image inside the base image (positioned 730 * in one of the corners) 701 731 * @return an icon that represent the overlay of the two given icons. The second icon is layed 702 732 * on the first relative to the given position. 703 733 */ 704 public static ImageIcon overlay(Icon ground, String overlayImage, OverlayPosition pos) {705 return overlay(ground, ImageProvider.get(overlayImage), pos);706 }707 708 734 public static ImageIcon overlay(Icon ground, Icon overlay, OverlayPosition pos) { 709 735 GraphicsConfiguration conf = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() … … 739 765 } 740 766 741 /* 742 * from: http://www.jidesoft.com/blog/2008/02/29/rotate-an-icon-in-java/ License: 743 * "feel free to use" 744 */ 767 /** 90 degrees in radians units */ 745 768 final static double DEGREE_90 = 90.0 * Math.PI / 180.0; 746 769 … … 750 773 * @param c The component to get properties useful for painting, e.g. the foreground or 751 774 * background color. 752 * @param i conthe image to be rotated.775 * @param img the image to be rotated. 753 776 * @param rotatedAngle the rotated angle, in degree, clockwise. It could be any double but we 754 777 * will mod it with 360 before using it. … … 811 834 * @return the icon 812 835 */ 813 public static ImageIcon get(OsmPrimitiveType type) throws IllegalArgumentException{836 public static ImageIcon get(OsmPrimitiveType type) { 814 837 CheckParameterUtil.ensureParameterNotNull(type, "type"); 815 838 return get("data", type.getAPIName()); -
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r5266 r5275 2 2 package org.openstreetmap.josm.tools; 3 3 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 4 6 import java.util.Locale; 5 import static org.openstreetmap.josm.tools.I18n.tr;6 7 7 8 public class LanguageInfo { … … 81 82 * In most cases JOSM and Java uses the same codes, but for some exceptions this is needed. 82 83 * 83 * @param code the locale code.84 * @param localeName the locale code. 84 85 * @return the resulting locale 85 86 */ -
trunk/src/org/openstreetmap/josm/tools/WikiReader.java
r5061 r5275 33 33 * pathes etc.. 34 34 * 35 * @return36 35 * @throws IOException Throws, if the page could not be loaded. 37 36 */
Note:
See TracChangeset
for help on using the changeset viewer.