Changeset 7509 in josm
- Timestamp:
- 2014-09-07T16:33:52+02:00 (10 years ago)
- Location:
- trunk/src
- Files:
-
- 96 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/JOSM.java
r5829 r7509 4 4 /** 5 5 * JOSM main class (entry point of the application).<br/> 6 * 6 * 7 7 * The name of the main class will be the name of the application menu on OS X. 8 8 * so instead of exposing "org.openstreetmap.josm.gui.MainApplication" to the … … 10 10 * An alternative would be to set the name in the plist file---but JOSM usually 11 11 * is not delivered as an OS X Application Bundle, so we have no plist file. 12 * 12 * 13 13 * @since 1023 14 14 */ -
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r7017 r7509 31 31 32 32 /** 33 * Action displayed in imagery menu to add a new imagery layer. 33 * Action displayed in imagery menu to add a new imagery layer. 34 34 * @since 3715 35 35 */ -
trunk/src/org/openstreetmap/josm/actions/AlignInCircleAction.java
r7005 r7509 101 101 } 102 102 103 103 104 104 /** 105 105 * Perform AlignInCircle action. … … 137 137 EastNorth center = null; 138 138 double radius = 0; 139 139 140 140 for (OsmPrimitive osm : sel) { 141 141 if (osm instanceof Node) { … … 163 163 ArrayList<Node> inside = new ArrayList<>(); 164 164 ArrayList<Node> outside = new ArrayList<>(); 165 165 166 166 for(Node n: nodes) { 167 167 boolean isInside = false; … … 177 177 outside.add(n); 178 178 } 179 179 180 180 if(outside.size() == 1 && inside.isEmpty()) { 181 181 center = outside.get(0).getEastNorth(); … … 190 190 radius = distance(en0, en1) / 2; 191 191 } 192 192 193 193 fixNodes.addAll(inside); 194 194 fixNodes.addAll(collectNodesWithExternReferers(ways)); … … 227 227 } 228 228 } 229 229 230 230 // Now calculate the average distance to each node from the 231 231 // center. This method is ok as long as distances are short … … 243 243 244 244 // Move each node to that distance from the center. 245 // Nodes that are not "fix" will be adjust making regular arcs. 245 // Nodes that are not "fix" will be adjust making regular arcs. 246 246 int nodeCount = nodes.size(); 247 247 // Search first fixed node … … 276 276 i = j; // Update start point for next iteration 277 277 } 278 278 279 279 Main.main.undoRedo.add(new SequenceCommand(tr("Align Nodes in Circle"), cmds)); 280 280 Main.map.repaint(); … … 294 294 return withReferrers; 295 295 } 296 296 297 297 /** 298 298 * Assuming all ways can be joined into polygon, create an ordered list of node. … … 360 360 return true; 361 361 } 362 362 363 363 @Override 364 364 protected void updateEnabledState() { -
trunk/src/org/openstreetmap/josm/actions/CombineWayAction.java
r7005 r7509 260 260 private final Node a; 261 261 private final Node b; 262 262 263 263 /** 264 264 * Constructs a new {@code NodePair}. … … 351 351 return result; 352 352 } 353 353 354 354 @Override 355 355 public boolean equals(Object obj) { -
trunk/src/org/openstreetmap/josm/actions/DownloadAction.java
r6509 r7509 26 26 */ 27 27 public class DownloadAction extends JosmAction { 28 28 29 29 /** 30 30 * Constructs a new {@code DownloadAction}. -
trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java
r6964 r7509 20 20 21 21 /** 22 * Action that merges two or more OSM data layers. 22 * Action that merges two or more OSM data layers. 23 23 * @since 1890 24 24 */ -
trunk/src/org/openstreetmap/josm/actions/MergeNodesAction.java
r7025 r7509 50 50 * The "surviving" node will be moved to that location if it is 51 51 * different from the last selected node. 52 * 52 * 53 53 * @since 422 54 54 */ -
trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java
r7005 r7509 123 123 layersOut.add(layer); 124 124 } 125 125 126 126 int active = -1; 127 127 Layer activeLayer = Main.map.mapView.getActiveLayer(); -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r7005 r7509 38 38 */ 39 39 public class SimplifyWayAction extends JosmAction { 40 40 41 41 /** 42 42 * Constructs a new {@code SimplifyWayAction}. -
trunk/src/org/openstreetmap/josm/actions/UnJoinNodeWayAction.java
r7005 r7509 27 27 */ 28 28 public class UnJoinNodeWayAction extends JosmAction { 29 29 30 30 /** 31 31 * Constructs a new {@code UnJoinNodeWayAction}. -
trunk/src/org/openstreetmap/josm/actions/ViewportFollowToggleAction.java
r6336 r7509 16 16 */ 17 17 public class ViewportFollowToggleAction extends ToggleAction { 18 18 19 19 /** 20 * Constructs a new {@code ViewportFollowToggleAction}. 20 * Constructs a new {@code ViewportFollowToggleAction}. 21 21 */ 22 22 public ViewportFollowToggleAction() { -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r7299 r7509 155 155 String rangeA2 = rangeA[1].trim(); 156 156 // if min timestap is empty: use lowest possible date 157 long minDate = DateUtils.fromString(rangeA1.isEmpty() ? "1980" : rangeA1).getTime(); 157 long minDate = DateUtils.fromString(rangeA1.isEmpty() ? "1980" : rangeA1).getTime(); 158 158 // if max timestamp is empty: use "now" 159 long maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime(); 159 long maxDate = rangeA2.isEmpty() ? System.currentTimeMillis() : DateUtils.fromString(rangeA2).getTime(); 160 160 return new TimestampRange(minDate, maxDate); 161 161 } else { -
trunk/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
r7005 r7509 38 38 */ 39 39 public class ValidateUploadHook implements UploadHook { 40 40 41 41 /** 42 42 * Validate the modified data before uploading -
trunk/src/org/openstreetmap/josm/command/ChangePropertyKeyCommand.java
r7005 r7509 45 45 this(Collections.singleton(object), key, newKey); 46 46 } 47 47 48 48 /** 49 49 * Constructs a new {@code ChangePropertyKeyCommand}. -
trunk/src/org/openstreetmap/josm/command/conflict/DeletedStateConflictResolveCommand.java
r6887 r7509 71 71 return true; 72 72 } 73 73 74 74 private void deleteMy() { 75 75 Set<OsmPrimitive> referrers = getLayer().data.unlinkReferencesToPrimitive(conflict.getMy()); -
trunk/src/org/openstreetmap/josm/data/conflict/ConflictCollection.java
r7005 r7509 45 45 46 46 private final Class<? extends OsmPrimitive> c; 47 47 48 48 public FilterPredicate(Class<? extends OsmPrimitive> c) { 49 49 this.c = c; … … 55 55 } 56 56 } 57 57 58 58 private static final FilterPredicate NODE_FILTER_PREDICATE = new FilterPredicate(Node.class); 59 59 private static final FilterPredicate WAY_FILTER_PREDICATE = new FilterPredicate(Way.class); -
trunk/src/org/openstreetmap/josm/data/coor/Coordinate.java
r6906 r7509 43 43 /** 44 44 * Returns the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate}. 45 * 45 * 46 46 * @param coor the specified coordinate to be measured against this {@code Coordinate} 47 47 * @return the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate} … … 51 51 return distance(coor.x, coor.y); 52 52 } 53 53 54 54 /** 55 55 * Returns the euclidean distance from this {@code Coordinate} to a specified coordinate. 56 * 56 * 57 57 * @param px the X coordinate of the specified point to be measured against this {@code Coordinate} 58 58 * @param py the Y coordinate of the specified point to be measured against this {@code Coordinate} … … 65 65 return Math.sqrt(dx*dx + dy*dy); 66 66 } 67 67 68 68 /** 69 69 * Returns the square of the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate}. 70 * 70 * 71 71 * @param coor the specified coordinate to be measured against this {@code Coordinate} 72 72 * @return the square of the euclidean distance from this {@code Coordinate} to a specified {@code Coordinate} … … 79 79 /** 80 80 * Returns the square of euclidean distance from this {@code Coordinate} to a specified coordinate. 81 * 81 * 82 82 * @param px the X coordinate of the specified point to be measured against this {@code Coordinate} 83 83 * @param py the Y coordinate of the specified point to be measured against this {@code Coordinate} … … 93 93 /** 94 94 * Converts to single point BBox. 95 * 95 * 96 96 * @return single point BBox defined by this coordinate. 97 97 * @since 6203 … … 100 100 return new BBox(x, y); 101 101 } 102 102 103 103 /** 104 104 * Creates bbox around this coordinate. Coordinate defines 105 105 * center of bbox, its edge will be 2*r. 106 * 106 * 107 107 * @param r size 108 108 * @return BBox around this coordinate -
trunk/src/org/openstreetmap/josm/data/coor/EastNorth.java
r6670 r7509 46 46 /** 47 47 * Returns the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth}. 48 * 48 * 49 49 * @param en the specified coordinate to be measured against this {@code EastNorth} 50 50 * @return the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth} … … 57 57 /** 58 58 * Returns the square of the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth}. 59 * 59 * 60 60 * @param en the specified coordinate to be measured against this {@code EastNorth} 61 61 * @return the square of the euclidean distance from this {@code EastNorth} to a specified {@code EastNorth} … … 68 68 /** 69 69 * Counts length (distance from [0,0]) of this. 70 * 70 * 71 71 * @return length of this 72 72 */ -
trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java
r6380 r7509 3 3 4 4 public final class QuadTiling { 5 5 6 6 private QuadTiling() { 7 7 // Hide default constructor for utils classes 8 8 } 9 9 10 10 public static final int NR_LEVELS = 24; 11 11 public static final double WORLD_PARTS = (1 << NR_LEVELS); … … 47 47 return new LatLon(y, x); 48 48 } 49 49 50 50 static long xy2tile(long x, long y) { 51 51 long tile = 0; … … 61 61 return tile; 62 62 } 63 63 64 64 static long coorToTile(LatLon coor) { 65 65 return quadTile(coor); 66 66 } 67 67 68 68 static long lon2x(double lon) { 69 69 long ret = (long)((lon + 180.0) * WORLD_PARTS / 360.0); … … 73 73 return ret; 74 74 } 75 75 76 76 static long lat2y(double lat) { 77 77 long ret = (long)((lat + 90.0) * WORLD_PARTS / 180.0); … … 81 81 return ret; 82 82 } 83 83 84 84 public static long quadTile(LatLon coor) { 85 85 return xy2tile(lon2x(coor.lon()), lat2y(coor.lat())); 86 86 } 87 87 88 88 public static int index(int level, long quad) { 89 89 long mask = 0x00000003; … … 91 91 return (int)(mask & (quad >> total_shift)); 92 92 } 93 93 94 94 /** 95 95 * Returns quad tiling index for given coordinates and level. … … 102 102 */ 103 103 public static int index(LatLon coor, int level) { 104 // The nodes that don't return coordinates will all get stuck in a single tile. 104 // The nodes that don't return coordinates will all get stuck in a single tile. 105 105 // Hopefully there are not too many of them 106 106 if (coor == null) -
trunk/src/org/openstreetmap/josm/data/gpx/GpxData.java
r7319 r7509 129 129 return result; 130 130 } 131 131 132 132 /** 133 133 * returns minimum and maximum timestamps in the track -
trunk/src/org/openstreetmap/josm/data/gpx/GpxTrack.java
r6380 r7509 17 17 Bounds getBounds(); 18 18 double length(); 19 19 20 20 /** 21 21 * -
trunk/src/org/openstreetmap/josm/data/imagery/Shape.java
r7186 r7509 107 107 return true; 108 108 } 109 110 109 110 111 111 } -
trunk/src/org/openstreetmap/josm/data/notes/Note.java
r7451 r7509 33 33 /** @return The unique OSM ID of this note */ 34 34 public long getId() { 35 35 return id; 36 36 } 37 37 -
trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
r7237 r7509 635 635 return keys == null ? 0 : keys.length / 2; 636 636 } 637 637 638 638 @Override 639 639 public final Collection<String> keySet() { -
trunk/src/org/openstreetmap/josm/data/osm/BBox.java
r7193 r7509 18 18 /** 19 19 * Constructs a new {@code BBox} defined by a single point. 20 * 20 * 21 21 * @param x X coordinate 22 22 * @param y Y coordinate … … 32 32 * Constructs a new {@code BBox} defined by points <code>a</code> and <code>b</code>. 33 33 * Result is minimal BBox containing both points. 34 * 35 * @param a 34 * 35 * @param a 36 36 * @param b 37 37 */ … … 42 42 /** 43 43 * Constructs a new {@code BBox} from another one. 44 * 44 * 45 45 * @param copy the BBox to copy 46 46 */ … … 53 53 54 54 public BBox(double a_x, double a_y, double b_x, double b_y) { 55 55 56 56 if (a_x > b_x) { 57 57 xmax = a_x; … … 61 61 xmin = a_x; 62 62 } 63 63 64 64 if (a_y > b_y) { 65 65 ymax = a_y; … … 69 69 ymin = a_y; 70 70 } 71 71 72 72 sanity(); 73 73 } … … 260 260 return idx1; 261 261 } 262 262 263 263 public Rectangle2D toRectangle() { 264 264 return new Rectangle2D.Double(xmin, ymin, xmax - xmin, ymax - ymin); -
trunk/src/org/openstreetmap/josm/data/osm/FilterWorker.java
r6362 r7509 13 13 */ 14 14 public final class FilterWorker { 15 15 16 16 private FilterWorker() { 17 17 // Hide default constructor for utils classes 18 18 } 19 19 20 20 /** 21 21 * Apply the filters to the primitives of the data set. -
trunk/src/org/openstreetmap/josm/data/osm/TigerUtils.java
r7005 r7509 12 12 */ 13 13 public final class TigerUtils { 14 14 15 15 private TigerUtils() { 16 16 // Hide default constructor for utils classes -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r7091 r7509 743 743 } 744 744 } 745 745 746 746 } -
trunk/src/org/openstreetmap/josm/data/osm/WaySegment.java
r6862 r7509 8 8 */ 9 9 public final class WaySegment implements Comparable<WaySegment> { 10 10 11 11 /** 12 12 * The way. -
trunk/src/org/openstreetmap/josm/data/osm/visitor/BoundingXYVisitor.java
r7053 r7509 128 128 * to its beginning size. The larger the bounding box, the smaller the change, 129 129 * down to the minimum of 1% enlargement. 130 * 130 * 131 131 * Warning: if the bounding box only contains a single node, no expansion takes 132 132 * place because a node has no width/height. Use <code>enlargeToMinDegrees</code> 133 133 * instead. 134 * 134 * 135 135 * Example: You specify enlargement to be up to 100%. 136 * 136 * 137 137 * Bounding box is a small house: enlargement will be 95–100%, i.e. 138 138 * making enough space so that the house fits twice on the screen in 139 139 * each direction. 140 * 140 * 141 141 * Bounding box is a large landuse, like a forest: Enlargement will 142 142 * be 1–10%, i.e. just add a little border around the landuse. 143 * 143 * 144 144 * If the bounding box has not been set (<code>min</code> or <code>max</code> 145 145 * equal <code>null</code>) this method does not do anything. 146 * 146 * 147 147 * @param maxEnlargePercent 148 148 */ … … 165 165 * the specified size in width and height. The value is ignored if the 166 166 * bounding box is already larger than the specified amount. 167 * 167 * 168 168 * If the bounding box has not been set (<code>min</code> or <code>max</code> 169 169 * equal <code>null</code>) this method does not do anything. 170 * 170 * 171 171 * If the bounding box contains objects and is to be enlarged, the objects 172 172 * will be centered within the new bounding box. 173 * 173 * 174 174 * @param size minimum width and height in meter 175 175 */ -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r7478 r7509 247 247 * 248 248 * This bug has only been observed on Mac OS X, see #7841. 249 * 249 * 250 250 * After switch to Java 7, this test is a false positive on Mac OS X (see #10446), 251 251 * i.e. it returns true, but the real rendering code does not require any special … … 1069 1069 1070 1070 Rectangle bounds = g.getClipBounds(); 1071 1071 1072 1072 Polygon poly = new Polygon(); 1073 1073 Point lastPoint = null; … … 1075 1075 double pathLength = 0; 1076 1076 long dx, dy; 1077 1077 1078 1078 // find half segments that are long enough to draw text on 1079 1079 // (don't draw text over the cross hair in the center of each segment) … … 1081 1081 List<Double> longHalfSegmentEnd = new ArrayList<>(); // end point of half segment (as length along the way) 1082 1082 List<Double> longHalfsegmentQuality = new ArrayList<>(); // quality factor (off screen / partly on screen / fully on screen) 1083 1083 1084 1084 while (it.hasNext()) { 1085 1085 Node n = it.next(); … … 1104 1104 longHalfSegmentEnd.add(pathLength + segmentLength / 2); 1105 1105 longHalfsegmentQuality.add(q); 1106 1106 1107 1107 q = 0; 1108 1108 if (bounds != null) { … … 1121 1121 lastPoint = p; 1122 1122 } 1123 1123 1124 1124 if (rec.getWidth() > pathLength) 1125 1125 return; 1126 1126 1127 1127 double t1, t2; 1128 1128 1129 1129 if (!longHalfSegmentStart.isEmpty()) { 1130 1130 if (way.getNodesCount() == 2) { … … 1134 1134 longHalfsegmentQuality.set(0, longHalfsegmentQuality.get(0) + 0.5); 1135 1135 } 1136 1136 1137 1137 // find the long half segment that is closest to the center of the way 1138 1138 // candidates with higher quality value are preferred -
trunk/src/org/openstreetmap/josm/data/projection/proj/Proj.java
r6135 r7509 23 23 */ 24 24 public interface Proj { 25 25 26 26 /** 27 27 * Replies a human readable name of this projection. -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateWay.java
r7005 r7509 41 41 private final List<LatLon> coor; 42 42 private final Map<String, String> keys; 43 43 44 44 public WayPair(List<LatLon> coor, Map<String, String> keys) { 45 45 this.coor = coor; -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnclosedWays.java
r7252 r7509 50 50 /** The boolean indicating if special values must be ignored or considered only */ 51 51 private final boolean ignore; 52 52 53 53 /** 54 54 * Constructs a new {@code UnclosedWaysCheck}. … … 60 60 this(code, key, engMessage, Collections.<String>emptyList()); 61 61 } 62 62 63 63 /** 64 64 * Constructs a new {@code UnclosedWaysCheck}. … … 71 71 this(code, key, engMessage, ignoredValues, true); 72 72 } 73 73 74 74 /** 75 75 * Constructs a new {@code UnclosedWaysCheck}. … … 87 87 this.ignore = ignore; 88 88 } 89 89 90 90 /** 91 91 * Returns the test error of the given way, if any. … … 106 106 return null; 107 107 } 108 108 109 109 protected boolean isValueErroneous(String value) { 110 110 return value != null && ignore != specialValues.contains(value); … … 149 149 new UnclosedWaysBooleanCheck(1130, "area", marktr("area")), 150 150 }; 151 151 152 152 /** 153 153 * Returns the set of checked OSM keys. -
trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
r7012 r7509 25 25 */ 26 26 public class UntaggedWay extends Test { 27 27 28 28 /** Empty way error */ 29 29 protected static final int EMPTY_WAY = 301; -
trunk/src/org/openstreetmap/josm/gui/MapMover.java
r7012 r7509 45 45 if (mouse == null) 46 46 mouse = new Point((int)nc.getBounds().getCenterX(), (int)nc.getBounds().getCenterY()); 47 MouseWheelEvent we = new MouseWheelEvent(nc, e.getID(), e.getWhen(), e.getModifiers(), mouse.x, mouse.y, 0, false, 47 MouseWheelEvent we = new MouseWheelEvent(nc, e.getID(), e.getWhen(), e.getModifiers(), mouse.x, mouse.y, 0, false, 48 48 MouseWheelEvent.WHEEL_UNIT_SCROLL, 1, ",".equals(action) ? -1 : 1); 49 49 mouseWheelMoved(we); … … 153 153 int offMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON2_DOWN_MASK; 154 154 int macMouseMask = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK; 155 if (e.getButton() == MouseEvent.BUTTON3 && (e.getModifiersEx() & offMask) == 0 || 155 if (e.getButton() == MouseEvent.BUTTON3 && (e.getModifiersEx() & offMask) == 0 || 156 156 Main.isPlatformOsx() && e.getModifiersEx() == macMouseMask) { 157 157 startMovement(e); -
trunk/src/org/openstreetmap/josm/gui/NotificationManager.java
r7011 r7509 105 105 currentNotification = queue.poll(); 106 106 if (currentNotification == null) return; 107 107 108 108 currentNotificationPanel = new NotificationPanel(currentNotification); 109 109 currentNotificationPanel.validate(); … … 309 309 putValue(SMALL_ICON, ImageProvider.get("misc", "grey_x")); 310 310 } 311 311 312 312 @Override 313 313 public void actionPerformed(ActionEvent e) { -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
r7011 r7509 45 45 /** The speed increase per timer interval when a cursor button is clicked */ 46 46 private static final double ACCELERATION = 0.10; 47 47 48 48 private static final int MAC_MOUSE_BUTTON3_MASK = MouseEvent.CTRL_DOWN_MASK | MouseEvent.BUTTON1_DOWN_MASK; 49 49 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
r7017 r7509 416 416 */ 417 417 abstract class CopyAction extends AbstractAction implements ListSelectionListener { 418 418 419 419 protected CopyAction(String icon_name, String action_name, String short_description) { 420 420 ImageIcon icon = ImageProvider.get("dialogs/conflict", icon_name+".png"); … … 427 427 } 428 428 } 429 429 430 430 /** 431 431 * Action for copying selected nodes in the list of my nodes to the list of merged -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecisionRenderer.java
r7017 r7509 64 64 @Override 65 65 public Component getListCellRendererComponent( 66 JList<? extends RelationMemberConflictDecisionType> list, 66 JList<? extends RelationMemberConflictDecisionType> list, 67 67 RelationMemberConflictDecisionType decision, int index, boolean isSelected, 68 68 boolean cellHasFocus) { -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverColumnModel.java
r6623 r7509 19 19 20 20 private final DefaultTableCellRenderer defaultTableCellRenderer = new DefaultTableCellRenderer(); 21 21 22 22 private final OsmPrimitivRenderer primitiveRenderer = new OsmPrimitivRenderer() { 23 23 @Override … … 28 28 } 29 29 }; 30 30 31 31 private final TableCellRenderer tableRenderer = new TableCellRenderer() { 32 32 @Override … … 37 37 } 38 38 }; 39 39 40 40 private static Component setColors(Component comp, JTable table, boolean isSelected, int row) { 41 41 RelationMemberConflictResolverModel model = (RelationMemberConflictResolverModel) table.getModel(); 42 42 43 43 if (!isSelected && comp != null) { 44 44 switch (model.getDecision(row).getDecision()) { … … 59 59 return comp; 60 60 } 61 61 62 62 protected final void createColumns() { 63 63 64 64 AutoCompletingTextField roleEditor = new AutoCompletingTextField(); 65 65 RelationMemberConflictDecisionRenderer decisionRenderer = new RelationMemberConflictDecisionRenderer(); … … 105 105 col.setPreferredWidth(100); 106 106 addColumn(col); 107 107 108 108 // column 4 - New Way 109 109 col = new TableColumn(4); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
r7005 r7509 137 137 rebuild(); 138 138 } 139 139 140 140 /** 141 141 * Returns the OSM key at the given row. … … 270 270 rebuild(); 271 271 } 272 272 273 273 /** 274 274 * Returns the set of keys in conflict. -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r7005 r7509 87 87 "</ul>" + 88 88 "Symbols <tt>°</tt>, <tt>'</tt>, <tt>′</tt>, <tt>"</tt>, <tt>″</tt> are optional.<br/><br/>" + 89 "Some examples:<ul>{0}</ul>", 89 "Some examples:<ul>{0}</ul>", 90 90 "<li>49.29918° 19.24788°</li>" + 91 91 "<li>N 49.29918 E 19.24788</li>" + -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListPopup.java
r7005 r7509 33 33 public static final class InfoAction extends AbstractAction { 34 34 private final Layer layer; 35 35 36 36 /** 37 37 * Constructs a new {@code InfoAction} for the given layer. … … 43 43 this.layer = layer; 44 44 } 45 45 46 46 @Override 47 47 public void actionPerformed(ActionEvent e) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java
r7005 r7509 221 221 cbType.setSelectedIndex(3); 222 222 } 223 } else if (buf.matches("[\\d,v\\s]+")) { 224 //fallback solution for id1,id2,id3 format 223 } else if (buf.matches("[\\d,v\\s]+")) { 224 //fallback solution for id1,id2,id3 format 225 225 tfId.tryToPasteFrom(buf); 226 226 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheTableColumnModel.java
r6214 r7509 14 14 15 15 private final ChangesetCacheTableCellRenderer renderer = new ChangesetCacheTableCellRenderer(); 16 16 17 17 protected void createColumn(int modelIndex, String headerValue, int preferredWidth, int width) { 18 18 TableColumn col = new TableColumn(modelIndex); … … 26 26 addColumn(col); 27 27 } 28 28 29 29 protected void createColumns() { 30 30 -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetContentPanel.java
r7005 r7509 172 172 setCurrentChangeset(cs); 173 173 } 174 174 175 175 private final void alertNoPrimitivesTo(Collection<HistoryOsmPrimitive> primitives, String title, String helpTopic) { 176 176 HelpAwareOptionPane.showOptionDialog( … … 235 235 236 236 class ShowHistoryAction extends AbstractAction implements ListSelectionListener { 237 237 238 238 private final class ShowHistoryTask implements Runnable { 239 239 private final Collection<HistoryOsmPrimitive> primitives; … … 341 341 } 342 342 if (target.isEmpty()) { 343 alertNoPrimitivesTo(selected, tr("Nothing to select"), 343 alertNoPrimitivesTo(selected, tr("Nothing to select"), 344 344 HelpUtil.ht("/Dialog/ChangesetCacheManager#NothingToSelectInLayer")); 345 345 return; … … 391 391 } 392 392 if (target.isEmpty()) { 393 alertNoPrimitivesTo(selected, tr("Nothing to zoom to"), 393 alertNoPrimitivesTo(selected, tr("Nothing to zoom to"), 394 394 HelpUtil.ht("/Dialog/ChangesetCacheManager#NothingToZoomTo")); 395 395 return; -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/sort/RelationSortUtils.java
r6990 r7509 16 16 // Hide default constructor for utils classes 17 17 } 18 18 19 19 /** 20 20 * determine, if the way i is a roundabout and if yes, what type of roundabout -
trunk/src/org/openstreetmap/josm/gui/download/SlippyMapChooser.java
r6380 r7509 80 80 } 81 81 } 82 82 83 83 /** 84 84 * Refreshes the tile sources -
trunk/src/org/openstreetmap/josm/gui/help/HelpUtil.java
r6990 r7509 25 25 // Hide default constructor for utils classes 26 26 } 27 27 28 28 /** 29 29 * Replies the base wiki URL. -
trunk/src/org/openstreetmap/josm/gui/history/TwoColumnDiff.java
r7005 r7509 63 63 diff(); 64 64 } 65 65 66 66 private void diff() { 67 67 Diff diff = new Diff(reference, current); -
trunk/src/org/openstreetmap/josm/gui/layer/JumpToMarkerActions.java
r7005 r7509 22 22 void jumpToPreviousMarker(); 23 23 } 24 24 25 25 private JumpToMarkerActions() { 26 26 // Hide default constructor for utils classes … … 47 47 private final Shortcut multikeyShortcut; 48 48 private WeakReference<Layer> lastLayer; 49 49 50 50 public JumpToMarker(JumpToMarkerLayer layer, Shortcut shortcut) { 51 51 this.layer = (Layer) layer; … … 53 53 this.multikeyShortcut.setAccelerator(this); 54 54 } 55 55 56 56 protected final void setLastLayer(Layer l) { 57 57 lastLayer = new WeakReference<>(l); … … 89 89 return LayerListDialog.getLayerInfoByClass(JumpToMarkerLayer.class); 90 90 } 91 91 92 92 @Override 93 93 public MultikeyInfo getLastMultikeyAction() { -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r7438 r7509 239 239 return autoDownloadEnabled; 240 240 } 241 241 242 242 public void setAutoDownload(boolean val) { 243 243 autoDownloadEnabled = val; 244 244 } 245 245 246 246 public boolean isAutoResolution() { 247 247 return autoResolutionEnabled; 248 248 } 249 249 250 250 public void setAutoResolution(boolean val) { 251 251 autoResolutionEnabled = val; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
r7024 r7509 81 81 */ 82 82 public final boolean hasGpsTime() { 83 return (tmp != null && tmp.gpsTime != null) || gpsTime != null; 83 return (tmp != null && tmp.gpsTime != null) || gpsTime != null; 84 84 } 85 85 … … 96 96 return getDefensiveDate(exifTime); 97 97 } 98 98 99 99 /** 100 100 * Convenient way to determine if this entry has a EXIF time, without the cost of building a defensive copy. … … 103 103 */ 104 104 public final boolean hasExifTime() { 105 return exifTime != null; 106 } 107 105 return exifTime != null; 106 } 107 108 108 /** 109 109 * Returns the EXIF GPS time. … … 114 114 return getDefensiveDate(exifGpsTime); 115 115 } 116 116 117 117 /** 118 118 * Convenient way to determine if this entry has a EXIF GPS time, without the cost of building a defensive copy. … … 121 121 */ 122 122 public final boolean hasExifGpsTime() { 123 return exifGpsTime != null; 124 } 125 123 return exifGpsTime != null; 124 } 125 126 126 private static Date getDefensiveDate(Date date) { 127 127 if (date == null) … … 129 129 return new Date(date.getTime()); 130 130 } 131 131 132 132 public LatLon getExifCoor() { 133 133 return exifCoor; … … 165 165 this.exifTime = getDefensiveDate(exifTime); 166 166 } 167 167 168 168 /** 169 169 * Sets the EXIF GPS time. … … 174 174 this.exifGpsTime = getDefensiveDate(exifGpsTime); 175 175 } 176 176 177 177 public void setGpsTime(Date gpsTime) { 178 178 this.gpsTime = getDefensiveDate(gpsTime); … … 250 250 251 251 /** 252 * Indicates that the image has new GPS data. 252 * Indicates that the image has new GPS data. 253 253 * That flag is used e.g. by the photo_geotagging plugin to decide for which image 254 254 * file the EXIF GPS data needs to be (re-)written. … … 257 257 public void flagNewGpsData() { 258 258 isNewGpsData = true; 259 // We need to set the GPS time to tell the system (mainly the photo_geotagging plug-in) 259 // We need to set the GPS time to tell the system (mainly the photo_geotagging plug-in) 260 260 // that the GPS data has changed. Check for existing GPS time and take EXIF time otherwise. 261 261 // This can be removed once isNewGpsData is used instead of the GPS time. -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/ImportAudioAction.java
r7005 r7509 131 131 boolean timedMarkersOmitted = false; 132 132 boolean untimedMarkersOmitted = false; 133 double snapDistance = Main.pref.getDouble("marker.audiofromuntimedwaypoints.distance", 1.0e-3); 133 double snapDistance = Main.pref.getDouble("marker.audiofromuntimedwaypoints.distance", 1.0e-3); 134 134 // about 25 m 135 135 WayPoint wayPointFromTimeStamp = null; -
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r7246 r7509 112 112 return (T) String.format("#%06x%02x", ((Color) o).getRGB() & 0x00ffffff, alpha); 113 113 return (T) String.format("#%06x", ((Color) o).getRGB() & 0x00ffffff); 114 114 115 115 } 116 116 … … 151 151 if (o instanceof float[]) 152 152 return ((float[]) o).length != 0; 153 153 154 154 return null; 155 155 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/Environment.java
r6611 r7509 28 28 */ 29 29 public OsmPrimitive parent; 30 30 31 31 /** 32 32 * The same for parent selector. Only one of the 2 fields (parent or child) is not null in any environment. -
trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSetting.java
r7450 r7509 12 12 /** 13 13 * Setting to customize a MapPaint style. 14 * 15 * Can be changed by the user in the right click menu of the mappaint style 14 * 15 * Can be changed by the user in the right click menu of the mappaint style 16 16 * dialog. 17 * 17 * 18 18 * Defined in the MapCSS style, e.g. 19 19 * <pre> … … 23 23 * default: true; 24 24 * } 25 * 25 * 26 26 * way[highway][setting("highway_casing")] { 27 27 * casing-width: 2; … … 33 33 34 34 void addMenuEntry(JMenu menu); 35 35 36 36 Object getValue(); 37 37 38 38 /** 39 39 * A style setting for boolean value (yes / no). … … 71 71 menu.add(item); 72 72 } 73 73 74 74 public static BooleanStyleSetting create(Cascade c, StyleSource parentStyle, String key) { 75 75 String label = c.get("label", null, String.class); … … 83 83 return null; 84 84 } 85 String prefKey = parentStyle.url + ":boolean:" + key; 85 String prefKey = parentStyle.url + ":boolean:" + key; 86 86 return new BooleanStyleSetting(parentStyle, prefKey, label, def); 87 87 } … … 93 93 return Boolean.parseBoolean(val); 94 94 } 95 95 96 96 } 97 97 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/CSSColors.java
r7005 r7509 171 171 return CSS_COLORS.get(key); 172 172 } 173 173 174 174 private CSSColors() { 175 175 // Hide default constructor for utils classes -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r7450 r7509 171 171 return Arrays.asList(args); 172 172 } 173 173 174 174 /** 175 175 * Returns the number of elements in a list. … … 234 234 } 235 235 } 236 236 237 237 public static Color rgba(float r, float g, float b, float alpha) { 238 238 try { … … 606 606 return cs.getValue(); 607 607 } 608 608 609 609 /** 610 610 * check if there is right-hand traffic at the current location … … 618 618 return RightAndLefthandTraffic.isRightHandTraffic(env.osm.getBBox().getCenter()); 619 619 } 620 620 621 621 /** 622 622 * Prints the object to the command line (for debugging purpose). … … 641 641 return o; 642 642 } 643 643 644 644 /** 645 645 * Get the number of tags for the current primitive. … … 650 650 return env.osm.getNumKeys(); 651 651 } 652 652 653 653 /** 654 654 * Get value of a setting. … … 784 784 * Separate implementation to support overloading for different 785 785 * argument types. 786 * 786 * 787 787 * The use for calculating the length of a list is deprecated, use 788 788 * {@link Functions#count(java.util.List)} instead (see #10061). -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r7450 r7509 72 72 private String css = null; 73 73 private ZipFile zipFile; 74 74 75 75 /** 76 76 * This lock prevents concurrent execution of {@link MapCSSRuleIndex#clear() } / 77 77 * {@link MapCSSRuleIndex#initIndex()} and {@link MapCSSRuleIndex#getRuleCandidates }. 78 * 78 * 79 79 * For efficiency reasons, these methods are synchronized higher up the 80 80 * stack trace. … … 84 84 /** 85 85 * A collection of {@link MapCSSRule}s, that are indexed by tag key and value. 86 * 86 * 87 87 * Speeds up the process of finding all rules that match a certain primitive. 88 * 88 * 89 89 * Rules with a {@link SimpleKeyValueCondition} [key=value] are indexed by 90 90 * key and value in a HashMap. Now you only need to loop the tags of a 91 91 * primitive to retrieve the possibly matching rules. 92 * 92 * 93 93 * Rules with no SimpleKeyValueCondition in the selector have to be 94 94 * checked separately. 95 * 95 * 96 96 * The order of rules gets mixed up by this and needs to be sorted later. 97 97 */ … … 103 103 /* rules without SimpleKeyValueCondition */ 104 104 public final Set<MapCSSRule> remaining = new HashSet<>(); 105 105 106 106 public void add(MapCSSRule rule) { 107 107 rules.add(rule); … … 110 110 /** 111 111 * Initialize the index. 112 * 112 * 113 113 * You must own the write lock of STYLE_SOURCE_LOCK when calling this method. 114 114 */ … … 144 144 } 145 145 } 146 146 147 147 /** 148 148 * Get a subset of all rules that might match the primitive. … … 150 150 * @return a Collection of rules that filters out most of the rules 151 151 * that cannot match, based on the tags of the primitive 152 * 152 * 153 153 * You must have a read lock of STYLE_SOURCE_LOCK when calling this method. 154 154 */ … … 166 166 Collections.sort(ruleCandidates); 167 167 return ruleCandidates; 168 } 168 } 169 169 170 170 /** 171 171 * Clear the index. 172 * 172 * 173 173 * You must own the write lock STYLE_SOURCE_LOCK when calling this method. 174 174 */ … … 298 298 } 299 299 } 300 300 301 301 @Override 302 302 public InputStream getSourceInputStream() throws IOException { … … 356 356 } 357 357 } 358 358 359 359 private void loadSettings() { 360 360 settings.clear(); … … 448 448 } 449 449 } 450 450 451 451 // the declaration indices are sorted, so it suffices to save the 452 452 // last used index -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r7378 r7509 26 26 /** 27 27 * MapCSS selector. 28 * 28 * 29 29 * A rule has two parts, a selector and a declaration block 30 30 * e.g. 31 31 * <pre> 32 * way[highway=residential] 33 * { width: 10; color: blue; } 32 * way[highway=residential] 33 * { width: 10; color: blue; } 34 34 * </pre> 35 * 35 * 36 36 * The selector decides, if the declaration block gets applied or not. 37 * 37 * 38 38 * All implementing classes of Selector are immutable. 39 39 */ … … 49 49 */ 50 50 boolean matches(Environment env); 51 51 52 52 String getSubpart(); 53 53 54 54 Range getRange(); 55 55 56 56 /** 57 57 * Create an "optimized" copy of this selector that omits the base check. 58 * 58 * 59 59 * For the style source, the list of rules is preprocessed, such that 60 60 * there is a separate list of rules for nodes, ways, ... 61 * 61 * 62 62 * This means that the base check does not have to be performed 63 63 * for each rule, but only once for each primitive. 64 * 64 * 65 65 * @return a selector that is identical to this object, except the base of the 66 66 * "rightmost" selector is not checked … … 380 380 return right.getRange(); 381 381 } 382 382 383 383 @Override 384 384 public Selector optimizedBaseCheck() { … … 473 473 super(base, zoom, conds, subpart); 474 474 } 475 475 476 476 public boolean matchesConditions(Environment e) { 477 477 return super.matches(e); … … 488 488 } 489 489 } 490 490 491 491 public static class OptimizedGeneralSelector extends AbstractSelector { 492 492 public final String base; … … 510 510 this.subpart = subpart; 511 511 } 512 512 513 513 public OptimizedGeneralSelector(String base, Range range, List<Condition> conds, String subpart) { 514 514 super(conds); … … 517 517 this.subpart = subpart; 518 518 } 519 519 520 520 public OptimizedGeneralSelector(GeneralSelector s) { 521 521 this(s.base, s.range, s.conds, s.subpart); … … 572 572 throw new UnsupportedOperationException(); 573 573 } 574 574 575 575 public static Range fromLevel(int a, int b) { 576 576 if (a > b) … … 596 596 return 2.0 * Math.PI * R / Math.pow(2.0, lvl) / 2.56; 597 597 } 598 598 599 599 public static int scale2level(double scale) { 600 600 if (scale < 0) -
trunk/src/org/openstreetmap/josm/gui/oauth/AuthorizationProcedureComboBox.java
r7015 r7509 80 80 81 81 @Override 82 public Component getListCellRendererComponent(JList<? extends AuthorizationProcedure> list, AuthorizationProcedure procedure, 82 public Component getListCellRendererComponent(JList<? extends AuthorizationProcedure> list, AuthorizationProcedure procedure, 83 83 int idx, boolean isSelected, boolean hasFocus) { 84 84 renderColors(isSelected); -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r7048 r7509 69 69 */ 70 70 public final class PreferenceTabbedPane extends JTabbedPane implements MouseWheelListener, ExpertModeChangeListener, ChangeListener { 71 71 72 72 /** 73 73 * Allows PreferenceSettings to do validation of entered values when ok was pressed. -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r7021 r7509 1057 1057 control.repaint(); 1058 1058 } 1059 1059 1060 1060 /** 1061 1061 * The method to add custom button on toolbar like search or preset buttons -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java
r7020 r7509 115 115 } 116 116 @Override 117 public Component getListCellRendererComponent(JList<? extends Locale> list, Locale l, 117 public Component getListCellRendererComponent(JList<? extends Locale> list, Locale l, 118 118 int index, boolean isSelected, boolean cellHasFocus) { 119 119 return dispatch.getListCellRendererComponent(list, -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r7288 r7509 153 153 Main.main.menu.imageryMenu.refreshOffsetMenu(); 154 154 OffsetBookmark.saveBookmarks(); 155 155 156 156 DownloadDialog.getInstance().refreshTileSources(); 157 157 -
trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java
r6733 r7509 98 98 notification.setToolTipText(tr("When saving, display a small notification")); 99 99 panel.add(notification, GBC.eop()); 100 100 101 101 ActionListener autosaveEnabled = new ActionListener(){ 102 102 @Override -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionChoice.java
r6733 r7509 63 63 /** 64 64 * Return all projection codes supported by this projection choice. 65 * @return all supported projection codes 65 * @return all supported projection codes 66 66 */ 67 67 String[] allCodes(); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java
r6990 r7509 93 93 rbBasicAuthentication.setSelected(true); 94 94 pnlAuthenticationParameteters.add(pnlBasicAuthPreferences, BorderLayout.CENTER); 95 95 96 96 //-- the panel for messages preferences 97 97 gc.gridy = 2; -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorPanel.java
r7128 r7509 82 82 btn.setMargin(new Insets(0,0,0,0)); 83 83 tagTable.addComponentNotStoppingCellEditing(btn); 84 84 85 85 // paste action 86 86 pnl.add(btn = new JButton(tagTable.getPasteAction())); -
trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java
r7026 r7509 332 332 Relation relation = new Relation(); 333 333 model.applyToPrimitive(relation); 334 334 335 335 String buf = Utils.getClipboardContent(); 336 336 if (buf == null || buf.isEmpty() || buf.matches(CopyAction.CLIPBOARD_REGEXP)) { … … 355 355 } 356 356 } 357 357 358 358 protected final void updateEnabledState() { 359 359 setEnabled(TagTable.this.isEnabled()); … … 365 365 } 366 366 } 367 367 368 368 /** the delete action */ 369 369 private RunnableAction deleteAction = null; -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetSearchDialog.java
r6986 r7509 20 20 21 21 private static TaggingPresetSearchDialog instance; 22 22 23 23 /** 24 24 * Returns the unique instance of {@code TaggingPresetSearchDialog}. … … 31 31 return instance; 32 32 } 33 33 34 34 private TaggingPresetSearchDialog() { 35 35 super(Main.parent, tr("Presets"), new String[] {tr("Select"), tr("Cancel")}); -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
r6912 r7509 159 159 /** 160 160 * Constructs a new {@code AutoCompletingTextField}. 161 * @param columns the number of columns to use to calculate the preferred width; 161 * @param columns the number of columns to use to calculate the preferred width; 162 162 * if columns is set to zero, the preferred width will be whatever naturally results from the component implementation 163 163 */ -
trunk/src/org/openstreetmap/josm/gui/widgets/ComboBoxHistory.java
r7021 r7509 23 23 addElement(new AutoCompletionListItem(s)); 24 24 } 25 25 26 26 /** 27 27 * Adds or moves an element to the top of the history -
trunk/src/org/openstreetmap/josm/gui/widgets/QuadStateCheckBox.java
r6890 r7509 79 79 setState(initial); 80 80 } 81 81 82 82 /** 83 83 * Constructs a new {@code QuadStateCheckBox}. … … 93 93 @Override 94 94 public void addMouseListener(MouseListener l) { } 95 95 96 96 /** 97 97 * Set the new state. … … 101 101 model.setState(state); 102 102 } 103 104 /** 105 * Return the current state, which is determined by the selection status of the model. 106 * @return The current state 103 104 /** 105 * Return the current state, which is determined by the selection status of the model. 106 * @return The current state 107 107 */ 108 108 public State getState() { 109 109 return model.getState(); 110 110 } 111 111 112 112 @Override 113 113 public void setSelected(boolean b) { … … 121 121 private final class QuadStateDecorator implements ButtonModel { 122 122 private final ButtonModel other; 123 123 124 124 private QuadStateDecorator(ButtonModel other) { 125 125 this.other = other; 126 126 } 127 127 128 128 private void setState(State state) { 129 129 if (state == State.NOT_SELECTED) { … … 149 149 } 150 150 } 151 151 152 152 /** 153 153 * The current state is embedded in the selection / armed -
trunk/src/org/openstreetmap/josm/gui/widgets/UrlLabel.java
r6365 r7509 51 51 * Constructs a new {@code UrlLabel} for the given URL and description. 52 52 * @param url The URL to use 53 * @param description The description to display 53 * @param description The description to display 54 54 */ 55 55 public UrlLabel(String url, String description) { … … 60 60 * Constructs a new {@code UrlLabel} for the given URL, description and font increase. 61 61 * @param url The URL to use 62 * @param description The description to display 62 * @param description The description to display 63 63 * @param fontPlus The font increase in 1/72 of an inch units. 64 64 */ … … 115 115 } 116 116 } 117 117 118 118 @Override 119 119 public void mousePressed(MouseEvent e) { 120 120 // Ignored 121 121 } 122 122 123 123 @Override 124 124 public void mouseEntered(MouseEvent e) { 125 125 // Ignored 126 126 } 127 127 128 128 @Override 129 129 public void mouseExited(MouseEvent e) { 130 130 // Ignored 131 131 } 132 132 133 133 @Override 134 134 public void mouseReleased(MouseEvent e) { -
trunk/src/org/openstreetmap/josm/io/GeoJSONWriter.java
r7030 r7509 70 70 } 71 71 } 72 72 73 73 private static class GeometryPrimitiveVisitor implements PrimitiveVisitor { 74 74 75 75 private final JsonObjectBuilder geomObj; 76 76 77 77 public GeometryPrimitiveVisitor(JsonObjectBuilder geomObj) { 78 78 this.geomObj = geomObj; -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r7033 r7509 507 507 508 508 /** 509 * Constructs a new {@code GpxReader}, which can later parse the input stream 509 * Constructs a new {@code GpxReader}, which can later parse the input stream 510 510 * and store the result in trackData and markerData 511 511 * -
trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java
r6882 r7509 39 39 this.compression = compression; 40 40 } 41 41 42 42 public abstract T parse() throws OsmTransferException, IllegalDataException, IOException, SAXException; 43 43 } … … 120 120 } 121 121 } 122 122 123 123 protected class OsmChangeParser extends Parser<DataSet> { 124 124 protected OsmChangeParser(ProgressMonitor progressMonitor, Compression compression) { … … 140 140 super(progressMonitor, compression); 141 141 } 142 142 143 143 @Override 144 144 public GpxData parse() throws OsmTransferException, IllegalDataException, IOException, SAXException { -
trunk/src/org/openstreetmap/josm/io/OsmServerUserInfoReader.java
r7299 r7509 112 112 userInfo.setLanguages(languages); 113 113 } 114 114 115 115 // -- messages 116 116 xmlNode = (Node)xpath.compile("/osm/user[1]/messages/received").evaluate(document, XPathConstants.NODE); … … 125 125 } 126 126 } 127 127 128 128 return userInfo; 129 129 } catch(XPathException e) { -
trunk/src/org/openstreetmap/josm/io/OsmTransferCanceledException.java
r6987 r7509 11 11 */ 12 12 public OsmTransferCanceledException() { 13 13 14 14 } 15 15 -
trunk/src/org/openstreetmap/josm/io/UTFInputStreamReader.java
r6650 r7509 12 12 */ 13 13 public final class UTFInputStreamReader extends InputStreamReader { 14 14 15 15 /** 16 16 * Creates a new {@link InputStreamReader} from the {@link InputStream} with UTF-8 as default encoding. -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java
r7005 r7509 46 46 return new String[]{"way"}; 47 47 } 48 48 49 49 @Override 50 50 public String[] getOptionalParams() { … … 64 64 }; 65 65 } 66 66 67 67 @Override 68 68 protected void handleRequest() throws RequestHandlerErrorException, RequestHandlerBadRequestException { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/OpenFileHandler.java
r6536 r7509 25 25 return new String[]{"filename"}; 26 26 } 27 27 28 28 @Override 29 29 public String[] getOptionalParams() { -
trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionImporter.java
r7012 r7509 74 74 case "exif-coordinates": 75 75 entry.setExifCoor(new LatLon( 76 Double.parseDouble(attrElem.getAttribute("lat")), 76 Double.parseDouble(attrElem.getAttribute("lat")), 77 77 Double.parseDouble(attrElem.getAttribute("lon")))); 78 78 break; -
trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
r7248 r7509 40 40 */ 41 41 public static final String PLUGIN_MIME_TYPES = "application/java-archive, application/zip; q=0.9, application/octet-stream; q=0.5"; 42 42 43 43 private final Collection<PluginInformation> toUpdate = new LinkedList<>(); 44 44 private final Collection<PluginInformation> failed = new LinkedList<>(); -
trunk/src/org/openstreetmap/josm/tools/Base64.java
r7060 r7509 17 17 // Hide default constructor for utils classes 18 18 } 19 19 20 20 /** "base64": RFC 2045 default encoding */ 21 21 private static String encDefault = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -
trunk/src/org/openstreetmap/josm/tools/GeoPropertyIndex.java
r7353 r7509 7 7 /** 8 8 * Fast index to look up properties of the earth surface. 9 * 9 * 10 10 * It is expected that there is a relatively slow method to look up the property 11 11 * for a certain coordinate and that there are larger areas with a uniform 12 12 * property. 13 * 13 * 14 14 * This index tries to find rectangles with uniform property and caches them. 15 15 * Rectangles are subdivided, if there are different properties within. 16 16 * (Up to a maximum level, when the slow method is used again.) 17 * 17 * 18 18 * @param <T> the property (like land/water or nation) 19 19 */ 20 20 public class GeoPropertyIndex<T> { 21 21 22 22 /** 23 23 * A method to look up a property of the earth surface. … … 45 45 private final GPLevel<T> root; 46 46 private GPLevel<T> lastLevelUsed; 47 47 48 48 private static final boolean DEBUG = false; 49 49 … … 51 51 * Create new GeoPropertyIndex. 52 52 * @param geoProp the input property that should be made faster by this index 53 * @param maxLevel 53 * @param maxLevel 54 54 */ 55 55 public GeoPropertyIndex(GeoProperty<T> geoProp, int maxLevel) { … … 59 59 this.lastLevelUsed = root; 60 60 } 61 61 62 62 /** 63 63 * Look up the property for a certain point. … … 70 70 return lastLevelUsed.get(ll); 71 71 } 72 72 73 73 public static int index(LatLon ll, int level) { 74 74 long noParts = 1 << level; … … 102 102 return parent.get(ll); 103 103 } 104 104 105 105 private T getBounded(LatLon ll) { 106 106 if (DEBUG) System.err.print("GPLevel["+level+"]"+bbox+" "); … … 117 117 return owner.geoProp.get(ll); 118 118 } 119 119 120 120 if (children == null) { 121 121 @SuppressWarnings("unchecked") … … 123 123 this.children = tmp; 124 124 } 125 125 126 126 int idx = index(ll, level+1); 127 127 if (children[idx] == null) { 128 128 double lon1, lat1; 129 129 switch (idx) { 130 case 0: 130 case 0: 131 131 lon1 = bbox.getTopLeftLon(); 132 132 lat1 = bbox.getBottomRightLat(); … … 136 136 lat1 = bbox.getTopLeftLat(); 137 137 break; 138 case 2: 138 case 2: 139 139 lon1 = bbox.getBottomRightLon(); 140 140 lat1 = bbox.getBottomRightLat(); 141 141 break; 142 case 3: 142 case 3: 143 143 lon1 = bbox.getBottomRightLon(); 144 144 lat1 = bbox.getTopLeftLat(); … … 154 154 return children[idx].getBounded(ll); 155 155 } 156 156 157 157 /** 158 158 * Checks, if a point is inside this tile. … … 163 163 */ 164 164 boolean isInside(LatLon ll) { 165 return bbox.getTopLeftLon() <= ll.lon() && 166 (ll.lon() < bbox.getBottomRightLon() || (ll.lon() == 180.0 && bbox.getBottomRightLon() == 180.0)) && 167 bbox.getBottomRightLat() <= ll.lat() && 165 return bbox.getTopLeftLon() <= ll.lon() && 166 (ll.lon() < bbox.getBottomRightLon() || (ll.lon() == 180.0 && bbox.getBottomRightLon() == 180.0)) && 167 bbox.getBottomRightLat() <= ll.lat() && 168 168 (ll.lat() < bbox.getTopLeftLat() || (ll.lat() == 90.0 && bbox.getTopLeftLat() == 90.0)); 169 169 } -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r7392 r7509 469 469 return new Area(path); 470 470 } 471 471 472 472 /** 473 473 * Returns the Area of a polygon, from its list of nodes. -
trunk/src/org/openstreetmap/josm/tools/InputMapUtils.java
r6557 r7509 17 17 */ 18 18 public final class InputMapUtils { 19 19 20 20 private InputMapUtils() { 21 21 // Hide default constructor for utils classes 22 22 } 23 23 24 24 /** 25 25 * Unassign Ctrl-Shift/Alt-Shift Up/Down from the given component -
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r7012 r7509 5 5 6 6 public final class LanguageInfo { 7 7 8 8 private LanguageInfo() { 9 9 // Hide default constructor for utils classes 10 10 } 11 11 12 12 /** 13 13 * Type of the locale to use … … 126 126 return getJOSMLocaleCode()+"."; 127 127 } 128 128 129 129 public static String getLanguageCodeManifest() { 130 130 return getJOSMLocaleCode()+"_"; -
trunk/src/org/openstreetmap/josm/tools/Pair.java
r7005 r7509 10 10 */ 11 11 public final class Pair<A,B> { 12 12 13 13 /** 14 14 * The first item 15 15 */ 16 16 public A a; 17 17 18 18 /** 19 19 * The second item … … 65 65 66 66 /** 67 * Convenient constructor method 67 * Convenient constructor method 68 68 * @param u The first item 69 69 * @param v The second item -
trunk/src/org/openstreetmap/josm/tools/Predicate.java
r6452 r7509 9 9 */ 10 10 public interface Predicate<T> { 11 11 12 12 /** 13 13 * Determines whether the object passes the test or not -
trunk/src/org/openstreetmap/josm/tools/Property.java
r6223 r7509 8 8 */ 9 9 public interface Property<O, P> { 10 10 11 11 /** 12 12 * Get the value of the property. … … 15 15 */ 16 16 public P get(O obj); 17 17 18 18 /** 19 19 * Set the value of the property for the object. -
trunk/src/org/openstreetmap/josm/tools/RightAndLefthandTraffic.java
r7248 r7509 21 21 */ 22 22 public class RightAndLefthandTraffic { 23 23 24 24 private static class RLTrafficGeoProperty implements GeoProperty<Boolean> { 25 25 … … 46 46 } 47 47 } 48 48 49 49 private static Collection<Area> leftHandTrafficPolygons; 50 50 private static GeoPropertyIndex<Boolean> rlCache; … … 52 52 /** 53 53 * Check if there is right-hand traffic at a certain location. 54 * 54 * 55 55 * TODO: Synchronization can be refined inside the {@link GeoPropertyIndex} 56 * as most look-ups are read-only. 56 * as most look-ups are read-only. 57 57 * @param ll the coordinates of the point 58 58 * @return true if there is right-hand traffic, false if there is left-hand traffic … … 77 77 rlCache = new GeoPropertyIndex<Boolean>(new RLTrafficGeoProperty(), 24); 78 78 } 79 79 80 80 }
Note:
See TracChangeset
for help on using the changeset viewer.