- Timestamp:
- 2017-06-10T00:42:11+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r11796 r12382 81 81 } 82 82 83 /** 84 * Parses a precondition failure response from the server and attempts to get more information about it 85 * @param msg The message from the server 86 * @return The OSM primitive that caused the problem and a collection of primitives that e.g. refer to it 87 */ 83 88 public static Pair<OsmPrimitive, Collection<OsmPrimitive>> parsePreconditionFailed(String msg) { 84 89 if (msg == null) -
trunk/src/org/openstreetmap/josm/tools/GeoPropertyIndex.java
r11264 r12382 50 50 } 51 51 52 /** 53 * Gets the index of the given coordinate. Only used internally 54 * @param ll The lat/lon coordinate 55 * @param level The scale level 56 * @return The index for that position 57 */ 52 58 public static int index(LatLon ll, int level) { 53 59 long noParts = 1L << level; -
trunk/src/org/openstreetmap/josm/tools/GeoUrlToBounds.java
r11329 r12382 17 17 public final class GeoUrlToBounds { 18 18 19 /** 20 * The pattern of a geo: url, having named match groups. 21 */ 19 22 public static final Pattern PATTERN = Pattern.compile("geo:(?<lat>[+-]?[0-9.]+),(?<lon>[+-]?[0-9.]+)(\\?z=(?<zoom>[0-9]+))?"); 20 23 -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r12161 r12382 48 48 } 49 49 50 /** 51 * The result types for a {@link Geometry#polygonIntersection(Area, Area)} test 52 */ 50 53 public enum PolygonIntersection { 54 /** 55 * The first polygon is inside the second one 56 */ 51 57 FIRST_INSIDE_SECOND, 58 /** 59 * The second one is inside the first 60 */ 52 61 SECOND_INSIDE_FIRST, 62 /** 63 * The polygons do not overlap 64 */ 53 65 OUTSIDE, 66 /** 67 * The polygon borders cross each other 68 */ 54 69 CROSSING 55 70 } … … 373 388 } 374 389 390 /** 391 * Check if the segment p1 - p2 is parallel to p3 - p4 392 * @param p1 First point for first segment 393 * @param p2 Second point for first segment 394 * @param p3 First point for second segment 395 * @param p4 Second point for second segment 396 * @return <code>true</code> if they are parallel or close to parallel 397 */ 375 398 public static boolean segmentsParallel(EastNorth p1, EastNorth p2, EastNorth p3, EastNorth p4) { 376 399 … … 950 973 private final double perimeter; 951 974 975 /** 976 * Create a new {@link AreaAndPerimeter} 977 * @param area The area 978 * @param perimeter The perimeter 979 */ 952 980 public AreaAndPerimeter(double area, double perimeter) { 953 981 this.area = area; … … 955 983 } 956 984 985 /** 986 * Gets the area 987 * @return The area size 988 */ 957 989 public double getArea() { 958 990 return area; 959 991 } 960 992 993 /** 994 * Gets the perimeter 995 * @return The perimeter length 996 */ 961 997 public double getPerimeter() { 962 998 return perimeter; -
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r9070 r12382 6 6 import java.util.Locale; 7 7 8 /** 9 * This is a utility class that provides information about locales and allows to convert locale codes. 10 */ 8 11 public final class LanguageInfo { 9 12 -
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r12090 r12382 213 213 private static final int TILE_SIZE_IN_PIXELS = 256; 214 214 215 /** 216 * Compute the bounds for a given lat/lon position and the zoom level 217 * @param lat The latitude 218 * @param lon The longitude 219 * @param zoom The current zoom level 220 * @return The bounds the OSM server would display 221 */ 215 222 public static Bounds positionToBounds(final double lat, final double lon, final int zoom) { 216 223 final Dimension screenSize = getScreenSize(); -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r12279 r12382 40 40 } 41 41 42 /** 43 * A helper class that analyzes the text and attempts to parse tags from it 44 */ 42 45 public static class TextAnalyzer { 43 46 private boolean quotesStarted; … … 48 51 private final int n; 49 52 53 /** 54 * Create a new {@link TextAnalyzer} 55 * @param text The text to parse 56 */ 50 57 public TextAnalyzer(String text) { 51 58 pos = 0; … … 201 208 } 202 209 210 /** 211 * Gets a list of tags that are in the given text 212 * @param buf The text to parse 213 * @return The tags or <code>null</code> if the tags are not valid 214 */ 203 215 public static Map<String, String> getValidatedTagsFromText(String buf) { 204 216 Map<String, String> tags = readTagsFromText(buf); -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r11746 r12382 220 220 } 221 221 222 /** 223 * Gets the geometry of the main window 224 * @param preferenceKey The preference key to use 225 * @param arg The command line geometry arguments 226 * @param maximize If the user requested to maximize the window 227 * @return The geometry for the main window 228 */ 222 229 public static WindowGeometry mainWindow(String preferenceKey, String arg, boolean maximize) { 223 230 Rectangle screenDimension = getScreenInfo("gui.geometry"); -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r12279 r12382 43 43 */ 44 44 public class XmlObjectParser implements Iterable<Object> { 45 /** 46 * The language prefix to use 47 */ 45 48 public static final String lang = LanguageInfo.getLanguageCodeXML(); 46 49 … … 299 302 } 300 303 304 /** 305 * Add a new tag name to class type mapping 306 * @param tagName The tag name that should be converted to that class 307 * @param klass The class the XML elements should be converted to. 308 */ 301 309 public void map(String tagName, Class<?> klass) { 302 310 mapping.put(tagName, new Entry(klass, false, false)); … … 311 319 } 312 320 321 /** 322 * Get the next element that was parsed 323 * @return The next object 324 */ 313 325 public Object next() { 314 326 return queueIterator.next(); 315 327 } 316 328 329 /** 330 * Check if there is a next parsed object available 331 * @return <code>true</code> if there is a next object 332 */ 317 333 public boolean hasNext() { 318 334 return queueIterator.hasNext();
Note:
See TracChangeset
for help on using the changeset viewer.