Changeset 8346 in josm
- Timestamp:
- 2015-05-11T13:34:53+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadNotesUrlIdTask.java
r8318 r8346 12 12 public class DownloadNotesUrlIdTask extends DownloadNotesTask { 13 13 14 private final String URL_ID_PATTERN = "https?://www\\.(osm|openstreetmap)\\.org/note/(\\p{Digit}+).*";14 private static final String URL_ID_PATTERN = "https?://www\\.(osm|openstreetmap)\\.org/note/(\\p{Digit}+).*"; 15 15 16 16 @Override -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r8338 r8346 73 73 */ 74 74 public class DrawAction extends MapMode implements MapViewPaintable, SelectionChangedListener, KeyPressReleaseListener, ModifierListener { 75 76 private static final Color ORANGE_TRANSPARENT = new Color(Color.ORANGE.getRed(),Color.ORANGE.getGreen(),Color.ORANGE.getBlue(),128); 77 private static final double PHI = Math.toRadians(90); 78 75 79 private final Cursor cursorJoinNode; 76 80 private final Cursor cursorJoinWay; 77 81 78 82 private transient Node lastUsedNode = null; 79 private static final double PHI = Math.toRadians(90);80 83 private double toleranceMultiplier; 81 84 … … 116 119 private static int snapToIntersectionThreshold; 117 120 121 /** 122 * Constructs a new {@code DrawAction}. 123 * @param mapFrame Map frame 124 */ 118 125 public DrawAction(MapFrame mapFrame) { 119 126 super(tr("Draw"), "node/autonode", tr("Draw nodes"), … … 1323 1330 1324 1331 private JCheckBoxMenuItem checkBox; 1325 public final Color ORANGE_TRANSPARENT = new Color(Color.ORANGE.getRed(),Color.ORANGE.getGreen(),Color.ORANGE.getBlue(),128);1326 1332 1327 1333 public void init() { -
trunk/src/org/openstreetmap/josm/command/PurgeCommand.java
r8338 r8346 38 38 protected Storage<PrimitiveData> makeIncompleteData; 39 39 40 protected Map<PrimitiveId, PrimitiveData> makeIncompleteData _byPrimId;40 protected Map<PrimitiveId, PrimitiveData> makeIncompleteDataByPrimId; 41 41 42 42 protected final ConflictCollection purgedConflicts = new ConflictCollection(); … … 69 69 protected final void saveIncomplete(Collection<OsmPrimitive> makeIncomplete) { 70 70 makeIncompleteData = new Storage<>(new Storage.PrimitiveIdHash()); 71 makeIncompleteData _byPrimId = makeIncompleteData.foreignKey(new Storage.PrimitiveIdHash());71 makeIncompleteDataByPrimId = makeIncompleteData.foreignKey(new Storage.PrimitiveIdHash()); 72 72 73 73 for (OsmPrimitive osm : makeIncomplete) { … … 86 86 for (int i=toPurge.size()-1; i>=0; --i) { 87 87 OsmPrimitive osm = toPurge.get(i); 88 if (makeIncompleteData _byPrimId.containsKey(osm)) {88 if (makeIncompleteDataByPrimId.containsKey(osm)) { 89 89 // we could simply set the incomplete flag 90 90 // but that would not free memory in case the … … 121 121 122 122 for (OsmPrimitive osm : toPurge) { 123 PrimitiveData data = makeIncompleteData _byPrimId.get(osm);123 PrimitiveData data = makeIncompleteDataByPrimId.get(osm); 124 124 if (data != null) { 125 125 if (ds.getPrimitiveById(osm) != osm) -
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r8338 r8346 304 304 return; 305 305 else if (bbox().bounds(search_bbox)) { 306 buckets.search _cache = this;306 buckets.searchCache = this; 307 307 } 308 308 … … 393 393 394 394 private QBLevel<T> root; 395 private QBLevel<T> search _cache;395 private QBLevel<T> searchCache; 396 396 private int size; 397 397 … … 406 406 public final void clear() { 407 407 root = new QBLevel<>(this); 408 search _cache = null;408 searchCache = null; 409 409 size = 0; 410 410 } … … 460 460 @SuppressWarnings("unchecked") 461 461 T t = (T) o; 462 search _cache = null; // Search cache might point to one of removed buckets462 searchCache = null; // Search cache might point to one of removed buckets 463 463 QBLevel<T> bucket = root.findBucket(t.getBBox()); 464 464 if (bucket.remove_content(t)) { … … 496 496 497 497 class QuadBucketIterator implements Iterator<T> { 498 private QBLevel<T> current _node;499 private int content _index;500 private int iterated _over;498 private QBLevel<T> currentNode; 499 private int contentIndex; 500 private int iteratedOver; 501 501 502 502 final QBLevel<T> next_content_node(QBLevel<T> q) { … … 514 514 public QuadBucketIterator(QuadBuckets<T> qb) { 515 515 if (!qb.root.hasChildren() || qb.root.hasContent()) { 516 current _node = qb.root;516 currentNode = qb.root; 517 517 } else { 518 current _node = next_content_node(qb.root);519 } 520 iterated _over = 0;518 currentNode = next_content_node(qb.root); 519 } 520 iteratedOver = 0; 521 521 } 522 522 … … 529 529 530 530 T peek() { 531 if (current _node == null)531 if (currentNode == null) 532 532 return null; 533 while ((current _node.content == null) || (content_index >= current_node.content.size())) {534 content _index = 0;535 current _node = next_content_node(current_node);536 if (current _node == null) {533 while ((currentNode.content == null) || (contentIndex >= currentNode.content.size())) { 534 contentIndex = 0; 535 currentNode = next_content_node(currentNode); 536 if (currentNode == null) { 537 537 break; 538 538 } 539 539 } 540 if (current _node == null || current_node.content == null)540 if (currentNode == null || currentNode.content == null) 541 541 return null; 542 return current _node.content.get(content_index);542 return currentNode.content.get(contentIndex); 543 543 } 544 544 … … 546 546 public T next() { 547 547 T ret = peek(); 548 content _index++;549 iterated _over++;548 contentIndex++; 549 iteratedOver++; 550 550 return ret; 551 551 } … … 557 557 // 2. move the index back since we removed 558 558 // an element 559 content _index--;559 contentIndex--; 560 560 T object = peek(); 561 current _node.remove_content(object);561 currentNode.remove_content(object); 562 562 } 563 563 } … … 581 581 List<T> ret = new ArrayList<>(); 582 582 // Doing this cuts down search cost on a real-life data set by about 25% 583 if (search _cache == null) {584 search _cache = root;583 if (searchCache == null) { 584 searchCache = root; 585 585 } 586 586 // Walk back up the tree when the last search spot can not cover the current search 587 while (search _cache != null && !search_cache.bbox().bounds(search_bbox)) {588 search _cache = search_cache.parent;589 } 590 591 if (search _cache == null) {592 search _cache = root;587 while (searchCache != null && !searchCache.bbox().bounds(search_bbox)) { 588 searchCache = searchCache.parent; 589 } 590 591 if (searchCache == null) { 592 searchCache = root; 593 593 Main.info("bbox: " + search_bbox + " is out of the world"); 594 594 } 595 595 596 // Save parent because search _cache might change during search call597 QBLevel<T> tmp = search _cache.parent;598 599 search _cache.search(search_bbox, ret);596 // Save parent because searchCache might change during search call 597 QBLevel<T> tmp = searchCache.parent; 598 599 searchCache.search(search_bbox, ret); 600 600 601 601 // A way that spans this bucket may be stored in one -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r8345 r8346 108 108 * 'prev' to the next point. 109 109 */ 110 private int x _prev0, y_prev0;110 private int xPrev0, yPrev0; 111 111 112 112 public OffsetIterator(List<Node> nodes, float offset) { … … 130 130 ++idx; 131 131 if (prev != null) { 132 return new Point(x _prev0 + current.x - prev.x, y_prev0 + current.y - prev.y);132 return new Point(xPrev0 + current.x - prev.x, yPrev0 + current.y - prev.y); 133 133 } else { 134 134 return current; … … 152 152 ++idx; 153 153 prev = current; 154 x _prev0 = x_current0;155 y _prev0 = y_current0;154 xPrev0 = x_current0; 155 yPrev0 = y_current0; 156 156 return new Point(x_current0, y_current0); 157 157 } else { … … 166 166 ++idx; 167 167 prev = current; 168 x _prev0 = x_current0;169 y _prev0 = y_current0;168 xPrev0 = x_current0; 169 yPrev0 = y_current0; 170 170 return new Point(x_current0, y_current0); 171 171 } 172 172 173 int m = dx_next*(y_current0 - y _prev0) - dy_next*(x_current0 - x_prev0);174 175 int cx_ = x _prev0 + Math.round((float)m * dx_prev / det);176 int cy_ = y _prev0 + Math.round((float)m * dy_prev / det);173 int m = dx_next*(y_current0 - yPrev0) - dy_next*(x_current0 - xPrev0); 174 175 int cx_ = xPrev0 + Math.round((float)m * dx_prev / det); 176 int cy_ = yPrev0 + Math.round((float)m * dy_prev / det); 177 177 ++idx; 178 178 prev = current; 179 x _prev0 = x_current0;180 y _prev0 = y_current0;179 xPrev0 = x_current0; 180 yPrev0 = y_current0; 181 181 return new Point(cx_, cy_); 182 182 } … … 207 207 return 1; 208 208 209 int d0 = Float.compare(this.style.major _z_index, other.style.major_z_index);209 int d0 = Float.compare(this.style.majorZIndex, other.style.majorZIndex); 210 210 if (d0 != 0) 211 211 return d0; … … 218 218 return -1; 219 219 220 int dz = Float.compare(this.style.z _index, other.style.z_index);220 int dz = Float.compare(this.style.zIndex, other.style.zIndex); 221 221 if (dz != 0) 222 222 return dz; … … 235 235 return -1; 236 236 237 return Float.compare(this.style.object _z_index, other.style.object_z_index);237 return Float.compare(this.style.objectZIndex, other.style.objectZIndex); 238 238 } 239 239 } -
trunk/src/org/openstreetmap/josm/data/projection/AbstractProjection.java
r6883 r8346 26 26 protected Datum datum; 27 27 protected Proj proj; 28 protected double x _0 = 0.0; /* false easting (in meters) */29 protected double y _0 = 0.0; /* false northing (in meters) */30 protected double lon _0 = 0.0; /* central meridian */31 protected double k _0 = 1.0; /* general scale factor */28 protected double x0 = 0.0; /* false easting (in meters) */ 29 protected double y0 = 0.0; /* false northing (in meters) */ 30 protected double lon0 = 0.0; /* central meridian */ 31 protected double k0 = 1.0; /* general scale factor */ 32 32 33 33 public final Ellipsoid getEllipsoid() { … … 48 48 49 49 public final double getFalseEasting() { 50 return x _0;50 return x0; 51 51 } 52 52 53 53 public final double getFalseNorthing() { 54 return y _0;54 return y0; 55 55 } 56 56 57 57 public final double getCentralMeridian() { 58 return lon _0;58 return lon0; 59 59 } 60 60 61 61 public final double getScaleFactor() { 62 return k _0;62 return k0; 63 63 } 64 64 … … 66 66 public EastNorth latlon2eastNorth(LatLon ll) { 67 67 ll = datum.fromWGS84(ll); 68 double[] en = proj.project(Math.toRadians(ll.lat()), Math.toRadians(ll.lon() - lon _0));69 return new EastNorth(ellps.a * k _0 * en[0] + x_0, ellps.a * k_0 * en[1] + y_0);68 double[] en = proj.project(Math.toRadians(ll.lat()), Math.toRadians(ll.lon() - lon0)); 69 return new EastNorth(ellps.a * k0 * en[0] + x0, ellps.a * k0 * en[1] + y0); 70 70 } 71 71 72 72 @Override 73 73 public LatLon eastNorth2latlon(EastNorth en) { 74 double[] latlon_rad = proj.invproject((en.east() - x _0) / ellps.a / k_0, (en.north() - y_0) / ellps.a / k_0);75 LatLon ll = new LatLon(Math.toDegrees(latlon_rad[0]), Math.toDegrees(latlon_rad[1]) + lon _0);74 double[] latlon_rad = proj.invproject((en.east() - x0) / ellps.a / k0, (en.north() - y0) / ellps.a / k0); 75 LatLon ll = new LatLon(Math.toDegrees(latlon_rad[0]), Math.toDegrees(latlon_rad[1]) + lon0); 76 76 return datum.toWGS84(ll); 77 77 } -
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r7371 r8346 175 175 String s = parameters.get(Param.x_0.key); 176 176 if (s != null) { 177 this.x _0 = parseDouble(s, Param.x_0.key);177 this.x0 = parseDouble(s, Param.x_0.key); 178 178 } 179 179 s = parameters.get(Param.y_0.key); 180 180 if (s != null) { 181 this.y _0 = parseDouble(s, Param.y_0.key);181 this.y0 = parseDouble(s, Param.y_0.key); 182 182 } 183 183 s = parameters.get(Param.lon_0.key); 184 184 if (s != null) { 185 this.lon _0 = parseAngle(s, Param.lon_0.key);185 this.lon0 = parseAngle(s, Param.lon_0.key); 186 186 } 187 187 s = parameters.get(Param.k_0.key); 188 188 if (s != null) { 189 this.k _0 = parseDouble(s, Param.k_0.key);189 this.k0 = parseDouble(s, Param.k_0.key); 190 190 } 191 191 s = parameters.get(Param.bounds.key); … … 386 386 s = parameters.get(Param.lat_0.key); 387 387 if (s != null) { 388 projParams.lat _0 = parseAngle(s, Param.lat_0.key);388 projParams.lat0 = parseAngle(s, Param.lat_0.key); 389 389 } 390 390 s = parameters.get(Param.lat_1.key); 391 391 if (s != null) { 392 projParams.lat _1 = parseAngle(s, Param.lat_1.key);392 projParams.lat1 = parseAngle(s, Param.lat_1.key); 393 393 } 394 394 s = parameters.get(Param.lat_2.key); 395 395 if (s != null) { 396 projParams.lat _2 = parseAngle(s, Param.lat_2.key);396 projParams.lat2 = parseAngle(s, Param.lat_2.key); 397 397 } 398 398 proj.initialize(projParams); -
trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java
r8345 r8346 15 15 import static org.openstreetmap.josm.tools.I18n.tr; 16 16 17 import org.openstreetmap.josm.data.projection.CustomProjection.Param; 17 18 import org.openstreetmap.josm.data.projection.Ellipsoid; 18 19 import org.openstreetmap.josm.data.projection.ProjectionConfigurationException; … … 60 61 * projection factor 61 62 */ 62 protected double F;63 protected double f; 63 64 /** 64 65 * radius of the parallel of latitude of the false origin (2SP) or at … … 76 77 ellps = params.ellps; 77 78 e = ellps.e; 78 if (params.lat _0 == null)79 throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", "lat_0"));80 if (params.lat _1 != null && params.lat_2 != null) {81 initialize2SP(params.lat _0, params.lat_1, params.lat_2);79 if (params.lat0 == null) 80 throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", Param.lat_0.key)); 81 if (params.lat1 != null && params.lat2 != null) { 82 initialize2SP(params.lat0, params.lat1, params.lat2); 82 83 } else { 83 initialize1SP(params.lat _0);84 initialize1SP(params.lat0); 84 85 } 85 86 } … … 103 104 104 105 n = (log(m1) - log(m2)) / (log(t1) - log(t2)); 105 F= m1 / (n * pow(t1, n));106 r0 = F* pow(tf, n);106 f = m1 / (n * pow(t1, n)); 107 r0 = f * pow(tf, n); 107 108 } 108 109 … … 120 121 121 122 n = sin(lat_0_rad); 122 F= m0 / (n * pow(t0, n));123 r0 = F* pow(t0, n);123 f = m0 / (n * pow(t0, n)); 124 r0 = f * pow(t0, n); 124 125 } 125 126 … … 153 154 double sinphi = sin(phi); 154 155 double L = (0.5*log((1+sinphi)/(1-sinphi))) - e/2*log((1+e*sinphi)/(1-e*sinphi)); 155 double r = F*exp(-n*L);156 double r = f*exp(-n*L); 156 157 double gamma = n*lambda; 157 158 double X = r*sin(gamma); … … 165 166 double gamma = atan(east / (r0-north)); 166 167 double lambda = gamma/n; 167 double latIso = (-1/n) * log(abs(r/ F));168 double latIso = (-1/n) * log(abs(r/f)); 168 169 double phi = ellps.latitude(latIso, e, epsilon); 169 170 return new double[] { phi, lambda }; -
trunk/src/org/openstreetmap/josm/data/projection/proj/ProjParameters.java
r5230 r8346 11 11 public Ellipsoid ellps; 12 12 13 public Double lat_0; 14 public Double lat_1; 15 public Double lat_2; 16 13 public Double lat0; 14 public Double lat1; 15 public Double lat2; 17 16 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java
r6920 r8346 35 35 private double alpha; 36 36 private double b0; 37 private double K;37 private double k; 38 38 39 39 private static final double EPSILON = 1e-11; … … 41 41 @Override 42 42 public void initialize(ProjParameters params) throws ProjectionConfigurationException { 43 if (params.lat _0 == null)43 if (params.lat0 == null) 44 44 throw new ProjectionConfigurationException(tr("Parameter ''{0}'' required.", "lat_0")); 45 45 ellps = params.ellps; 46 initialize(params.lat _0);46 initialize(params.lat0); 47 47 } 48 48 … … 52 52 alpha = sqrt(1 + (ellps.eb2 * pow(cos(phi0), 4))); 53 53 b0 = asin(sin(phi0) / alpha); 54 K= log(tan(PI / 4 + b0 / 2)) - alpha54 k = log(tan(PI / 4 + b0 / 2)) - alpha 55 55 * log(tan(PI / 4 + phi0 / 2)) + alpha * ellps.e / 2 56 56 * log((1 + ellps.e * sin(phi0)) / (1 - ellps.e * sin(phi0))); … … 71 71 72 72 double S = alpha * log(tan(PI / 4 + phi / 2)) - alpha * ellps.e / 2 73 * log((1 + ellps.e * sin(phi)) / (1 - ellps.e * sin(phi))) + K;73 * log((1 + ellps.e * sin(phi)) / (1 - ellps.e * sin(phi))) + k; 74 74 double b = 2 * (atan(exp(S)) - PI / 4); 75 75 double l = alpha * lambda; … … 94 94 double lambda = l / alpha; 95 95 double phi = b; 96 double S= 0;96 double s = 0; 97 97 98 98 double prevPhi = -1000; … … 103 103 throw new RuntimeException("Two many iterations"); 104 104 prevPhi = phi; 105 S = 1 / alpha * (log(tan(PI / 4 + b / 2)) - K) + ellps.e105 s = 1 / alpha * (log(tan(PI / 4 + b / 2)) - k) + ellps.e 106 106 * log(tan(PI / 4 + asin(ellps.e * sin(phi)) / 2)); 107 phi = 2 * atan(exp( S)) - PI / 2;107 phi = 2 * atan(exp(s)) - PI / 2; 108 108 } 109 109 return new double[] { phi, lambda }; -
trunk/src/org/openstreetmap/josm/data/validation/TestError.java
r7848 r8346 40 40 /** Deeper error description */ 41 41 private String description; 42 private String description _en;42 private String descriptionEn; 43 43 /** The affected primitives */ 44 44 private Collection<? extends OsmPrimitive> primitives; … … 66 66 this.message = message; 67 67 this.description = description; 68 this.description _en = description_en;68 this.descriptionEn = description_en; 69 69 this.primitives = primitives; 70 70 this.highlighted = highlighted; … … 194 194 public String getIgnoreSubGroup() { 195 195 String ignorestring = getIgnoreGroup(); 196 if (description _en != null) {197 ignorestring += "_" + description _en;196 if (descriptionEn != null) { 197 ignorestring += "_" + descriptionEn; 198 198 } 199 199 return ignorestring; -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r8345 r8346 169 169 170 170 /** MultiMap of all relations, regardless of keys */ 171 private MultiMap<List<RelationMember>, OsmPrimitive> relations _nokeys;171 private MultiMap<List<RelationMember>, OsmPrimitive> relationsNoKeys; 172 172 173 173 /** List of keys without useful information */ … … 186 186 super.startTest(monitor); 187 187 relations = new MultiMap<>(1000); 188 relations _nokeys = new MultiMap<>(1000);188 relationsNoKeys = new MultiMap<>(1000); 189 189 } 190 190 … … 199 199 } 200 200 relations = null; 201 for (Set<OsmPrimitive> duplicated : relations _nokeys.values()) {201 for (Set<OsmPrimitive> duplicated : relationsNoKeys.values()) { 202 202 if (duplicated.size() > 1) { 203 203 TestError testError = new TestError(this, Severity.WARNING, tr("Relations with same members"), SAME_RELATION, duplicated); … … 205 205 } 206 206 } 207 relations _nokeys = null;207 relationsNoKeys = null; 208 208 } 209 209 … … 218 218 RelationPair rKey = new RelationPair(rMembers, rkeys); 219 219 relations.put(rKey, r); 220 relations _nokeys.put(rMembers, r);220 relationsNoKeys.put(rMembers, r); 221 221 } 222 222 -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r8285 r8346 137 137 private Set<MyWaySegment> ways; 138 138 private QuadBuckets<Node> endnodes; // nodes at end of way 139 private QuadBuckets<Node> endnodes _highway; // nodes at end of way139 private QuadBuckets<Node> endnodesHighway; // nodes at end of way 140 140 private QuadBuckets<Node> middlenodes; // nodes in middle of way 141 141 private Set<Node> othernodes; // nodes appearing at least twice … … 159 159 ways = new HashSet<>(); 160 160 endnodes = new QuadBuckets<>(); 161 endnodes _highway = new QuadBuckets<>();161 endnodesHighway = new QuadBuckets<>(); 162 162 middlenodes = new QuadBuckets<>(); 163 163 othernodes = new HashSet<>(); … … 176 176 } 177 177 for (Node en : s.nearbyNodes(mindist)) { 178 if (en == null || !s.highway || !endnodes _highway.contains(en)) {178 if (en == null || !s.highway || !endnodesHighway.contains(en)) { 179 179 continue; 180 180 } … … 209 209 continue; 210 210 } 211 if (endnodes _highway.contains(en) && !s.highway && !s.w.concernsArea()) {211 if (endnodesHighway.contains(en) && !s.highway && !s.w.concernsArea()) { 212 212 map.put(en, s.w); 213 213 } else if (endnodes.contains(en) && !s.w.concernsArea()) { … … 278 278 ways = null; 279 279 endnodes = null; 280 endnodes _highway = null;280 endnodesHighway = null; 281 281 middlenodes = null; 282 282 othernodes = null; … … 389 389 nearbyNodeCache = null; 390 390 List<LatLon> bounds = this.getBounds(dist); 391 List<Node> found_nodes = endnodes _highway.search(new BBox(bounds.get(0), bounds.get(1)));391 List<Node> found_nodes = endnodesHighway.search(new BBox(bounds.get(0), bounds.get(1))); 392 392 found_nodes.addAll(endnodes.search(new BBox(bounds.get(0), bounds.get(1)))); 393 393 … … 448 448 QuadBuckets<Node> set = endnodes; 449 449 if (w.hasKey("highway") || w.hasKey("railway")) { 450 set = endnodes _highway;450 set = endnodesHighway; 451 451 } 452 452 addNode(w.firstNode(), set); … … 458 458 boolean m = middlenodes.contains(n); 459 459 boolean e = endnodes.contains(n); 460 boolean eh = endnodes _highway.contains(n);460 boolean eh = endnodesHighway.contains(n); 461 461 boolean o = othernodes.contains(n); 462 462 if (!m && !e && !o && !eh) { … … 467 467 endnodes.remove(n); 468 468 } else if (eh) { 469 endnodes _highway.remove(n);469 endnodesHighway.remove(n); 470 470 } else { 471 471 middlenodes.remove(n); -
trunk/src/org/openstreetmap/josm/gui/NotificationManager.java
r8126 r8346 73 73 private static NotificationManager INSTANCE = null; 74 74 75 private final Color PANEL_SEMITRANSPARENT = new Color(224, 236, 249, 230);76 private final Color PANEL_OPAQUE = new Color(224, 236, 249);75 private static final Color PANEL_SEMITRANSPARENT = new Color(224, 236, 249, 230); 76 private static final Color PANEL_OPAQUE = new Color(224, 236, 249); 77 77 78 78 public static synchronized NotificationManager getInstance() { -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r8342 r8346 95 95 public static final BooleanProperty PROP_DYNAMIC_BUTTONS = new BooleanProperty("dialog.dynamic.buttons", false); 96 96 97 private final transient ParametrizedEnumProperty<ButtonHidingType> PROP_BUTTON_HIDING = new ParametrizedEnumProperty<ToggleDialog.ButtonHidingType>(98 ButtonHidingType.class, ButtonHidingType.DYNAMIC) {97 private final transient ParametrizedEnumProperty<ButtonHidingType> propButtonHiding = 98 new ParametrizedEnumProperty<ToggleDialog.ButtonHidingType>(ButtonHidingType.class, ButtonHidingType.DYNAMIC) { 99 99 @Override 100 100 protected String getKey(String... params) { … … 107 107 } catch (IllegalArgumentException e) { 108 108 // Legacy settings 109 return Boolean.parseBoolean(s) ?ButtonHidingType.DYNAMIC:ButtonHidingType.ALWAYS_SHOWN;109 return Boolean.parseBoolean(s) ? ButtonHidingType.DYNAMIC : ButtonHidingType.ALWAYS_SHOWN; 110 110 } 111 111 } … … 241 241 isDocked = Main.pref.getBoolean(preferencePrefix+".docked", true); 242 242 isCollapsed = Main.pref.getBoolean(preferencePrefix+".minimized", false); 243 buttonHiding = PROP_BUTTON_HIDING.get();243 buttonHiding = propButtonHiding.get(); 244 244 245 245 /** show the minimize button */ … … 490 490 /** the label which displays the dialog's title **/ 491 491 private final JLabel lblTitle; 492 private final JComponent lblTitle _weak;492 private final JComponent lblTitleWeak; 493 493 /** the button which shows whether buttons are dynamic or not */ 494 494 private final JButton buttonsHide; … … 512 512 513 513 // Cannot add the label directly since it would displace other elements on resize 514 lblTitle _weak = new JComponent() {514 lblTitleWeak = new JComponent() { 515 515 @Override 516 516 public void paintComponent(Graphics g) { … … 518 518 } 519 519 }; 520 lblTitle _weak.setPreferredSize(new Dimension(Integer.MAX_VALUE,20));521 lblTitle _weak.setMinimumSize(new Dimension(0,20));522 add(lblTitle _weak, GBC.std().fill(GBC.HORIZONTAL));520 lblTitleWeak.setPreferredSize(new Dimension(Integer.MAX_VALUE,20)); 521 lblTitleWeak.setMinimumSize(new Dimension(0,20)); 522 add(lblTitleWeak, GBC.std().fill(GBC.HORIZONTAL)); 523 523 524 524 buttonsHide = new JButton(ImageProvider.get("misc", buttonHiding != ButtonHidingType.ALWAYS_SHOWN … … 597 597 public void setTitle(String title) { 598 598 lblTitle.setText(title); 599 lblTitle _weak.repaint();599 lblTitleWeak.repaint(); 600 600 } 601 601 … … 767 767 protected void setIsButtonHiding(ButtonHidingType val) { 768 768 buttonHiding = val; 769 PROP_BUTTON_HIDING.put(val);769 propButtonHiding.put(val); 770 770 refreshHidingButtons(); 771 771 } -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserDialogManager.java
r8345 r8346 33 33 * @since 2019 34 34 */ 35 public class HistoryBrowserDialogManager implements MapView.LayerChangeListener { 35 public final class HistoryBrowserDialogManager implements MapView.LayerChangeListener { 36 37 private static final String WINDOW_GEOMETRY_PREF = HistoryBrowserDialogManager.class.getName() + ".geometry"; 36 38 37 39 private static HistoryBrowserDialogManager instance; … … 89 91 return false; 90 92 } 91 92 private final String WINDOW_GEOMETRY_PREF = getClass().getName() + ".geometry";93 93 94 94 protected void placeOnScreen(HistoryBrowserDialog dialog) { -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DateFilterPanel.java
r8308 r8346 30 30 private transient ActionListener filterAppliedListener; 31 31 32 private final String PREF_DATE_0;33 private final String PREF_DATE_MIN;34 private final String PREF_DATE_MAX;32 private final String prefDate0; 33 private final String prefDateMin; 34 private final String prefDateMax; 35 35 36 36 /** … … 41 41 public DateFilterPanel(GpxLayer layer, String preferencePrefix, boolean enabled) { 42 42 super(new GridBagLayout()); 43 PREF_DATE_0 = preferencePrefix+".showzerotimestamp";44 PREF_DATE_MIN= preferencePrefix+".mintime";45 PREF_DATE_MAX= preferencePrefix+".maxtime";43 prefDate0 = preferencePrefix+".showzerotimestamp"; 44 prefDateMin = preferencePrefix+".mintime"; 45 prefDateMax = preferencePrefix+".maxtime"; 46 46 this.layer = layer; 47 47 … … 101 101 */ 102 102 public void saveInPrefs() { 103 Main.pref.putLong( PREF_DATE_MIN, dateFrom.getDate().getTime());104 Main.pref.putLong( PREF_DATE_MAX, dateTo.getDate().getTime());105 Main.pref.put( PREF_DATE_0, noTimestampCb.isSelected());103 Main.pref.putLong(prefDateMin, dateFrom.getDate().getTime()); 104 Main.pref.putLong(prefDateMax, dateTo.getDate().getTime()); 105 Main.pref.put(prefDate0, noTimestampCb.isSelected()); 106 106 } 107 107 … … 111 111 */ 112 112 public void loadFromPrefs() { 113 long t1 =Main.pref.getLong( PREF_DATE_MIN, 0);113 long t1 =Main.pref.getLong(prefDateMin, 0); 114 114 if (t1!=0) dateFrom.setDate(new Date(t1)); 115 long t2 =Main.pref.getLong( PREF_DATE_MAX, 0);115 long t2 =Main.pref.getLong(prefDateMax, 0); 116 116 if (t2!=0) dateTo.setDate(new Date(t2)); 117 noTimestampCb.setSelected(Main.pref.getBoolean( PREF_DATE_0, false));117 noTimestampCb.setSelected(Main.pref.getBoolean(prefDate0, false)); 118 118 } 119 119 -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java
r8087 r8346 23 23 public static final String[] REPEAT_IMAGE_KEYS = {REPEAT_IMAGE, REPEAT_IMAGE_WIDTH, REPEAT_IMAGE_HEIGHT, REPEAT_IMAGE_OPACITY, null, null}; 24 24 25 public float major _z_index;26 public float z _index;27 public float object _z_index;25 public float majorZIndex; 26 public float zIndex; 27 public float objectZIndex; 28 28 public boolean isModifier; // false, if style can serve as main style for the 29 29 // primitive; true, if it is a highlight or modifier 30 30 31 31 public ElemStyle(float major_z_index, float z_index, float object_z_index, boolean isModifier) { 32 this.major _z_index = major_z_index;33 this.z _index = z_index;34 this.object _z_index = object_z_index;32 this.majorZIndex = major_z_index; 33 this.zIndex = z_index; 34 this.objectZIndex = object_z_index; 35 35 this.isModifier = isModifier; 36 36 } 37 37 38 38 protected ElemStyle(Cascade c, float default_major_z_index) { 39 major _z_index = c.get(MAJOR_Z_INDEX, default_major_z_index, Float.class);40 z _index = c.get(Z_INDEX, 0f, Float.class);41 object _z_index = c.get(OBJECT_Z_INDEX, 0f, Float.class);39 majorZIndex = c.get(MAJOR_Z_INDEX, default_major_z_index, Float.class); 40 zIndex = c.get(Z_INDEX, 0f, Float.class); 41 objectZIndex = c.get(OBJECT_Z_INDEX, 0f, Float.class); 42 42 isModifier = c.get(MODIFIER, false, Boolean.class); 43 43 } … … 208 208 return false; 209 209 ElemStyle s = (ElemStyle) o; 210 return major _z_index == s.major_z_index &&211 z _index == s.z_index &&212 object _z_index == s.object_z_index &&210 return majorZIndex == s.majorZIndex && 211 zIndex == s.zIndex && 212 objectZIndex == s.objectZIndex && 213 213 isModifier == s.isModifier; 214 214 } … … 217 217 public int hashCode() { 218 218 int hash = 5; 219 hash = 41 * hash + Float.floatToIntBits(this.major _z_index);220 hash = 41 * hash + Float.floatToIntBits(this.z _index);221 hash = 41 * hash + Float.floatToIntBits(this.object _z_index);219 hash = 41 * hash + Float.floatToIntBits(this.majorZIndex); 220 hash = 41 * hash + Float.floatToIntBits(this.zIndex); 221 hash = 41 * hash + Float.floatToIntBits(this.objectZIndex); 222 222 hash = 41 * hash + (isModifier ? 1 : 0); 223 223 return hash; … … 226 226 @Override 227 227 public String toString() { 228 return String.format("z_idx=[%s/%s/%s] ", major _z_index, z_index, object_z_index) + (isModifier ? "modifier " : "");228 return String.format("z_idx=[%s/%s/%s] ", majorZIndex, zIndex, objectZIndex) + (isModifier ? "modifier " : ""); 229 229 } 230 230 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r8087 r8346 47 47 48 48 public final String prefix; 49 public final float default _major_z_index;49 public final float defaultMajorZIndex; 50 50 51 51 LineType(String prefix, float default_major_z_index) { 52 52 this.prefix = prefix; 53 this.default _major_z_index = default_major_z_index;53 this.defaultMajorZIndex = default_major_z_index; 54 54 } 55 55 } … … 258 258 } 259 259 260 return new LineElemStyle(c, type.default _major_z_index, line, color, dashesLine, dashesBackground, offset, realWidth);260 return new LineElemStyle(c, type.defaultMajorZIndex, line, color, dashesLine, dashesBackground, offset, realWidth); 261 261 } 262 262 -
trunk/src/org/openstreetmap/josm/io/DiffResultProcessor.java
r8287 r8346 35 35 36 36 private static class DiffResultEntry { 37 p ublic long new_id;38 p ublic int new_version;37 private long newId; 38 private int newVersion; 39 39 } 40 40 … … 128 128 processed.add(p); 129 129 if (!p.isDeleted()) { 130 p.setOsmId(entry.new _id, entry.new_version);130 p.setOsmId(entry.newId, entry.newVersion); 131 131 p.setVisible(true); 132 132 } else { … … 174 174 DiffResultEntry entry = new DiffResultEntry(); 175 175 if (atts.getValue("new_id") != null) { 176 entry.new _id = Long.parseLong(atts.getValue("new_id"));176 entry.newId = Long.parseLong(atts.getValue("new_id")); 177 177 } 178 178 if (atts.getValue("new_version") != null) { 179 entry.new _version = Integer.parseInt(atts.getValue("new_version"));179 entry.newVersion = Integer.parseInt(atts.getValue("new_version")); 180 180 } 181 181 diffResults.put(id, entry); -
trunk/src/org/openstreetmap/josm/io/NmeaReader.java
r8342 r8346 154 154 } 155 155 public int getParserZeroCoordinates() { 156 return ps.zero _coord;156 return ps.zeroCoord; 157 157 } 158 158 public int getParserChecksumErrors() { 159 return ps.checksum _errors+ps.no_checksum;159 return ps.checksumErrors+ps.noChecksum; 160 160 } 161 161 public int getParserMalformed() { … … 180 180 return; 181 181 sb.append((char)loopstart_char); 182 ps.p _Date="010100"; // TODO date problem182 ps.pDate="010100"; // TODO date problem 183 183 while(true) { 184 184 // don't load unparsable files completely to memory … … 209 209 private static class NMEAParserState { 210 210 protected Collection<WayPoint> waypoints = new ArrayList<>(); 211 protected String p _Time;212 protected String p _Date;213 protected WayPoint p _Wp;214 215 protected int success = 0; // number of successfully parse nd sentences211 protected String pTime; 212 protected String pDate; 213 protected WayPoint pWp; 214 215 protected int success = 0; // number of successfully parsed sentences 216 216 protected int malformed = 0; 217 protected int checksum _errors = 0;218 protected int no _checksum = 0;217 protected int checksumErrors = 0; 218 protected int noChecksum = 0; 219 219 protected int unknown = 0; 220 protected int zero _coord = 0;220 protected int zeroCoord = 0; 221 221 } 222 222 … … 243 243 } 244 244 if (Integer.parseInt(chkstrings[1].substring(0,2),16) != chk) { 245 ps.checksum _errors++;246 ps.p _Wp=null;245 ps.checksumErrors++; 246 ps.pWp=null; 247 247 return false; 248 248 } 249 249 } else { 250 ps.no _checksum++;250 ps.noChecksum++; 251 251 } 252 252 // now for the content … … 254 254 String accu; 255 255 256 WayPoint currentwp = ps.p _Wp;257 String currentDate = ps.p _Date;256 WayPoint currentwp = ps.pWp; 257 String currentDate = ps.pDate; 258 258 259 259 // handle the packet content … … 271 271 272 272 if ((latLon.lat()==0.0) && (latLon.lon()==0.0)) { 273 ps.zero _coord++;273 ps.zeroCoord++; 274 274 return false; 275 275 } … … 279 279 Date d = readTime(currentDate+accu); 280 280 281 if((ps.p _Time==null) || (currentwp==null) || !ps.p_Time.equals(accu)) {281 if((ps.pTime==null) || (currentwp==null) || !ps.pTime.equals(accu)) { 282 282 // this node is newer than the previous, create a new waypoint. 283 283 // no matter if previous WayPoint was null, we got something 284 284 // better now. 285 ps.p _Time=accu;285 ps.pTime=accu; 286 286 currentwp = new WayPoint(latLon); 287 287 } … … 384 384 e[GPRMC.LENGTH_EAST.position] 385 385 ); 386 if( (latLon.lat()==0.0) && (latLon.lon()==0.0)) {387 ps.zero _coord++;386 if(latLon.lat()==0.0 && latLon.lon()==0.0) { 387 ps.zeroCoord++; 388 388 return false; 389 389 } … … 394 394 Date d = readTime(currentDate+time); 395 395 396 if( (ps.p_Time==null) || (currentwp==null) || !ps.p_Time.equals(time)) {396 if(ps.pTime==null || currentwp==null || !ps.pTime.equals(time)) { 397 397 // this node is newer than the previous, create a new waypoint. 398 ps.p _Time=time;398 ps.pTime=time; 399 399 currentwp = new WayPoint(latLon); 400 400 } … … 426 426 return false; 427 427 } 428 ps.p _Date = currentDate;429 if(ps.p _Wp != currentwp) {430 if(ps.p _Wp!=null) {431 ps.p _Wp.setTime();432 } 433 ps.p _Wp = currentwp;428 ps.pDate = currentDate; 429 if(ps.pWp != currentwp) { 430 if(ps.pWp!=null) { 431 ps.pWp.setTime(); 432 } 433 ps.pWp = currentwp; 434 434 ps.waypoints.add(currentwp); 435 435 ps.success++; … … 441 441 // out of bounds and such 442 442 ps.malformed++; 443 ps.p _Wp=null;443 ps.pWp=null; 444 444 return false; 445 445 } -
trunk/src/org/openstreetmap/josm/io/NoteWriter.java
r8225 r8346 23 23 public class NoteWriter extends XmlWriter { 24 24 25 private final DateFormat ISO8601_FORMAT= DateUtils.newIsoDateTimeFormat();25 private final DateFormat iso8601Format = DateUtils.newIsoDateTimeFormat(); 26 26 27 27 /** … … 53 53 out.print("lat=\"" + note.getLatLon().lat() + "\" "); 54 54 out.print("lon=\"" + note.getLatLon().lon() + "\" "); 55 out.print("created_at=\"" + ISO8601_FORMAT.format(note.getCreatedAt()) + "\" ");55 out.print("created_at=\"" + iso8601Format.format(note.getCreatedAt()) + "\" "); 56 56 if (note.getClosedAt() != null) { 57 out.print("closed_at=\"" + ISO8601_FORMAT.format(note.getClosedAt()) + "\" ");57 out.print("closed_at=\"" + iso8601Format.format(note.getClosedAt()) + "\" "); 58 58 } 59 59 … … 72 72 out.print(" <comment"); 73 73 out.print(" action=\"" + comment.getNoteAction() + "\" "); 74 out.print("timestamp=\"" + ISO8601_FORMAT.format(comment.getCommentTimestamp()) + "\" ");74 out.print("timestamp=\"" + iso8601Format.format(comment.getCommentTimestamp()) + "\" "); 75 75 if (comment.getUser() != null && !comment.getUser().equals(User.getAnonymous())) { 76 76 out.print("uid=\"" + comment.getUser().getId() + "\" "); -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r8342 r8346 16 16 * 17 17 * Revision 1.13 2009/12/07 17:43:17 stuart 18 * Compute equiv _max for int[] ctor18 * Compute equivMax for int[] ctor 19 19 * 20 20 * Revision 1.12 2009/12/07 17:34:46 stuart … … 102 102 /** 1 more than the maximum equivalence value used for this or its 103 103 sibling file. */ 104 private int equiv _max = 1;104 private int equivMax = 1; 105 105 106 106 /** When set to true, the comparison uses a heuristic to speed it up. … … 111 111 /** When set to true, the algorithm returns a guarranteed minimal 112 112 set of changes. This makes things slower, sometimes much slower. */ 113 public boolean no _discards = false;113 public boolean noDiscards = false; 114 114 115 115 private int[] xvec, yvec; /* Vectors being compared. */ … … 352 352 if (xoff == xlim) { 353 353 while (yoff < ylim) { 354 filevec[1].changed _flag[1+filevec[1].realindexes[yoff++]] = true;354 filevec[1].changedFlag[1+filevec[1].realindexes[yoff++]] = true; 355 355 } 356 356 } else if (yoff == ylim) { 357 357 while (xoff < xlim) { 358 filevec[0].changed _flag[1+filevec[0].realindexes[xoff++]] = true;358 filevec[0].changedFlag[1+filevec[0].realindexes[xoff++]] = true; 359 359 } 360 360 } else { … … 524 524 525 525 int diags = 526 filevec[0].nondiscarded _lines + filevec[1].nondiscarded_lines + 3;526 filevec[0].nondiscardedLines + filevec[1].nondiscardedLines + 3; 527 527 fdiag = new int[diags]; 528 fdiagoff = filevec[1].nondiscarded _lines + 1;528 fdiagoff = filevec[1].nondiscardedLines + 1; 529 529 bdiag = new int[diags]; 530 bdiagoff = filevec[1].nondiscarded _lines + 1;531 532 compareseq (0, filevec[0].nondiscarded _lines,533 0, filevec[1].nondiscarded _lines);530 bdiagoff = filevec[1].nondiscardedLines + 1; 531 532 compareseq (0, filevec[0].nondiscardedLines, 533 0, filevec[1].nondiscardedLines); 534 534 fdiag = null; 535 535 bdiag = null; … … 543 543 of `struct change's -- an edit script. */ 544 544 return bld.build_script( 545 filevec[0].changed _flag,546 filevec[0].buffered _lines,547 filevec[1].changed _flag,548 filevec[1].buffered _lines545 filevec[0].changedFlag, 546 filevec[0].bufferedLines, 547 filevec[1].changedFlag, 548 filevec[1].bufferedLines 549 549 ); 550 550 … … 607 607 Allocate an extra element, always zero, at each end of each vector. 608 608 */ 609 changed _flag = new boolean[buffered_lines + 2];609 changedFlag = new boolean[bufferedLines + 2]; 610 610 } 611 611 … … 615 615 */ 616 616 int[] equivCount() { 617 int[] equiv_count = new int[equiv _max];618 for (int i = 0; i < buffered _lines; ++i) {617 int[] equiv_count = new int[equivMax]; 618 for (int i = 0; i < bufferedLines; ++i) { 619 619 ++equiv_count[equivs[i]]; 620 620 } … … 658 658 */ 659 659 private byte[] discardable(final int[] counts) { 660 final int end = buffered _lines;660 final int end = bufferedLines; 661 661 final byte[] discards = new byte[end]; 662 662 final int[] equivs = this.equivs; … … 692 692 */ 693 693 private void filterDiscards(final byte[] discards) { 694 final int end = buffered _lines;694 final int end = bufferedLines; 695 695 696 696 for (int i = 0; i < end; i++) … … 808 808 */ 809 809 private void discard(final byte[] discards) { 810 final int end = buffered _lines;810 final int end = bufferedLines; 811 811 int j = 0; 812 812 for (int i = 0; i < end; ++i) 813 if (no _discards || discards[i] == 0)813 if (noDiscards || discards[i] == 0) 814 814 { 815 815 undiscarded[j] = equivs[i]; 816 816 realindexes[j++] = i; 817 817 } else { 818 changed _flag[1+i] = true;819 } 820 nondiscarded _lines = j;818 changedFlag[1+i] = true; 819 } 820 nondiscardedLines = j; 821 821 } 822 822 823 823 FileData(int length) { 824 buffered _lines = length;824 bufferedLines = length; 825 825 equivs = new int[length]; 826 undiscarded = new int[buffered _lines];827 realindexes = new int[buffered _lines];826 undiscarded = new int[bufferedLines]; 827 realindexes = new int[bufferedLines]; 828 828 } 829 829 … … 834 834 Integer ir = h.get(data[i]); 835 835 if (ir == null) { 836 h.put(data[i],equivs[i] = equiv _max++);836 h.put(data[i],equivs[i] = equivMax++); 837 837 } else { 838 838 equivs[i] = ir.intValue(); … … 855 855 856 856 void shift_boundaries(FileData f) { 857 final boolean[] changed = changed _flag;858 final boolean[] other_changed = f.changed _flag;857 final boolean[] changed = changedFlag; 858 final boolean[] other_changed = f.changedFlag; 859 859 int i = 0; 860 860 int j = 0; 861 int i_end = buffered _lines;861 int i_end = bufferedLines; 862 862 int preceding = -1; 863 863 int other_preceding = -1; … … 930 930 931 931 /** Number of elements (lines) in this file. */ 932 private final int buffered _lines;932 private final int bufferedLines; 933 933 934 934 /** Vector, indexed by line number, containing an equivalence code for … … 946 946 947 947 /** Total number of nondiscarded lines. */ 948 private int nondiscarded _lines;948 private int nondiscardedLines; 949 949 950 950 /** Array, indexed by real origin-1 line number, 951 951 containing true for a line that is an insertion or a deletion. 952 952 The results of comparison are stored here. */ 953 private boolean[] changed _flag;953 private boolean[] changedFlag; 954 954 } 955 955 }
Note:
See TracChangeset
for help on using the changeset viewer.