Changeset 8444 in josm
- Timestamp:
- 2015-06-02T16:41:37+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 154 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/audio/AudioFastSlowAction.java
r6883 r8444 29 29 super(name, iconName, tooltip, shortcut, true); 30 30 multiplier = Main.pref.getDouble("audio.fastfwdmultiplier", 1.3); 31 if (! 31 if (!fast) 32 32 multiplier = 1.0 / multiplier; 33 33 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r7749 r8444 83 83 String[] table = url.split("\\?|=|&"); 84 84 for (int i = 0; i<table.length; i++) { 85 if ("bbox".equals(table[i]) && i<table.length-1 85 if ("bbox".equals(table[i]) && i<table.length-1) 86 86 return download(newLayer, new Bounds(table[i+1], ",", ParseMethod.LEFT_BOTTOM_RIGHT_TOP), progressMonitor); 87 87 } -
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTask.java
r8291 r8444 64 64 if (children != null) { 65 65 for (OsmPrimitive p: children) { 66 if (! 66 if (!p.isNew()) { 67 67 this.children.put(p.getId(), OsmPrimitiveType.from(p)); 68 68 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r8413 r8444 691 691 if(selectedWay != null) { 692 692 int posn0 = selectedWay.getNodes().indexOf(currentNode); 693 if (posn0 != -1 && // n0 is part of way693 if (posn0 != -1 && // n0 is part of way 694 694 (posn0 >= 1 && targetNode.equals(selectedWay.getNode(posn0-1))) || // previous node 695 695 (posn0 < selectedWay.getNodesCount()-1) && targetNode.equals(selectedWay.getNode(posn0+1))) { // next node … … 1491 1491 // heading of segment from current to calculated point, not to mouse position 1492 1492 1493 if (baseHeading >= 0) { // there is previous line segment with some heading1493 if (baseHeading >= 0) { // there is previous line segment with some heading 1494 1494 angle = hdg - baseHeading; 1495 1495 if (angle < 0) { … … 1551 1551 } 1552 1552 } 1553 if (customBaseHeading >= 0) {1553 if (customBaseHeading >= 0) { 1554 1554 pointsToProject.add(segmentPoint1); 1555 1555 pointsToProject.add(segmentPoint2); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java
r8395 r8444 526 526 } 527 527 } else if (mode == Mode.extrude) { 528 if ( e.getClickCount() == 2 && e.getPoint().equals(initialMousePos)) {528 if (e.getClickCount() == 2 && e.getPoint().equals(initialMousePos)) { 529 529 // double click adds a new node 530 530 addNewNode(e); … … 857 857 EastNorth n2en = selectedSegment.getSecondNode().getEastNorth(); 858 858 if (n1en.distance(prevNode.getEastNorth())<1e-4 || 859 n2en.distance(nextNode.getEastNorth())<1e-4 859 n2en.distance(nextNode.getEastNorth())<1e-4) { 860 860 return false; 861 861 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r8419 r8444 156 156 mv.addTemporaryLayer(this); 157 157 158 helpLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.hepler-line", "1" 158 helpLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.hepler-line", "1")); 159 159 refLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.ref-line", "1 2 2")); 160 160 mainColor = Main.pref.getColor(marktr("make parallel helper line"), null); -
trunk/src/org/openstreetmap/josm/actions/mapmode/PlayHeadDragMode.java
r8393 r8444 55 55 if ((ev.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0) return; 56 56 Point p = ev.getPoint(); 57 if (! 57 if (!dragging) { 58 58 if (p.distance(mouseStart) < 3) return; 59 59 playHeadMarker.startDrag(); … … 68 68 Point p = ev.getPoint(); 69 69 mouseStart = null; 70 if (ev.getButton() != MouseEvent.BUTTON1 || p == null || ! 70 if (ev.getButton() != MouseEvent.BUTTON1 || p == null || !dragging) 71 71 return; 72 72 … … 75 75 76 76 EastNorth en = Main.map.mapView.getEastNorth(ev.getX(), ev.getY()); 77 if (! 77 if (!shift) { 78 78 playHeadMarker.reposition(en); 79 79 } else { -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r8441 r8444 538 538 } 539 539 540 if ( lastMousePos == null) {540 if (lastMousePos == null) { 541 541 lastMousePos = e.getPoint(); 542 542 return; -
trunk/src/org/openstreetmap/josm/actions/relation/DeleteRelationsAction.java
r7937 r8444 30 30 return; 31 31 org.openstreetmap.josm.actions.mapmode.DeleteAction 32 .deleteRelation( Main.main.getEditLayer(), toDelete);32 .deleteRelation(Main.main.getEditLayer(), toDelete); 33 33 // clear selection after deletion 34 34 if (Main.map.relationListDialog!=null) -
trunk/src/org/openstreetmap/josm/actions/relation/DuplicateRelationAction.java
r7937 r8444 52 52 protected void updateEnabledState() { 53 53 // only one selected relation can be edited 54 setEnabled( relations.size()==1);54 setEnabled(relations.size()==1); 55 55 } 56 56 } -
trunk/src/org/openstreetmap/josm/actions/upload/ApiPreconditionCheckerHook.java
r7529 r8444 34 34 long maxNodes = api.getCapabilities().getMaxWayNodes(); 35 35 if (maxNodes > 0) { 36 if (!checkMaxNodes(apiData.getPrimitivesToAdd(), maxNodes))36 if (!checkMaxNodes(apiData.getPrimitivesToAdd(), maxNodes)) 37 37 return false; 38 if (!checkMaxNodes(apiData.getPrimitivesToUpdate(), maxNodes))38 if (!checkMaxNodes(apiData.getPrimitivesToUpdate(), maxNodes)) 39 39 return false; 40 if (!checkMaxNodes(apiData.getPrimitivesToDelete(), maxNodes))40 if (!checkMaxNodes(apiData.getPrimitivesToDelete(), maxNodes)) 41 41 return false; 42 42 } -
trunk/src/org/openstreetmap/josm/actions/upload/CyclicUploadDependencyException.java
r8390 r8444 35 35 .append('['); 36 36 for (int i=0; i< cycle.size(); i++) { 37 if (i > 0) {37 if (i > 0) { 38 38 sb.append(','); 39 39 } -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java
r6887 r8444 61 61 @Override 62 62 public void undoCommand() { 63 if (! 63 if (!Main.map.mapView.hasLayer(getLayer())) { 64 64 Main.warn(tr("Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.", 65 65 getLayer().getName(), -
trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java
r6887 r8444 45 45 */ 46 46 protected void rememberConflict(Conflict<?> c) { 47 if (! 47 if (!resolvedConflicts.hasConflictForMy(c.getMy())) { 48 48 resolvedConflicts.add(c); 49 49 } … … 68 68 super.undoCommand(); 69 69 70 if (! 70 if (!Main.map.mapView.hasLayer(getLayer())) { 71 71 Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more", 72 72 this.toString(), -
trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java
r6887 r8444 74 74 public void undoCommand() { 75 75 OsmDataLayer layer = getLayer(); 76 if (! 76 if (!Main.map.mapView.hasLayer(layer)) { 77 77 Main.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more", 78 78 this.toString(), -
trunk/src/org/openstreetmap/josm/command/conflict/TagConflictResolveCommand.java
r6887 r8444 84 84 // 85 85 for (TagMergeItem item: mergeItems) { 86 if (! 86 if (!item.getMergeDecision().equals(MergeDecisionType.UNDECIDED)) { 87 87 item.applyToMyPrimitive(conflict.getMy()); 88 88 } -
trunk/src/org/openstreetmap/josm/command/conflict/WayNodesConflictResolverCommand.java
r6887 r8444 58 58 // 59 59 for (Node n:mergedNodeList) { 60 if (! 60 if (!getLayer().data.getNodes().contains(n)) { 61 61 Main.warn(tr("Main dataset does not include node {0}", n.toString())); 62 62 } -
trunk/src/org/openstreetmap/josm/data/coor/LatLon.java
r8308 r8444 69 69 70 70 private static final String cDms60 = cDmsSecondFormatter.format(60.0); 71 private static final String cDms00 = cDmsSecondFormatter.format( 71 private static final String cDms00 = cDmsSecondFormatter.format(0.0); 72 72 private static final String cDm60 = cDmMinuteFormatter.format(60.0); 73 private static final String cDm00 = cDmMinuteFormatter.format( 73 private static final String cDm00 = cDmMinuteFormatter.format(0.0); 74 74 75 75 /** -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
r8418 r8444 150 150 for (ImageryInfo def : defaultLayers) { 151 151 // temporary migration code, so all user preferences will get updated with new settings from JOSM site (can be removed ~Dez. 2015) 152 if (def.getNoTileHeaders() != null || def.getTileSize() > 0 || def.getMetadataHeaders() != null 152 if (def.getNoTileHeaders() != null || def.getTileSize() > 0 || def.getMetadataHeaders() != null) { 153 153 for (ImageryInfo i: layers) { 154 154 if (isSimilar(def, i)) { -
trunk/src/org/openstreetmap/josm/data/osm/ChangesetCache.java
r8338 r8444 134 134 DefaultChangesetCacheEvent e = new DefaultChangesetCacheEvent(this); 135 135 remove(id, e); 136 if (! 136 if (!e.isEmpty()) { 137 137 fireChangesetCacheEvent(e); 138 138 } … … 160 160 remove(cs.getId(), evt); 161 161 } 162 if (! 162 if (!evt.isEmpty()) { 163 163 fireChangesetCacheEvent(evt); 164 164 } -
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r8338 r8444 79 79 */ 80 80 protected void mergePrimitive(OsmPrimitive source, Collection<? extends OsmPrimitive> candidates) { 81 if (!source.isNew() 81 if (!source.isNew()) { 82 82 // try to merge onto a matching primitive with the same defined id 83 83 // … … 319 319 throw new DataIntegrityProblemException(tr("Conflict in ''visible'' attribute for object of type {0} with id {1}", 320 320 target.getType(), target.getId())); 321 else if (target.isDeleted() && ! 321 else if (target.isDeleted() && !source.isDeleted() && target.getVersion() == source.getVersion()) { 322 322 // same version, but target is deleted. Assume target takes precedence 323 323 // otherwise too many conflicts when refreshing from the server … … 331 331 } 332 332 } 333 } else if (! 333 } else if (!target.isModified() && source.isDeleted()) { 334 334 // target not modified. We can assume that source is the most recent version, 335 335 // so mark it to be deleted. 336 336 // 337 337 objectsToDelete.add(target); 338 } else if (! 338 } else if (!target.isModified() && source.isModified()) { 339 339 // target not modified. We can assume that source is the most recent version. 340 340 // clone it into target. 341 341 target.mergeFrom(source); 342 342 objectsWithChildrenToMerge.add(source.getPrimitiveId()); 343 } else if (! 343 } else if (!target.isModified() && !source.isModified() && target.getVersion() == source.getVersion()) { 344 344 // both not modified. Merge nevertheless. 345 345 // This helps when updating "empty" relations, see #4295 346 346 target.mergeFrom(source); 347 347 objectsWithChildrenToMerge.add(source.getPrimitiveId()); 348 } else if (! 348 } else if (!target.isModified() && !source.isModified() && target.getVersion() < source.getVersion()) { 349 349 // my not modified but other is newer. clone other onto mine. 350 350 // 351 351 target.mergeFrom(source); 352 352 objectsWithChildrenToMerge.add(source.getPrimitiveId()); 353 } else if (target.isModified() && ! 353 } else if (target.isModified() && !source.isModified() && target.getVersion() == source.getVersion()) { 354 354 // target is same as source but target is modified 355 355 // => keep target and reset modified flag if target and source are semantically equal … … 362 362 // 363 363 addConflict(target,source); 364 } else if (! 364 } else if (!target.hasEqualSemanticAttributes(source)) { 365 365 // target is modified and is not semantically equal with source. Can't automatically 366 366 // resolve the differences -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r8365 r8444 281 281 if (!(other instanceof Node)) 282 282 return false; 283 if (! 283 if (!super.hasEqualSemanticAttributes(other)) 284 284 return false; 285 285 Node n = (Node)other; -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r8419 r8444 966 966 } else if (referrers instanceof OsmPrimitive) { 967 967 if (referrers != referrer) { 968 referrers = new OsmPrimitive[] { (OsmPrimitive)referrers, referrer};968 referrers = new OsmPrimitive[] {(OsmPrimitive)referrers, referrer}; 969 969 } 970 970 } else { … … 1144 1144 if (other.isNew() ^ isNew()) 1145 1145 throw new DataIntegrityProblemException(tr("Cannot merge because either of the participating primitives is new and the other is not")); 1146 if (! 1146 if (!other.isNew() && other.getId() != id) 1147 1147 throw new DataIntegrityProblemException(tr("Cannot merge primitives with different ids. This id is {0}, the other is {1}", id, other.getId())); 1148 1148 -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r8390 r8444 292 292 if (!(other instanceof Relation)) 293 293 return false; 294 if (! 294 if (!super.hasEqualSemanticAttributes(other)) 295 295 return false; 296 296 Relation r = (Relation)other; -
trunk/src/org/openstreetmap/josm/data/osm/TagCollection.java
r8415 r8444 341 341 continue; 342 342 } 343 if (! 343 if (!containsKey(key)) return false; 344 344 } 345 345 return true; … … 399 399 if (key == null) return false; 400 400 Set<String> values = getTagsFor(key).getValues(); 401 return values.size() == 1 && ! 401 return values.size() == 1 && !values.contains(""); 402 402 } 403 403 … … 607 607 public void applyTo(Tagged primitive) { 608 608 if (primitive == null) return; 609 if (! 609 if (!isApplicableToPrimitive()) 610 610 throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values.")); 611 611 for (Tag tag: tags) { … … 628 628 public void applyTo(Collection<? extends Tagged> primitives) { 629 629 if (primitives == null) return; 630 if (! 630 if (!isApplicableToPrimitive()) 631 631 throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values.")); 632 632 for (Tagged primitive: primitives) { … … 645 645 public void replaceTagsOf(Tagged primitive) { 646 646 if (primitive == null) return; 647 if (! 647 if (!isApplicableToPrimitive()) 648 648 throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values.")); 649 649 primitive.removeAll(); … … 663 663 public void replaceTagsOf(Collection<? extends Tagged> primitives) { 664 664 if (primitives == null) return; 665 if (! 665 if (!isApplicableToPrimitive()) 666 666 throw new IllegalStateException(tr("Tag collection cannot be applied to a primitive because there are keys with multiple values.")); 667 667 for (Tagged primitive: primitives) { -
trunk/src/org/openstreetmap/josm/data/osm/User.java
r8395 r8444 213 213 @Override 214 214 public boolean equals(Object obj) { 215 if (! 215 if (!(obj instanceof User)) 216 216 return false; 217 217 User other = (User) obj; -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r8419 r8444 336 336 if (!(other instanceof Way)) 337 337 return false; 338 if (! 338 if (!super.hasEqualSemanticAttributes(other)) 339 339 return false; 340 340 Way w = (Way)other; 341 341 if (getNodesCount() != w.getNodesCount()) return false; 342 for (int i=0; i<getNodesCount();i++) {343 if (! 342 for (int i=0; i<getNodesCount(); i++) { 343 if (!getNode(i).hasEqualSemanticAttributes(w.getNode(i))) 344 344 return false; 345 345 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/LineClip.java
r8419 r8444 60 60 * @return true, if line is visible in the given clip region 61 61 */ 62 private boolean cohenSutherland( 62 private boolean cohenSutherland(long x1, long y1, long x2, long y2, long xmin, long ymin, long xmax, long ymax) { 63 63 int outcode0, outcode1, outcodeOut; 64 64 boolean accept = false; … … 69 69 70 70 do { 71 if ((outcode0 | outcode1) == 0 71 if ((outcode0 | outcode1) == 0) { 72 72 accept = true; 73 73 done = true; 74 } else if ( (outcode0 & outcode1) > 0) {74 } else if ((outcode0 & outcode1) > 0) { 75 75 done = true; 76 76 } else { 77 77 long x = 0, y = 0; 78 78 outcodeOut = outcode0 != 0 ? outcode0: outcode1; 79 if ( (outcodeOut & OUT_TOP) > 0) {79 if ((outcodeOut & OUT_TOP) > 0) { 80 80 x = x1 + (x2 - x1) * (ymax - y1)/(y2 - y1); 81 81 y = ymax; 82 } else if ((outcodeOut & OUT_BOTTOM) > 0 82 } else if ((outcodeOut & OUT_BOTTOM) > 0) { 83 83 x = x1 + (x2 - x1) * (ymin - y1)/(y2 - y1); 84 84 y = ymin; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
r8415 r8444 127 127 Main.error(tr("Activating the standard map renderer instead.")); 128 128 activateDefault(); 129 } else if (! 129 } else if (!AbstractMapRenderer.class.isAssignableFrom(c)) { 130 130 Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t a subclass of ''{1}''.", rendererClassName, AbstractMapRenderer.class.getName())); 131 131 Main.error(tr("Activating the standard map renderer instead.")); … … 133 133 } else { 134 134 Class<? extends AbstractMapRenderer> renderer = c.asSubclass(AbstractMapRenderer.class); 135 if (! 135 if (!isRegistered(renderer)) { 136 136 Main.error(tr("Can''t activate map renderer class ''{0}'', because it isn''t registered as map renderer.", rendererClassName)); 137 137 Main.error(tr("Activating the standard map renderer instead.")); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r8419 r8444 591 591 x -= textWidth / 2; 592 592 } else if (bs.hAlign == HorizontalTextAlignment.LEFT) { 593 x -= - 593 x -= -box.x + 4 + textWidth; 594 594 } else throw new AssertionError(); 595 595 } … … 643 643 break; 644 644 case CENTER: 645 dy1 = - 645 dy1 = -imgHeight / 2; 646 646 dy2 = imgHeight + dy1; 647 647 break; … … 1341 1341 1342 1342 // scale such that border is 1 px 1343 final double fac = - 1343 final double fac = -(onewayReversed ? -1 : 1) * onewaySize * (1 + sinPHI) / (sinPHI * cosPHI); 1344 1344 final double sx = nx * fac; 1345 1345 final double sy = ny * fac; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r8419 r8444 433 433 434 434 path.lineTo(p2.x + (int) Math.round(cosPHI * sx - sinPHI * sy), p2.y + (int) Math.round(sinPHI * sx + cosPHI * sy)); 435 path.moveTo(p2.x + (int) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (int) Math.round(- 435 path.moveTo(p2.x + (int) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (int) Math.round(-sinPHI * sx + cosPHI * sy)); 436 436 path.lineTo(p2.x, p2.y); 437 437 } -
trunk/src/org/openstreetmap/josm/data/projection/datum/SevenParameterDatum.java
r6069 r8444 50 50 double y = dy + xyz[1]*(1+s) + xyz[0]*rz - xyz[2]*rx; 51 51 double z = dz + xyz[2]*(1+s) + xyz[1]*rx - xyz[0]*ry; 52 return Ellipsoid.WGS84.cart2LatLon(new double[] { x, y, z});52 return Ellipsoid.WGS84.cart2LatLon(new double[] {x, y, z}); 53 53 } 54 54 … … 59 59 double y = (1-s)*(-dy + xyz[1] + ((-dx+xyz[0])*(-rz) - (-dz+xyz[2])*(-rx))); 60 60 double z = (1-s)*(-dz + xyz[2] + ((-dy+xyz[1])*(-rx) - (-dx+xyz[0])*(-ry))); 61 return this.ellps.cart2LatLon(new double[] { x, y, z});61 return this.ellps.cart2LatLon(new double[] {x, y, z}); 62 62 } 63 64 63 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java
r8346 r8444 153 153 public double[] project(double phi, double lambda) { 154 154 double sinphi = sin(phi); 155 double L= (0.5*log((1+sinphi)/(1-sinphi))) - e/2*log((1+e*sinphi)/(1-e*sinphi));156 double r = f*exp(-n* L);155 double l = (0.5*log((1+sinphi)/(1-sinphi))) - e/2*log((1+e*sinphi)/(1-e*sinphi)); 156 double r = f*exp(-n*l); 157 157 double gamma = n*lambda; 158 double X= r*sin(gamma);159 double Y= r0 - r*cos(gamma);160 return new double[] { X, Y};158 double x = r*sin(gamma); 159 double y = r0 - r*cos(gamma); 160 return new double[] {x, y}; 161 161 } 162 162 … … 168 168 double latIso = (-1/n) * log(abs(r/f)); 169 169 double phi = ellps.latitude(latIso, e, epsilon); 170 return new double[] { phi, lambda};170 return new double[] {phi, lambda}; 171 171 } 172 172 -
trunk/src/org/openstreetmap/josm/data/projection/proj/LonLat.java
r7937 r8444 30 30 @Override 31 31 public double[] project(double lat_rad, double lon_rad) { 32 return new double[] { Math.toDegrees(lon_rad) / a, Math.toDegrees(lat_rad) / a};32 return new double[] {Math.toDegrees(lon_rad) / a, Math.toDegrees(lat_rad) / a}; 33 33 } 34 34 35 35 @Override 36 36 public double[] invproject(double east, double north) { 37 return new double[] { Math.toRadians(north * a), Math.toRadians(east * a)};37 return new double[] {Math.toRadians(north * a), Math.toRadians(east * a)}; 38 38 } 39 39 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/Mercator.java
r6362 r8444 32 32 @Override 33 33 public double[] project(double lat_rad, double lon_rad) { 34 return new double[] { lon_rad, log(tan(PI/4 + lat_rad/2))};34 return new double[] {lon_rad, log(tan(PI/4 + lat_rad/2))}; 35 35 } 36 36 37 37 @Override 38 38 public double[] invproject(double east, double north) { 39 return new double[] { atan(sinh(north)), east};39 return new double[] {atan(sinh(north)), east}; 40 40 } 41 42 41 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java
r8378 r8444 81 81 double x = kR / 2 * log((1 + sin(bb)) / (1 - sin(bb))); 82 82 83 return new double[] { y, x};83 return new double[] {y, x}; 84 84 } 85 85 … … 107 107 phi = 2 * atan(exp(s)) - PI / 2; 108 108 } 109 return new double[] { phi, lambda};109 return new double[] {phi, lambda}; 110 110 } 111 111 } -
trunk/src/org/openstreetmap/josm/data/validation/PaintVisitor.java
r8380 r8444 162 162 int deg = (int) Math.toDegrees(t); 163 163 if (selected) { 164 int[] x = new int[] { 165 (int) (p2.x - cosT), (int) (p1.x - cosT)};166 int[] y = new int[] { 167 (int) (p2.y + sinT), (int) (p1.y + sinT)};164 int[] x = new int[] {(int) (p1.x + cosT), (int) (p2.x + cosT), 165 (int) (p2.x - cosT), (int) (p1.x - cosT)}; 166 int[] y = new int[] {(int) (p1.y - sinT), (int) (p2.y - sinT), 167 (int) (p2.y + sinT), (int) (p1.y + sinT)}; 168 168 g.fillPolygon(x, y, 4); 169 169 g.fillArc(p1.x - 5, p1.y - 5, 10, 10, deg, 180); -
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateRelation.java
r8378 r8444 195 195 if (duplicated.size() > 1) { 196 196 TestError testError = new TestError(this, Severity.ERROR, tr("Duplicated relations"), DUPLICATE_RELATION, duplicated); 197 errors.add( testError);197 errors.add(testError); 198 198 } 199 199 } … … 202 202 if (duplicated.size() > 1) { 203 203 TestError testError = new TestError(this, Severity.WARNING, tr("Relations with same members"), SAME_RELATION, duplicated); 204 errors.add( testError);204 errors.add(testError); 205 205 } 206 206 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
r8382 r8444 69 69 private boolean parentMultipolygonConcernsArea(OsmPrimitive p) { 70 70 for (Relation r : OsmPrimitive.getFilteredList(p.getReferrers(), Relation.class)) { 71 if (r.concernsArea() 71 if (r.concernsArea()) { 72 72 return true; 73 73 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/TagChecker.java
r8438 r8444 248 248 249 249 if (errorSources.length() > 0) 250 throw new IOException( tr("Could not access data file(s):\n{0}", errorSources));250 throw new IOException(tr("Could not access data file(s):\n{0}", errorSources)); 251 251 } 252 252 -
trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedWay.java
r8378 r8444 44 44 public static final Set<String> NAMED_WAYS = new HashSet<>(); 45 45 static { 46 NAMED_WAYS.add( "motorway");47 NAMED_WAYS.add( "trunk");48 NAMED_WAYS.add( "primary");49 NAMED_WAYS.add( "secondary");50 NAMED_WAYS.add( "tertiary");51 NAMED_WAYS.add( "residential");52 NAMED_WAYS.add( "pedestrian");46 NAMED_WAYS.add("motorway"); 47 NAMED_WAYS.add("trunk"); 48 NAMED_WAYS.add("primary"); 49 NAMED_WAYS.add("secondary"); 50 NAMED_WAYS.add("tertiary"); 51 NAMED_WAYS.add("residential"); 52 NAMED_WAYS.add("pedestrian"); 53 53 } 54 54 … … 56 56 public static final Set<String> WHITELIST = new HashSet<>(); 57 57 static { 58 WHITELIST.add( "outer");59 WHITELIST.add( "inner");60 WHITELIST.add( "perimeter");61 WHITELIST.add( "edge");62 WHITELIST.add( "outline");58 WHITELIST.add("outer"); 59 WHITELIST.add("inner"); 60 WHITELIST.add("perimeter"); 61 WHITELIST.add("edge"); 62 WHITELIST.add("outline"); 63 63 } 64 64 -
trunk/src/org/openstreetmap/josm/data/validation/util/ValUtil.java
r8378 r8444 64 64 if (!cellNodes.contains(cell)) { 65 65 cellNodes.add(cell); 66 ways = cellWays.get( cell);66 ways = cellWays.get(cell); 67 67 if (ways == null) { 68 68 ways = new ArrayList<>(); … … 157 157 long maxSteps = (gridX1 - gridX0) + Math.abs(gridY1 - gridY0) + 1; 158 158 while ((gridX0 <= gridX1 && (gridY0 - gridY1)*stepY <= 0) && maxSteps-- > 0) { 159 cells.add( 159 cells.add(new Point2D.Double(gridX0, gridY0)); 160 160 161 161 // Is the cross between the segment and next vertical line nearer than the cross with next horizontal line? -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapControler.java
r8285 r8444 65 65 iSlippyMapChooser.addMouseMotionListener(this); 66 66 67 String[] n = { ",", ".", "up", "right", "down", "left" }; 68 int[] k = { KeyEvent.VK_COMMA, KeyEvent.VK_PERIOD, KeyEvent.VK_UP, KeyEvent.VK_RIGHT, KeyEvent.VK_DOWN, 69 KeyEvent.VK_LEFT }; 67 String[] n = {",", ".", "up", "right", "down", "left"}; 68 int[] k = {KeyEvent.VK_COMMA, KeyEvent.VK_PERIOD, KeyEvent.VK_UP, KeyEvent.VK_RIGHT, KeyEvent.VK_DOWN, KeyEvent.VK_LEFT}; 70 69 71 70 if (contentPane != null) { -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java
r8308 r8444 87 87 */ 88 88 protected final void loadIcons() { 89 mergeComplete = ImageProvider.get("dialogs", "valid" 90 mergeIncomplete = ImageProvider.get("dialogs/conflict", "mergeincomplete" 89 mergeComplete = ImageProvider.get("dialogs", "valid"); 90 mergeIncomplete = ImageProvider.get("dialogs/conflict", "mergeincomplete"); 91 91 } 92 92 -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMergeModel.java
r8399 r8444 274 274 } 275 275 276 protected void copyToTop(ListRole role, int []rows) {276 protected void copyToTop(ListRole role, int[] rows) { 277 277 copy(role, rows, 0); 278 278 mergedEntriesSelectionModel.setSelectionInterval(0, rows.length -1); … … 286 286 * @param rows the indices 287 287 */ 288 public void copyMyToTop(int 288 public void copyMyToTop(int[] rows) { 289 289 copyToTop(MY_ENTRIES, rows); 290 290 } … … 297 297 * @param rows the indices 298 298 */ 299 public void copyTheirToTop(int 299 public void copyTheirToTop(int[] rows) { 300 300 copyToTop(THEIR_ENTRIES, rows); 301 301 } … … 310 310 */ 311 311 312 public void copyToEnd(ListRole source, int 312 public void copyToEnd(ListRole source, int[] rows) { 313 313 copy(source, rows, getMergedEntriesSize()); 314 314 mergedEntriesSelectionModel.setSelectionInterval(getMergedEntriesSize()-rows.length, getMergedEntriesSize() -1); … … 323 323 * @param rows the indices 324 324 */ 325 public void copyMyToEnd(int 325 public void copyMyToEnd(int[] rows) { 326 326 copyToEnd(MY_ENTRIES, rows); 327 327 } … … 334 334 * @param rows the indices 335 335 */ 336 public void copyTheirToEnd(int 336 public void copyTheirToEnd(int[] rows) { 337 337 copyToEnd(THEIR_ENTRIES, rows); 338 338 } … … 417 417 * @throws IllegalArgumentException if current < 0 or >= #nodes in list of merged nodes 418 418 */ 419 protected void copyBeforeCurrent(ListRole source, int 419 protected void copyBeforeCurrent(ListRole source, int[] rows, int current) { 420 420 copy(source, rows, current); 421 421 mergedEntriesSelectionModel.setSelectionInterval(current, current + rows.length-1); … … 430 430 * @throws IllegalArgumentException if current < 0 or >= #nodes in list of merged nodes 431 431 */ 432 public void copyMyBeforeCurrent(int 433 copyBeforeCurrent(MY_ENTRIES, rows,current);432 public void copyMyBeforeCurrent(int[] rows, int current) { 433 copyBeforeCurrent(MY_ENTRIES, rows, current); 434 434 } 435 435 … … 442 442 * @throws IllegalArgumentException if current < 0 or >= #nodes in list of merged nodes 443 443 */ 444 public void copyTheirBeforeCurrent(int 445 copyBeforeCurrent(THEIR_ENTRIES, rows,current);444 public void copyTheirBeforeCurrent(int[] rows, int current) { 445 copyBeforeCurrent(THEIR_ENTRIES, rows, current); 446 446 } 447 447 … … 455 455 * @throws IllegalArgumentException if current < 0 or >= #nodes in list of merged nodes 456 456 */ 457 protected void copyAfterCurrent(ListRole source, int 457 protected void copyAfterCurrent(ListRole source, int[] rows, int current) { 458 458 copy(source, rows, current + 1); 459 459 mergedEntriesSelectionModel.setSelectionInterval(current+1, current + rows.length-1); … … 469 469 * @throws IllegalArgumentException if current < 0 or >= #nodes in list of merged nodes 470 470 */ 471 public void copyMyAfterCurrent(int 471 public void copyMyAfterCurrent(int[] rows, int current) { 472 472 copyAfterCurrent(MY_ENTRIES, rows, current); 473 473 } … … 481 481 * @throws IllegalArgumentException if current < 0 or >= #nodes in list of merged nodes 482 482 */ 483 public void copyTheirAfterCurrent(int 483 public void copyTheirAfterCurrent(int[] rows, int current) { 484 484 copyAfterCurrent(THEIR_ENTRIES, rows, current); 485 485 } … … 492 492 * 493 493 */ 494 public void moveUpMerged(int 494 public void moveUpMerged(int[] rows) { 495 495 if (rows == null || rows.length == 0) 496 496 return; … … 518 518 * @param rows the indices 519 519 */ 520 public void moveDownMerged(int 520 public void moveDownMerged(int[] rows) { 521 521 if (rows == null || rows.length == 0) 522 522 return; … … 545 545 * @param rows the indices 546 546 */ 547 public void removeMerged(int 547 public void removeMerged(int[] rows) { 548 548 if (rows == null || rows.length == 0) 549 549 return; … … 570 570 return false; 571 571 for (int i=0; i < getMyEntriesSize(); i++) { 572 if (! 572 if (!isEqualEntry(getMyEntries().get(i), getTheirEntries().get(i))) 573 573 return false; 574 574 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java
r8426 r8444 483 483 @Override 484 484 public void actionPerformed(ActionEvent e) { 485 int 485 int[] mergedRows = mergedEntriesTable.getSelectedRows(); 486 486 if (mergedRows == null || mergedRows.length == 0) 487 487 return; 488 int 488 int[] myRows = myEntriesTable.getSelectedRows(); 489 489 int current = mergedRows[0]; 490 490 model.copyMyBeforeCurrent(myRows, current); … … 513 513 @Override 514 514 public void actionPerformed(ActionEvent e) { 515 int 515 int[] mergedRows = mergedEntriesTable.getSelectedRows(); 516 516 if (mergedRows == null || mergedRows.length == 0) 517 517 return; 518 int 518 int[] myRows = myEntriesTable.getSelectedRows(); 519 519 int current = mergedRows[0]; 520 520 model.copyMyAfterCurrent(myRows, current); … … 575 575 @Override 576 576 public void actionPerformed(ActionEvent e) { 577 int 577 int[] mergedRows = mergedEntriesTable.getSelectedRows(); 578 578 if (mergedRows == null || mergedRows.length == 0) 579 579 return; 580 int 580 int[] myRows = theirEntriesTable.getSelectedRows(); 581 581 int current = mergedRows[0]; 582 582 model.copyTheirBeforeCurrent(myRows, current); … … 601 601 @Override 602 602 public void actionPerformed(ActionEvent e) { 603 int 603 int[] mergedRows = mergedEntriesTable.getSelectedRows(); 604 604 if (mergedRows == null || mergedRows.length == 0) 605 605 return; 606 int 606 int[] myRows = theirEntriesTable.getSelectedRows(); 607 607 int current = mergedRows[0]; 608 608 model.copyTheirAfterCurrent(myRows, current); … … 690 690 @Override 691 691 public void actionPerformed(ActionEvent arg0) { 692 int 692 int[] rows = mergedEntriesTable.getSelectedRows(); 693 693 model.moveUpMerged(rows); 694 694 } … … 696 696 @Override 697 697 public void valueChanged(ListSelectionEvent e) { 698 int 698 int[] rows = mergedEntriesTable.getSelectedRows(); 699 699 setEnabled( 700 700 rows != null … … 724 724 @Override 725 725 public void actionPerformed(ActionEvent arg0) { 726 int 726 int[] rows = mergedEntriesTable.getSelectedRows(); 727 727 model.moveDownMerged(rows); 728 728 } … … 730 730 @Override 731 731 public void valueChanged(ListSelectionEvent e) { 732 int 732 int[] rows = mergedEntriesTable.getSelectedRows(); 733 733 setEnabled( 734 734 rows != null … … 758 758 @Override 759 759 public void actionPerformed(ActionEvent arg0) { 760 int 760 int[] rows = mergedEntriesTable.getSelectedRows(); 761 761 model.removeMerged(rows); 762 762 } … … 764 764 @Override 765 765 public void valueChanged(ListSelectionEvent e) { 766 int 766 int[] rows = mergedEntriesTable.getSelectedRows(); 767 767 setEnabled( 768 768 rows != null -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMergeModel.java
r8291 r8444 57 57 */ 58 58 public WayNodesConflictResolverCommand buildResolveCommand(Conflict<? extends OsmPrimitive> conflict) { 59 if (! 59 if (!isFrozen()) 60 60 throw new IllegalArgumentException(tr("Merged nodes not frozen yet. Cannot build resolution command.")); 61 61 return new WayNodesConflictResolverCommand(conflict, getMergedEntries()); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListTableCellRenderer.java
r8308 r8444 88 88 * @param isSelected true, if the current row is selected 89 89 */ 90 protected void renderRowId( 90 protected void renderRowId(ListMergeModel<Node>.EntriesTableModel model, int row, boolean isSelected) { 91 91 setIcon(null); 92 92 setBorder(rowNumberBorder); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMergeModel.java
r8308 r8444 70 70 } 71 71 72 /** 73 * Constructs a new {@code PropertiesMergeModel}. 74 */ 72 75 public PropertiesMergeModel() { 73 76 coordMergeDecision = UNDECIDED; … … 78 81 79 82 /** 80 * replies true if there is a coordinate conflict and if this conflict is 81 * resolved 82 * 83 * @return true if there is a coordinate conflict and if this conflict is 84 * resolved; false, otherwise 83 * replies true if there is a coordinate conflict and if this conflict is resolved 84 * 85 * @return true if there is a coordinate conflict and if this conflict is resolved; false, otherwise 85 86 */ 86 87 public boolean isDecidedCoord() { 87 return ! coordMergeDecision.equals(UNDECIDED); 88 } 89 90 /** 91 * replies true if there is a conflict in the deleted state and if this conflict is 92 * resolved 88 return !coordMergeDecision.equals(UNDECIDED); 89 } 90 91 /** 92 * replies true if there is a conflict in the deleted state and if this conflict is resolved 93 93 * 94 94 * @return true if there is a conflict in the deleted state and if this conflict is … … 96 96 */ 97 97 public boolean isDecidedDeletedState() { 98 return ! 98 return !deletedMergeDecision.equals(UNDECIDED); 99 99 } 100 100 … … 311 311 boolean ret = true; 312 312 if (hasCoordConflict()) { 313 ret = ret && ! 313 ret = ret && !coordMergeDecision.equals(UNDECIDED); 314 314 } 315 315 if (hasDeletedStateConflict()) { 316 ret = ret && ! 316 ret = ret && !deletedMergeDecision.equals(UNDECIDED); 317 317 } 318 318 return ret; -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java
r8426 r8444 321 321 lblMergedCoordinates.setText(coordToString(model.getMergedCoords())); 322 322 lblTheirCoordinates.setText(coordToString(model.getTheirCoords())); 323 if (! 323 if (!model.hasCoordConflict()) { 324 324 lblMyCoordinates.setBackground(ConflictColors.BGCOLOR_NO_CONFLICT.get()); 325 325 lblMergedCoordinates.setBackground(ConflictColors.BGCOLOR_NO_CONFLICT.get()); … … 349 349 lblTheirDeletedState.setText(deletedStateToString(model.getTheirDeletedState())); 350 350 351 if (! 351 if (!model.hasDeletedStateConflict()) { 352 352 lblMyDeletedState.setBackground(ConflictColors.BGCOLOR_NO_CONFLICT.get()); 353 353 lblMergedDeletedState.setBackground(ConflictColors.BGCOLOR_NO_CONFLICT.get()); … … 403 403 @Override 404 404 public void update(Observable o, Object arg) { 405 setEnabled(model.hasCoordConflict() && ! 405 setEnabled(model.hasCoordConflict() && !model.isDecidedCoord()); 406 406 } 407 407 } … … 420 420 @Override 421 421 public void update(Observable o, Object arg) { 422 setEnabled(model.hasCoordConflict() && ! 422 setEnabled(model.hasCoordConflict() && !model.isDecidedCoord()); 423 423 } 424 424 } … … 454 454 @Override 455 455 public void update(Observable o, Object arg) { 456 setEnabled(model.hasDeletedStateConflict() && ! 456 setEnabled(model.hasDeletedStateConflict() && !model.isDecidedDeletedState()); 457 457 } 458 458 } … … 471 471 @Override 472 472 public void update(Observable o, Object arg) { 473 setEnabled(model.hasDeletedStateConflict() && ! 473 setEnabled(model.hasDeletedStateConflict() && !model.isDecidedDeletedState()); 474 474 } 475 475 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberListMergeModel.java
r8291 r8444 109 109 CheckParameterUtil.ensureParameterNotNull(my, "my"); 110 110 CheckParameterUtil.ensureParameterNotNull(their, "their"); 111 if (! 111 if (!isFrozen()) 112 112 throw new IllegalArgumentException(tr("Merged nodes not frozen yet. Cannot build resolution command")); 113 113 List<RelationMember> entries = getMergedEntries(); -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberTableCellRenderer.java
r8308 r8444 79 79 protected void renderForeground(ListMergeModel<Node>.EntriesTableModel model, RelationMember member, int row, int col, boolean isSelected) { 80 80 Color fgc = ConflictColors.FGCOLOR.get(); 81 if (col == 0 && model.isParticipatingInCurrentComparePair() && ! 81 if (col == 0 && model.isParticipatingInCurrentComparePair() && !model.getListMergeModel().isFrozen()) { 82 82 fgc = ConflictColors.FGCOLOR_PARTICIPATING_IN_COMPARISON.get(); 83 83 } -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeModel.java
r8390 r8444 113 113 String myValue = my.get(key); 114 114 String theirValue = their.get(key); 115 if (myValue == null || theirValue == null || ! 115 if (myValue == null || theirValue == null || !myValue.equals(theirValue)) { 116 116 tagMergeItems.add( 117 117 new TagMergeItem(key, my, their) … … 161 161 * @param decision the decision 162 162 */ 163 public void decide(int 163 public void decide(int[] rows, MergeDecisionType decision) { 164 164 if (rows == null || rows.length == 0) 165 165 return; -
trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMergeTableCellRenderer.java
r6084 r8444 13 13 public abstract class TagMergeTableCellRenderer extends JLabel implements TableCellRenderer { 14 14 15 protected abstract void renderKey(TagMergeItem item, boolean isSelected);15 protected abstract void renderKey(TagMergeItem item, boolean isSelected); 16 16 17 17 protected abstract void renderValue(TagMergeItem item, boolean isSelected); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/MultiValueCellEditor.java
r7743 r8444 99 99 fireGotoNextDecision(); 100 100 } 101 } else if ( e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_DELETE|| e.getKeyCode() == KeyEvent.VK_BACK_SPACE) {101 } else if (e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_DELETE || e.getKeyCode() == KeyEvent.VK_BACK_SPACE) { 102 102 if (editorModel.getIndexOf(MultiValueDecisionType.KEEP_NONE) > 0) { 103 103 editorModel.setSelectedItem(MultiValueDecisionType.KEEP_NONE); -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictDecision.java
r8291 r8444 62 62 63 63 public boolean isDecided() { 64 return ! 64 return !UNDECIDED.equals(decision); 65 65 } 66 66 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/RelationMemberConflictResolverModel.java
r8308 r8444 246 246 final RelationMember newMember = new RelationMember(decision.getRole(),newPrimitive); 247 247 modifiedRelation.addMember(newMember); 248 isChanged |= ! 248 isChanged |= !member.equals(newMember); 249 249 break; 250 250 case REMOVE: -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
r8399 r8444 71 71 @Override 72 72 public int compare(String key1, String key2) { 73 if (decisions.get(key1).isDecided() && ! 73 if (decisions.get(key1).isDecided() && !decisions.get(key2).isDecided()) 74 74 return 1; 75 75 else if (!decisions.get(key1).isDecided() && decisions.get(key2).isDecided()) -
trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java
r8254 r8444 431 431 if (sel.isEmpty()) 432 432 return; 433 if (sel.size() > 10 && ! 433 if (sel.size() > 10 && !AbstractInfoAction.confirmLaunchMultiple(sel.size())) 434 434 return; 435 435 String baseUrl = Main.getBaseBrowseUrl(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
r7586 r8444 203 203 @Override 204 204 public void actionPerformed(ActionEvent arg0) { 205 if (! 205 if (!resolver.isResolvedCompletely()) { 206 206 Object[] options = { 207 207 tr("Close anyway"), -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterTableModel.java
r8308 r8444 252 252 @Override 253 253 public String getColumnName(int column) { 254 String[] names = { 254 String[] names = {/* translators notes must be in front */ 255 255 /* column header: enable filter */trc("filter", "E"), 256 256 /* column header: hide filter */trc("filter", "H"), 257 257 /* column header: filter text */trc("filter", "Text"), 258 258 /* column header: inverted filter */trc("filter", "I"), 259 /* column header: filter mode */trc("filter", "M") 259 /* column header: filter mode */trc("filter", "M")}; 260 260 return names[column]; 261 261 } … … 263 263 @Override 264 264 public Class<?> getColumnClass(int column) { 265 Class<?>[] classes = { Boolean.class, Boolean.class, String.class, Boolean.class, String.class};265 Class<?>[] classes = {Boolean.class, Boolean.class, String.class, Boolean.class, String.class}; 266 266 return classes[column]; 267 267 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/LatLonDialog.java
r8404 r8444 165 165 166 166 public LatLonDialog(Component parent, String title, String help) { 167 super(parent, title, new String[] { tr("Ok"), tr("Cancel")});168 setButtonIcons(new String[] { "ok", "cancel"});167 super(parent, title, new String[] {tr("Ok"), tr("Cancel")}); 168 setButtonIcons(new String[] {"ok", "cancel"}); 169 169 configureContextsensitiveHelp(help, true); 170 170 -
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r8395 r8444 141 141 */ 142 142 private final void createVisibilityToggleShortcuts() { 143 final int[] k = { KeyEvent.VK_1, KeyEvent.VK_2, KeyEvent.VK_3, KeyEvent.VK_4,144 KeyEvent.VK_ 5, KeyEvent.VK_6, KeyEvent.VK_7, KeyEvent.VK_8,145 KeyEvent.VK_ 9, KeyEvent.VK_0};143 final int[] k = { 144 KeyEvent.VK_1, KeyEvent.VK_2, KeyEvent.VK_3, KeyEvent.VK_4, KeyEvent.VK_5, 145 KeyEvent.VK_6, KeyEvent.VK_7, KeyEvent.VK_8, KeyEvent.VK_9, KeyEvent.VK_0}; 146 146 147 147 for(int i=0; i < 10; i++) { … … 410 410 @Override 411 411 public void updateEnabledState() { 412 setEnabled(! 412 setEnabled(!getModel().getSelectedLayers().isEmpty()); 413 413 } 414 414 … … 604 604 public void updateEnabledState() { 605 605 if (layer == null) { 606 setEnabled(! 606 setEnabled(!getModel().getSelectedLayers().isEmpty()); 607 607 } else { 608 608 setEnabled(true); -
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r8413 r8444 440 440 boolean added = false; 441 441 for (OsmPrimitive p: addedPrimitives) { 442 if (! 442 if (!(p instanceof Relation)) { 443 443 continue; 444 444 } … … 474 474 Set<Relation> removedRelations = new HashSet<>(); 475 475 for (OsmPrimitive p: removedPrimitives) { 476 if (! 476 if (!(p instanceof Relation)) { 477 477 continue; 478 478 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r8395 r8444 790 790 int relations = 0; 791 791 for (OsmPrimitive o : sel) { 792 if (! 792 if (!o.isSelectable()) continue; // skip unselectable primitives 793 793 if (o instanceof Way) { 794 794 ways++; -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r8426 r8444 804 804 */ 805 805 public boolean isDialogInDefaultView() { 806 return isShowing && isDocked && (! 806 return isShowing && isDocked && (!isCollapsed); 807 807 } 808 808 -
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r8338 r8444 338 338 } 339 339 340 public void selectPrimitivesOwnedBy(int 340 public void selectPrimitivesOwnedBy(int[] rows) { 341 341 Set<User> users= new HashSet<>(); 342 342 for (int index: rows) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
r8419 r8444 241 241 // ask if the whole set should be ignored 242 242 if (asked == JOptionPane.DEFAULT_OPTION) { 243 String[] a = new String[] { tr("Whole group"), tr("Single elements"), tr("Nothing")};243 String[] a = new String[] {tr("Whole group"), tr("Single elements"), tr("Nothing")}; 244 244 asked = JOptionPane.showOptionDialog(Main.parent, tr("Ignore whole group or individual elements?"), 245 245 tr("Ignoring elements"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE, null, -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
r8308 r8444 259 259 @Override 260 260 public void propertyChange(PropertyChangeEvent evt) { 261 if (! 261 if (!evt.getPropertyName().equals(ChangesetCacheManagerModel.CHANGESET_IN_DETAIL_VIEW_PROP)) 262 262 return; 263 263 setCurrentChangeset((Changeset)evt.getNewValue()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDiscussionPanel.java
r8308 r8444 155 155 @Override 156 156 public void propertyChange(PropertyChangeEvent evt) { 157 if (! 157 if (!evt.getPropertyName().equals(ChangesetCacheManagerModel.CHANGESET_IN_DETAIL_VIEW_PROP)) 158 158 return; 159 159 setCurrentChangeset((Changeset)evt.getNewValue()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetListModel.java
r8308 r8444 122 122 Set<Changeset> changesets = new HashSet<>(); 123 123 for (OsmPrimitive p: ds.allPrimitives()) { 124 if (p.getChangesetId() <= 0) {124 if (p.getChangesetId() <= 0) { 125 125 continue; 126 126 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/AdvancedChangesetQueryPanel.java
r8394 r8444 177 177 public void displayMessageIfInvalid() { 178 178 if (cbUserRestriction.isSelected()) { 179 if (! 179 if (!pnlUserRestriction.isValidChangesetQuery()) { 180 180 pnlUserRestriction.displayMessageIfInvalid(); 181 181 } … … 200 200 ChangesetQuery query = new ChangesetQuery(); 201 201 if (cbUserRestriction.isSelected()) { 202 if (! 202 if (!pnlUserRestriction.isValidChangesetQuery()) 203 203 return null; 204 204 pnlUserRestriction.fillInQuery(query); … … 535 535 throw new IllegalStateException(tr("Current value ''{0}'' for user ID is not valid", tfUid.getText())); 536 536 } else if (rbRestrictToUserName.isSelected()) { 537 if (! 537 if (!valUserName.isValid()) 538 538 throw new IllegalStateException(tr("Cannot restrict the changeset query to the user name ''{0}''", tfUserName.getText())); 539 539 query.forUser(tfUserName.getText()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/BasicChangesetQueryPanel.java
r8388 r8444 253 253 cbMyChangesetsOnly.setEnabled(false); 254 254 } else { 255 if (! 255 if (!cbMyChangesetsOnly.isEnabled()) { 256 256 cbMyChangesetsOnly.setEnabled(true); 257 257 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/ChangesetQueryTask.java
r8377 r8444 166 166 if (query.isRestrictedToPartiallyIdentifiedUser() && im.isCurrentUser(query.getUserName())) { 167 167 // if we query changesets for the current user, make sure we query against 168 // its user id, not its user name. If necessary, determine the user id 169 // first. 168 // its user id, not its user name. If necessary, determine the user id first. 170 169 // 171 if (im.isPartiallyIdentified() 170 if (im.isPartiallyIdentified()) { 172 171 fullyIdentifyCurrentUser(); 173 172 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java
r7712 r8444 136 136 String path = url.getPath(); 137 137 String query = url.getQuery(); 138 if (path == null || ! 138 if (path == null || !path.endsWith("/changesets")) return null; 139 139 140 140 try { -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java
r8429 r8444 159 159 (Map<String, Integer>) tagData.getValueAt(row, 1), focusOnKey); 160 160 editDialog.showDialog(); 161 if (editDialog.getValue() != 1) return;161 if (editDialog.getValue() != 1) return; 162 162 editDialog.performTagEdit(); 163 163 } … … 211 211 public void saveTagsIfNeeded() { 212 212 if (PROPERTY_REMEMBER_TAGS.get() && !recentTags.isEmpty()) { 213 List<String> c = new ArrayList<>( recentTags.size()*2);213 List<String> c = new ArrayList<>(recentTags.size()*2); 214 214 for (Tag t: recentTags.keySet()) { 215 215 c.add(t.getKey()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r8338 r8444 161 161 protected Dialog getParentDialog() { 162 162 Component c = this; 163 while(c != null && ! 163 while(c != null && !(c instanceof Dialog)) { 164 164 c = c.getParent(); 165 165 } … … 186 186 187 187 public void run() { 188 TreePath 188 TreePath[] selection = childTree.getSelectionPaths(); 189 189 if (selection == null || selection.length == 0) return; 190 190 // do not launch more than 10 relation editors in parallel … … 250 250 251 251 protected void updateEnabledState() { 252 TreePath 252 TreePath[] selection = childTree.getSelectionPaths(); 253 253 setEnabled(selection != null && selection.length > 0); 254 254 } 255 255 256 256 public void run() { 257 TreePath 257 TreePath[] selection = childTree.getSelectionPaths(); 258 258 if (selection == null || selection.length == 0) 259 259 return; … … 398 398 protected void realRun() throws SAXException, IOException, OsmTransferException { 399 399 try { 400 while(! 400 while(!relationsToDownload.isEmpty() && !canceled) { 401 401 Relation r = relationsToDownload.pop(); 402 402 if (r.isNew()) { -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r8291 r8444 1260 1260 1261 1261 protected boolean confirmClosingBecauseOfDirtyState() { 1262 ButtonSpec 1262 ButtonSpec[] options = new ButtonSpec[] { 1263 1263 new ButtonSpec( 1264 1264 tr("Yes, create a conflict and close"), … … 1394 1394 TagEditorModel tagModel = tagEditorPanel.getModel(); 1395 1395 Relation snapshot = getRelationSnapshot(); 1396 if ( 1396 if ((!memberTableModel.hasSameMembersAs(snapshot) || tagModel.isDirty()) 1397 1397 && !(snapshot == null && tagModel.getTags().isEmpty())) { 1398 1398 //give the user a chance to save the changes … … 1425 1425 1426 1426 protected int confirmClosingByCancel() { 1427 ButtonSpec 1427 ButtonSpec[] options = new ButtonSpec[] { 1428 1428 new ButtonSpec( 1429 1429 tr("Yes, save the changes and close"), … … 1569 1569 "<br>" 1570 1570 + tr("Do you really want to apply the new role?") + "</html>"; 1571 String 1571 String[] options = new String[] { 1572 1572 tr("Yes, apply it"), 1573 1573 tr("No, do not apply") … … 1595 1595 public void actionPerformed(ActionEvent e) { 1596 1596 if (isEmptyRole()) { 1597 if (! 1597 if (!confirmSettingEmptyRole(memberTable.getSelectedRowCount())) 1598 1598 return; 1599 1599 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java
r8399 r8444 106 106 public Dimension getPreferredSize(){ 107 107 Container c = getParent(); 108 while(c != null && ! 108 while(c != null && !(c instanceof JViewport)) { 109 109 c = c.getParent(); 110 110 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
r8291 r8444 73 73 * @throws IllegalArgumentException if child.getId() == 0 74 74 */ 75 public ParentRelationLoadingTask(Relation child, OsmDataLayer layer, boolean full, PleaseWaitProgressMonitor monitor 75 public ParentRelationLoadingTask(Relation child, OsmDataLayer layer, boolean full, PleaseWaitProgressMonitor monitor) { 76 76 super(tr("Download referring relations"), monitor, false /* don't ignore exception */); 77 77 CheckParameterUtil.ensureValidPrimitiveId(child, "child"); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationEditor.java
r8390 r8444 117 117 super(Main.parent, 118 118 "", 119 new String[] { 119 new String[] {tr("Apply Changes"), tr("Cancel")}, 120 120 false, 121 121 false … … 200 200 */ 201 201 protected boolean isDirtyRelation() { 202 return ! 202 return !relation.hasEqualSemanticAttributes(relationSnapshot); 203 203 } 204 204 -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/RelationTree.java
r6643 r8444 67 67 protected Dialog getParentDialog() { 68 68 Component c = RelationTree.this; 69 while(c != null && ! 69 while(c != null && !(c instanceof Dialog)) { 70 70 c = c.getParent(); 71 71 } … … 90 90 TreePath path = event.getPath(); 91 91 Relation parent = (Relation)event.getPath().getLastPathComponent(); 92 if (! 92 if (!parent.isIncomplete() || parent.isNew()) 93 93 // we don't load complete or new relations 94 94 return; … … 137 137 DataSetMerger visitor = new DataSetMerger(Main.main.getEditLayer().data, ds); 138 138 visitor.merge(); 139 if (! 139 if (!visitor.getConflicts().isEmpty()) { 140 140 Main.main.getEditLayer().getConflicts().add(visitor.getConflicts()); 141 141 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/SelectionTable.java
r3083 r8444 35 35 @Override 36 36 public void mouseClicked(MouseEvent evt) { 37 if (! 37 if (!(SwingUtilities.isLeftMouseButton(evt) && evt.getClickCount() > 1)) 38 38 return; 39 39 int row = rowAtPoint(evt.getPoint()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
r8388 r8444 229 229 230 230 if (oldSelectedRows.contains(s)) { 231 expandedPaths.add(new TreePath(new Object[] { rootNode, severityNode}));231 expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode})); 232 232 } 233 233 … … 240 240 241 241 if (oldSelectedRows.contains(msgErrors.getKey())) { 242 expandedPaths.add(new TreePath(new Object[] { rootNode, severityNode, messageNode}));242 expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode, messageNode})); 243 243 } 244 244 … … 257 257 severityNode.add(groupNode); 258 258 if (oldSelectedRows.contains(bag.getKey())) { 259 expandedPaths.add(new TreePath(new Object[] { rootNode, severityNode, groupNode}));259 expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode, groupNode})); 260 260 } 261 261 } … … 279 279 if (oldSelectedRows.contains(msgErrors.getKey())) { 280 280 if (groupNode != null) { 281 expandedPaths.add(new TreePath(new Object[] { rootNode, severityNode, groupNode, 282 messageNode })); 281 expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode, groupNode, messageNode})); 283 282 } else { 284 expandedPaths.add(new TreePath(new Object[] { rootNode, severityNode, messageNode}));283 expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode, messageNode})); 285 284 } 286 285 } -
trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java
r7712 r8444 286 286 } 287 287 if (!LatLon.isValidLon(minlon) || !LatLon.isValidLon(maxlon) 288 || !LatLon.isValidLat(minlat) || ! 288 || !LatLon.isValidLat(minlat) || !LatLon.isValidLat(maxlat)) 289 289 return null; 290 290 if (minlon > maxlon) -
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r8342 r8444 367 367 cbDownloadNotes.setSelected(Main.pref.getBoolean("download.notes", false)); 368 368 cbNewLayer.setSelected(Main.pref.getBoolean("download.newlayer", false)); 369 cbStartup.setSelected( isAutorunEnabled());369 cbStartup.setSelected(isAutorunEnabled()); 370 370 int idx = Main.pref.getInteger("download.tab", 0); 371 371 if (idx < 0 || idx > tpDownloadAreaSelectors.getTabCount()) { -
trunk/src/org/openstreetmap/josm/gui/history/TagTableCellRenderer.java
r6883 r8444 32 32 Color fgColor = UIManager.getColor("Table.foreground"); 33 33 Font font = UIManager.getFont("Table.font"); 34 if (! 34 if (!model.hasTag(key)) { 35 35 text = tr("not present"); 36 36 bgColor = BGCOLOR_DIFFERENCE; … … 56 56 Color fgColor = UIManager.getColor("Table.foreground"); 57 57 Font font = UIManager.getFont("Table.font"); 58 if (! 58 if (!model.hasTag(key)) { 59 59 text = tr("not present"); 60 60 bgColor = BGCOLOR_DIFFERENCE; -
trunk/src/org/openstreetmap/josm/gui/io/CloseChangesetTask.java
r7005 r8444 73 73 for (Changeset cs: changesets) { 74 74 if (canceled) return; 75 if (cs == null || cs.getId() <= 0 || ! 75 if (cs == null || cs.getId() <= 0 || !cs.isOpen()) { 76 76 continue; 77 77 } -
trunk/src/org/openstreetmap/josm/gui/io/OpenChangesetComboBoxModel.java
r8308 r8444 100 100 return; 101 101 } 102 if (! 102 if (!(anObject instanceof Changeset)) return; 103 103 Changeset cs = (Changeset)anObject; 104 if (cs.getId() == 0 || ! 104 if (cs.getId() == 0 || !cs.isOpen()) return; 105 105 Changeset candidate = getChangesetById(cs.getId()); 106 106 if (candidate == null) return; -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
r8412 r8444 410 410 @Override 411 411 public void actionPerformed(ActionEvent e) { 412 if (! 412 if (!confirmSaveLayerInfosOK()) 413 413 return; 414 414 launchSafeAndUploadTask(); -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersModel.java
r8308 r8444 204 204 public boolean hasUnsavedData() { 205 205 for (SaveLayerInfo info: layerInfo) { 206 if (info.isDoUploadToServer() && ! 206 if (info.isDoUploadToServer() && !UploadOrSaveState.OK.equals(info.getUploadState())) 207 207 return true; 208 if (info.isDoSaveToFile() && ! 208 if (info.isDoSaveToFile() && !UploadOrSaveState.OK.equals(info.getSaveState())) 209 209 return true; 210 210 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java
r8426 r8444 242 242 } 243 243 244 public List<OsmPrimitive> getPrimitives(int 244 public List<OsmPrimitive> getPrimitives(int[] indices) { 245 245 if (indices == null || indices.length == 0) 246 246 return Collections.emptyList(); -
trunk/src/org/openstreetmap/josm/gui/io/UploadStrategy.java
r8404 r8444 88 88 UploadStrategy strategy = fromPreference(v); 89 89 if (strategy == null) { 90 Main.warn(tr("Unexpected value for key ''{0}'' in preferences, got ''{1}''", "osm-server.upload-strategy", v 90 Main.warn(tr("Unexpected value for key ''{0}'' in preferences, got ''{1}''", "osm-server.upload-strategy", v)); 91 91 return DEFAULT_UPLOAD_STRATEGY; 92 92 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadStrategySelectionPanel.java
r8388 r8444 330 330 331 331 lblMultiChangesetPoliciesHeader.setText(tr("<html>There are <strong>multiple changesets</strong> necessary in order to upload {0} objects. Which strategy do you want to use?</html>", numUploadedObjects)); 332 if (!rbFillOneChangeset.isSelected() && ! 332 if (!rbFillOneChangeset.isSelected() && !rbUseMultipleChangesets.isSelected()) { 333 333 rbUseMultipleChangesets.setSelected(true); 334 334 } -
trunk/src/org/openstreetmap/josm/gui/layer/ImageryLayer.java
r8393 r8444 234 234 Kernel kernel; 235 235 if (sharpenLevel == 1) { 236 kernel = new Kernel(3, 3, new float[] { 236 kernel = new Kernel(3, 3, new float[] {-0.25f, -0.5f, -0.25f, -0.5f, 4, -0.5f, -0.25f, -0.5f, -0.25f}); 237 237 } else { 238 kernel = new Kernel(3, 3, new float[] { 238 kernel = new Kernel(3, 3, new float[] {-0.5f, -1, -0.5f, -1, 7, -1, -0.5f, -1, -0.5f}); 239 239 } 240 240 BufferedImageOp op = new ConvolveOp(kernel, ConvolveOp.EDGE_NO_OP, null); -
trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
r8394 r8444 232 232 notePoint.setLocation(notePoint.getX(), notePoint.getY() - NotesDialog.ICON_SMALL_SIZE / 2); 233 233 double dist = clickPoint.distanceSq(notePoint); 234 if (minDistance > dist && clickPoint.distance(notePoint) < snapDistance 234 if (minDistance > dist && clickPoint.distance(notePoint) < snapDistance) { 235 235 minDistance = dist; 236 236 closestNote = note; -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r8424 r8444 746 746 boolean zia = currentZoomLevel < this.getMaxZoomLvl(); 747 747 if (Main.isDebugEnabled()) { 748 Main.debug("zoomIncreaseAllowed(): " + zia + " " + currentZoomLevel + " vs. " + this.getMaxZoomLvl() 748 Main.debug("zoomIncreaseAllowed(): " + zia + " " + currentZoomLevel + " vs. " + this.getMaxZoomLvl()); 749 749 } 750 750 return zia; … … 1419 1419 1420 1420 List<Tile> missedTiles = this.paintTileImages(g, ts, displayZoomLevel, null); 1421 int[] otherZooms = { 1421 int[] otherZooms = {-1, 1, -2, 2, -3, -4, -5}; 1422 1422 for (int zoomOffset : otherZooms) { 1423 1423 if (!autoZoom) { -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r8419 r8444 105 105 // these values correspond to the zoom levels used throughout OSM and are in meters/pixel from zoom level 0 to 18. 106 106 // taken from http://wiki.openstreetmap.org/wiki/Zoom_levels 107 private static final Double[] snapLevels = { 108 2444.0, 1222.0, 610.984, 305.492, 152.746, 76.373, 38.187, 19.093, 9.547, 4.773, 2.387, 1.193, 0.596 107 private static final Double[] snapLevels = {156412.0, 78206.0, 39103.0, 19551.0, 9776.0, 4888.0, 108 2444.0, 1222.0, 610.984, 305.492, 152.746, 76.373, 38.187, 19.093, 9.547, 4.773, 2.387, 1.193, 0.596}; 109 109 110 110 public static final BooleanProperty PROP_ALPHA_CHANNEL = new BooleanProperty("imagery.wms.alpha_channel", true); … … 369 369 370 370 public int getImageXIndex(double coord) { 371 return (int)Math.floor( 371 return (int)Math.floor(((coord - dx) * info.getPixelPerDegree()) / imageSize); 372 372 } 373 373 374 374 public int getImageYIndex(double coord) { 375 return (int)Math.floor( 375 return (int)Math.floor(((coord - dy) * info.getPixelPerDegree()) / imageSize); 376 376 } 377 377 … … 573 573 } 574 574 575 if ( 575 if (priority == -1 576 576 || finishedRequests.contains(item) 577 577 || processingRequests.contains(item)) { -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r8426 r8444 420 420 421 421 boolean isOk = false; 422 while (! 422 while (!isOk) { 423 423 int answer = JOptionPane.showConfirmDialog( 424 424 Main.parent, panel, … … 438 438 JOptionPane.showMessageDialog(Main.parent, tr("Error while parsing the date.\n" 439 439 + "Please use the requested format"), 440 tr("Invalid date"), JOptionPane.ERROR_MESSAGE 440 tr("Invalid date"), JOptionPane.ERROR_MESSAGE); 441 441 continue; 442 442 } … … 697 697 Main.parent, 698 698 tr("Correlate images with GPX track"), 699 new String[] { tr("OK"), tr("Try Again")}).699 new String[] {tr("OK"), tr("Try Again")}). 700 700 setContent(tr("No images could be matched!")). 701 setButtonIcons(new String[] { 701 setButtonIcons(new String[] {"ok", "dialogs/refresh"}). 702 702 showDialog().getValue() == 2) 703 703 return AGAIN; … … 743 743 } 744 744 } 745 if (! 745 if (!boundingBoxedLayerFound) { 746 746 BoundingXYVisitor bbox = new BoundingXYVisitor(); 747 747 yLayer.visitBoundingBox(bbox); … … 981 981 new ExtendedDialog(Main.parent, 982 982 tr("Adjust timezone and offset"), 983 new String[] { 983 new String[] {tr("Close")}). 984 984 setContent(p).setButtonIcons(new String[] {"ok"}).showDialog(); 985 985 } … … 1114 1114 if (complain) { 1115 1115 JOptionPane.showMessageDialog(Main.parent, tr("You should select a GPX track"), 1116 tr("No selected GPX track"), JOptionPane.ERROR_MESSAGE 1116 tr("No selected GPX track"), JOptionPane.ERROR_MESSAGE); 1117 1117 } 1118 1118 return null; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r8405 r8444 545 545 double dir = e.getExifImgDir(); 546 546 // Rotate 90 degrees CCW 547 double headdir = ( dir < 90) ? dir + 270 : dir - 90;548 double leftdir = ( headdir < 90) ? headdir + 270 : headdir - 90;549 double rightdir = ( headdir > 270) ? headdir - 270 : headdir + 90;547 double headdir = (dir < 90) ? dir + 270 : dir - 90; 548 double leftdir = (headdir < 90) ? headdir + 270 : headdir - 90; 549 double rightdir = (headdir > 270) ? headdir - 270 : headdir + 90; 550 550 551 551 double ptx = p.x + Math.cos(Math.toRadians(headdir)) * arrowlength; -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageDisplay.java
r8378 r8444 73 73 74 74 // Wait for the end of loading 75 while (! 75 while (!tracker.checkID(1, true)) { 76 76 if (this.file != ImageDisplay.this.file) { 77 77 // The file has changed … … 290 290 @Override 291 291 public void mouseDragged(MouseEvent e) { 292 if (! 292 if (!mouseIsDragging && selectedRect == null) 293 293 return; 294 294 … … 339 339 @Override 340 340 public void mouseReleased(MouseEvent e) { 341 if (! 341 if (!mouseIsDragging && selectedRect == null) 342 342 return; 343 343 … … 479 479 g.setColor(Color.black); 480 480 String loadingStr; 481 if (! 481 if (!errorLoading) { 482 482 loadingStr = tr("Loading {0}", file.getName()); 483 483 } else { -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r8378 r8444 327 327 return; 328 328 } 329 if (! 329 if (!isDialogShowing()) { 330 330 setIsDocked(false); // always open a detached window when an image is clicked and dialog is closed 331 331 showDialog(); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java
r8384 r8444 84 84 private static final int sl4 = 5; 85 85 private static final int sl9 = 3; 86 private static final int[][] dir = { { +sl4, +ll0, +ll0, +sl4 }, { -sl9, +ll0, +sl9, +ll0 }, { -ll0, +sl4, -sl4, +ll0 }, 87 { -ll0, -sl9, -ll0, +sl9 }, { -sl4, -ll0, -ll0, -sl4 }, { +sl9, -ll0, -sl9, -ll0 }, 88 { +ll0, -sl4, +sl4, -ll0 }, { +ll0, +sl9, +ll0, -sl9 }, { +sl4, +ll0, +ll0, +sl4 }, 89 { -sl9, +ll0, +sl9, +ll0 }, { -ll0, +sl4, -sl4, +ll0 }, { -ll0, -sl9, -ll0, +sl9 } }; 86 private static final int[][] dir = { 87 {+sl4, +ll0, +ll0, +sl4}, {-sl9, +ll0, +sl9, +ll0}, {-ll0, +sl4, -sl4, +ll0}, 88 {-ll0, -sl9, -ll0, +sl9}, {-sl4, -ll0, -ll0, -sl4}, {+sl9, -ll0, -sl9, -ll0}, 89 {+ll0, -sl4, +sl4, -ll0}, {+ll0, +sl9, +ll0, -sl9}, {+sl4, +ll0, +ll0, +sl4}, 90 {-sl9, +ll0, +sl9, +ll0}, {-ll0, +sl4, -sl4, +ll0}, {-ll0, -sl9, -ll0, +sl9}}; 90 91 91 92 private void setupColors() { -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
r8342 r8444 91 91 92 92 // Legacy code - convert label from int to template engine expression 93 private static final IntegerProperty PROP_LABEL = new IntegerProperty("draw.rawgps.layer.wpt", 0 93 private static final IntegerProperty PROP_LABEL = new IntegerProperty("draw.rawgps.layer.wpt", 0); 94 94 private static String getDefaultLabelPattern() { 95 95 switch (PROP_LABEL.get()) { … … 188 188 Collection<GpxLink> links = wpt.<GpxLink>getCollection(GpxConstants.META_LINKS); 189 189 if (links != null) { 190 for (GpxLink oneLink : links 190 for (GpxLink oneLink : links) { 191 191 uri = oneLink.uri; 192 192 break; -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r8419 r8444 150 150 } 151 151 } 152 if (! 152 if (!mousePressedInButton) 153 153 return; 154 154 mousePressed = true; … … 158 158 } 159 159 @Override public void mouseReleased(MouseEvent ev) { 160 if (ev.getButton() != MouseEvent.BUTTON1 || ! 160 if (ev.getButton() != MouseEvent.BUTTON1 || !mousePressed) 161 161 return; 162 162 mousePressed = false; … … 266 266 public boolean synchronizeAudioMarkers(final AudioMarker startMarker) { 267 267 syncAudioMarker = startMarker; 268 if (syncAudioMarker != null && ! 268 if (syncAudioMarker != null && !data.contains(syncAudioMarker)) { 269 269 syncAudioMarker = null; 270 270 } … … 506 506 @Override 507 507 public void actionPerformed(ActionEvent e) { 508 if (! 508 if (!AudioPlayer.paused()) { 509 509 JOptionPane.showMessageDialog( 510 510 Main.parent, … … 543 543 @Override 544 544 public void actionPerformed(ActionEvent e) { 545 if (! 545 if (!AudioPlayer.paused()) { 546 546 JOptionPane.showMessageDialog( 547 547 Main.parent, -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java
r8378 r8444 65 65 null, -1.0, 0.0); 66 66 enabled = Main.pref.getBoolean("marker.traceaudio", true); 67 if (! 67 if (!enabled) return; 68 68 dropTolerance = Main.pref.getInteger("marker.playHeadDropTolerance", 50); 69 69 Main.map.mapView.addMouseListener(new MouseAdapter() { … … 111 111 */ 112 112 private void endDrag(boolean reset) { 113 if (! 113 if (!wasPlaying || reset) { 114 114 try { AudioPlayer.pause(); 115 115 } catch (Exception ex) { AudioPlayer.audioMalfunction(ex);} … … 210 210 211 211 /* We found the closest marker: did we actually hit it? */ 212 if (ca != null && ! 212 if (ca != null && !ca.containsPoint(startPoint)) { 213 213 ca = null; 214 214 } … … 277 277 */ 278 278 public void animate() { 279 if (! 279 if (!enabled) return; 280 280 jumpToMarker = true; 281 281 if (timer == null) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r8393 r8444 175 175 Float f = toFloat(o); 176 176 if (f != null) 177 return new float[] { f};177 return new float[] {f}; 178 178 return null; 179 179 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/RepeatImageElemStyle.java
r8393 r8444 36 36 float offset = c.get(REPEAT_IMAGE_OFFSET, 0f, Float.class); 37 37 float spacing = c.get(REPEAT_IMAGE_SPACING, 0f, Float.class); 38 float phase = - 38 float phase = -c.get(REPEAT_IMAGE_PHASE, 0f, Float.class); 39 39 40 40 LineImageAlignment align = LineImageAlignment.CENTER; -
trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java
r8390 r8444 156 156 } 157 157 158 return new TextElement(strategy, font, (int) xOffset, - 158 return new TextElement(strategy, font, (int) xOffset, -(int) yOffset, color, haloRadius, haloColor); 159 159 } 160 160 -
trunk/src/org/openstreetmap/josm/gui/oauth/AdvancedOAuthPropertiesPanel.java
r8308 r8444 126 126 OAuthParameters params = OAuthParameters.createDefault(apiUrl); 127 127 return 128 ! 129 || ! 130 || ! 131 || ! 132 || ! 128 !tfConsumerKey.getText().equals(params.getConsumerKey()) 129 || !tfConsumerSecret.getText().equals(params.getConsumerSecret()) 130 || !tfRequestTokenURL.getText().equals(params.getRequestTokenUrl()) 131 || !tfAccessTokenURL.getText().equals(params.getAccessTokenUrl()) 132 || !tfAuthoriseURL.getText().equals(params.getAuthoriseUrl()); 133 133 } 134 134 … … 216 216 cbUseDefaults.setSelected(false); 217 217 setChildComponentsEnabled(true); 218 tfConsumerKey.setText( 219 tfConsumerSecret.setText( 218 tfConsumerKey.setText(parameters.getConsumerKey() == null ? "" : parameters.getConsumerKey()); 219 tfConsumerSecret.setText(parameters.getConsumerSecret() == null ? "" : parameters.getConsumerSecret()); 220 220 tfRequestTokenURL.setText(parameters.getRequestTokenUrl() == null ? "" : parameters.getRequestTokenUrl()); 221 221 tfAccessTokenURL.setText(parameters.getAccessTokenUrl() == null ? "" : parameters.getAccessTokenUrl()); -
trunk/src/org/openstreetmap/josm/gui/oauth/ManualAuthorizationUI.java
r8442 r8444 219 219 220 220 public void build() { 221 if (! 221 if (!valAccessTokenKey.isValid() || !valAccessTokenSecret.isValid()) { 222 222 setAccessToken(null); 223 223 } else { … … 269 269 @Override 270 270 public void propertyChange(PropertyChangeEvent evt) { 271 if (! 271 if (!evt.getPropertyName().equals(AbstractAuthorizationUI.ACCESS_TOKEN_PROP)) 272 272 return; 273 273 updateEnabledState(); -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r8415 r8444 228 228 for (String kvPair : kvPairs) { 229 229 kvPair = kvPair.trim(); 230 String 230 String[] kv = kvPair.split("="); 231 231 if (kv == null || kv.length != 2) { 232 232 continue; -
trunk/src/org/openstreetmap/josm/gui/oauth/RetrieveRequestTokenTask.java
r8291 r8444 39 39 * @throws IllegalArgumentException if parameters is null. 40 40 */ 41 public RetrieveRequestTokenTask(Component parent, OAuthParameters parameters 41 public RetrieveRequestTokenTask(Component parent, OAuthParameters parameters) { 42 42 super(parent, tr("Retrieving OAuth Request Token..."), false /* don't ignore exceptions */); 43 43 CheckParameterUtil.ensureParameterNotNull(parameters, "parameters"); -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java
r6890 r8444 84 84 // set the maximum width to the current screen. If the dialog is opened on a 85 85 // smaller screen than before, this will reset the stored preference. 86 this.setMaximumSize( 86 this.setMaximumSize(Toolkit.getDefaultToolkit().getScreenSize()); 87 87 } 88 88 -
trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java
r8308 r8444 310 310 final List<PluginInformation> toDownload = preference.getPluginsScheduledForUpdateOrDownload(); 311 311 final PluginDownloadTask task; 312 if (toDownload != null && ! 312 if (toDownload != null && !toDownload.isEmpty()) { 313 313 task = new PluginDownloadTask(this, toDownload, tr("Download plugins")); 314 314 } else { … … 349 349 // 350 350 if (requiresRestart) { 351 final ButtonSpec 351 final ButtonSpec[] options = RestartAction.getButtonSpecs(); 352 352 if (0 == HelpAwareOptionPane.showOptionDialog( 353 353 Main.parent, -
trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java
r8399 r8444 542 542 return; 543 543 if (canEnable && column == 0) { 544 data.get(row).active = ! 544 data.get(row).active = !data.get(row).active; 545 545 } 546 546 } … … 999 999 } 1000 1000 if (!messages.isEmpty()) { 1001 ExtendedDialog dlg = new ExtendedDialog(Main.parent, tr("Warning"), new String [] { tr("Cancel"), tr("Continue anyway")});1001 ExtendedDialog dlg = new ExtendedDialog(Main.parent, tr("Warning"), new String[] {tr("Cancel"), tr("Continue anyway")}); 1002 1002 dlg.setButtonIcons(new Icon[] { 1003 1003 ImageProvider.get("cancel"), … … 1300 1300 if (line.startsWith("\t")) { 1301 1301 Matcher m = Pattern.compile("^\t([^:]+): *(.+)$").matcher(line); 1302 if (! 1302 if (!m.matches()) { 1303 1303 Main.error(tr(getStr(I18nString.ILLEGAL_FORMAT_OF_ENTRY), url, line)); 1304 1304 continue; -
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r8423 r8444 414 414 String res = parser.saveAction(act); 415 415 // remove the button from toolbar preferences 416 t.remove( res);416 t.remove(res); 417 417 Main.pref.putCollection("toolbar", t); 418 418 Main.toolbar.refreshToolbarControl(); … … 535 535 private class ActionTransferable implements Transferable { 536 536 537 private final DataFlavor[] flavors = new DataFlavor[] { ACTION_FLAVOR};537 private final DataFlavor[] flavors = new DataFlavor[] {ACTION_FLAVOR}; 538 538 539 539 private final List<ActionDefinition> actions; … … 769 769 770 770 @Override 771 public int getSourceActions( JComponent c ){771 public int getSourceActions(JComponent c) { 772 772 return TransferHandler.MOVE; 773 773 } -
trunk/src/org/openstreetmap/josm/gui/preferences/audio/AudioPreference.java
r7668 r8444 59 59 60 60 // audioMenuVisible 61 audioMenuVisible.setSelected(! 61 audioMenuVisible.setSelected(!Main.pref.getBoolean("audio.menuinvisible")); 62 62 audioMenuVisible.setToolTipText(tr("Show or hide the audio menu entry on the main menu bar.")); 63 63 audio.add(audioMenuVisible, GBC.eol().insets(0,0,0,0)); … … 127 127 @Override 128 128 public boolean ok() { 129 Main.pref.put("audio.menuinvisible", ! 129 Main.pref.put("audio.menuinvisible", !audioMenuVisible.isSelected()); 130 130 Main.pref.put("marker.traceaudio", markerAudioTraceVisible.isSelected()); 131 131 Main.pref.put("marker.buttonlabels", markerButtonLabels.isSelected()); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/ColorPreference.java
r8395 r8444 242 242 panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5)); 243 243 JScrollPane scrollpane = new JScrollPane(colors); 244 scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0));244 scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 245 245 panel.add(scrollpane, GBC.eol().fill(GBC.BOTH)); 246 246 JPanel buttonPanel = new JPanel(new GridBagLayout()); -
trunk/src/org/openstreetmap/josm/gui/preferences/display/DrawingPreference.java
r8342 r8444 63 63 64 64 JScrollPane scrollpane = new JScrollPane(panel); 65 scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0));65 scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 66 66 gui.getDisplayPreference().addSubTab(this, tr("GPS Points"), scrollpane); 67 67 panel = new JPanel(new GridBagLayout()); … … 166 166 panel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH)); 167 167 scrollpane = new JScrollPane(panel); 168 scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0));168 scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 169 169 gui.getDisplayPreference().addSubTab(this, tr("OSM Data"), scrollpane); 170 170 } -
trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java
r8285 r8444 148 148 149 149 JScrollPane scrollpane = new JScrollPane(panel); 150 scrollpane.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0));150 scrollpane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 151 151 gui.getDisplayPreference().addSubTab(this, tr("Look and Feel"), scrollpane); 152 152 } -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java
r8426 r8444 181 181 } 182 182 } 183 imageryProviders.activeModel.addRow(new String[] { server, url});183 imageryProviders.activeModel.addRow(new String[] {server, url}); 184 184 } 185 185 … … 856 856 */ 857 857 public OffsetsBookmarksModel() { 858 setColumnIdentifiers(new String[] { tr("Projection"), tr("Layer"), tr("Name"), tr("Easting"), tr("Northing"),});858 setColumnIdentifiers(new String[] {tr("Projection"), tr("Layer"), tr("Name"), tr("Easting"), tr("Northing")}); 859 859 } 860 860 -
trunk/src/org/openstreetmap/josm/gui/preferences/map/MapPaintPreference.java
r8316 r8444 73 73 74 74 final JPanel panel = new JPanel(new GridBagLayout()); 75 panel.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0));75 panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 76 76 77 77 panel.add(sources, GBC.eol().fill(GBC.BOTH)); … … 268 268 defPL2.description = tr("the main Potlatch 2 style"); 269 269 270 return Arrays.asList(new ExtendedSourceEntry[] { defJosmMapcss, defPL2});270 return Arrays.asList(new ExtendedSourceEntry[] {defJosmMapcss, defPL2}); 271 271 } 272 272 -
trunk/src/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreference.java
r8374 r8444 166 166 167 167 final JPanel panel = new JPanel(new GridBagLayout()); 168 panel.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0));168 panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 169 169 panel.add(sortMenu, GBC.eol().insets(5,5,5,0)); 170 170 sources = new TaggingPresetSourceEditor(); -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r8413 r8444 281 281 @Override 282 282 public boolean ok() { 283 if (! 283 if (!pluginPreferencesActivated) 284 284 return false; 285 285 pnlPluginUpdatePolicy.rememberInPreferences(); -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
r8404 r8444 281 281 PluginInformation pi = entry.getKey(); 282 282 boolean selected = entry.getValue(); 283 if (selected && ! 283 if (selected && !currentActivePlugins.contains(pi.name)) { 284 284 ret.add(pi); 285 285 } … … 300 300 continue; 301 301 } 302 if (selectedPluginsMap.get(pi) == null || ! 302 if (selectedPluginsMap.get(pi) == null || !selectedPluginsMap.get(pi)) { 303 303 ret.add(pi); 304 304 } … … 340 340 public boolean isActivePluginsChanged() { 341 341 Set<String> newActivePlugins = getSelectedPluginNames(); 342 return ! 342 return !newActivePlugins.equals(currentActivePlugins); 343 343 } 344 344 -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
r8390 r8444 163 163 */ 164 164 public ParameterInfoDialog() { 165 super(null, tr("Parameter information"), new String[] { tr("Close")}, false);165 super(null, tr("Parameter information"), new String[] {tr("Close")}, false); 166 166 setContent(build()); 167 167 } -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/GaussKruegerProjectionChoice.java
r7937 r8444 11 11 public class GaussKruegerProjectionChoice extends ListProjectionChoice { 12 12 13 private static String[] zones = { "2", "3", "4", "5"};13 private static String[] zones = {"2", "3", "4", "5"}; 14 14 15 15 /** -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r8426 r8444 313 313 } 314 314 315 projPanel.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0));315 projPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); 316 316 projPanel.setLayout(new GridBagLayout()); 317 317 projPanel.add(new JLabel(tr("Projection method")), GBC.std().insets(5,5,0,5)); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/SingleProjectionChoice.java
r7937 r8444 49 49 @Override 50 50 public String[] allCodes() { 51 return new String[] { code};51 return new String[] {code}; 52 52 } 53 53 -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMFranceDOMProjectionChoice.java
r7937 r8444 16 16 private static final String Reunion92Name = tr("Reunion RGR92"); 17 17 private static final String Guyane92Name = tr("Guyane RGFG95"); 18 private static final String[] utmGeodesicsNames = { 18 private static final String[] utmGeodesicsNames = {FortMarigotName, SainteAnneName, MartiniqueName, Reunion92Name, Guyane92Name}; 19 19 20 20 private static final Integer FortMarigotEPSG = 2969; … … 23 23 private static final Integer ReunionEPSG = 2975; 24 24 private static final Integer GuyaneEPSG = 2972; 25 private static final Integer[] utmEPSGs = { 25 private static final Integer[] utmEPSGs = {FortMarigotEPSG, SainteAnneEPSG, MartiniqueEPSG, ReunionEPSG, GuyaneEPSG }; 26 26 27 27 /** … … 68 68 @Override 69 69 public Collection<String> getPreferencesFromCode(String code) { 70 for (int i=0; i < utmEPSGs.length; i++ 70 for (int i=0; i < utmEPSGs.length; i++) 71 71 if (("EPSG:" + utmEPSGs[i]).equals(code)) 72 72 return Collections.singleton(Integer.toString(i+1)); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java
r8442 r8444 30 30 import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard; 31 31 import org.openstreetmap.josm.gui.oauth.TestAccessTokenTask; 32 import org.openstreetmap.josm.gui.widgets.JMultilineLabel; 33 import org.openstreetmap.josm.gui.widgets.JosmTextField; 32 34 import org.openstreetmap.josm.io.OsmApi; 33 35 import org.openstreetmap.josm.io.auth.CredentialsManager; 34 36 import org.openstreetmap.josm.tools.ImageProvider; 35 import org.openstreetmap.josm.gui.widgets.JMultilineLabel;36 import org.openstreetmap.josm.gui.widgets.JosmTextField;37 37 38 38 /** … … 360 360 */ 361 361 private class TestAuthorisationAction extends AbstractAction { 362 /** 363 * Constructs a new {@code TestAuthorisationAction}. 364 */ 362 365 public TestAuthorisationAction() { 363 366 putValue(NAME, tr("Test Access Token")); … … 383 386 @Override 384 387 public void propertyChange(PropertyChangeEvent evt) { 385 if (! 388 if (!evt.getPropertyName().equals(OsmApiUrlInputPanel.API_URL_PROP)) 386 389 return; 387 390 setApiUrl((String)evt.getNewValue()); -
trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java
r8404 r8444 343 343 tfProxySocksPort.setText(Main.pref.get(PROXY_SOCKS_PORT, "")); 344 344 345 if (pp.equals(ProxyPolicy.USE_SYSTEM_SETTINGS) && ! 345 if (pp.equals(ProxyPolicy.USE_SYSTEM_SETTINGS) && !DefaultProxySelector.willJvmRetrieveSystemProxies()) { 346 346 Main.warn(tr("JOSM is configured to use proxies from the system setting, but the JVM is not configured to retrieve them. Resetting preferences to ''No proxy''")); 347 347 pp = ProxyPolicy.NO_PROXY; -
trunk/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java
r7937 r8444 85 85 GBC a = GBC.eol().insets(-5,0,0,0); 86 86 a.anchor = GBC.EAST; 87 testPanel.add( new JLabel(tr("On demand")), GBC.std());88 testPanel.add( new JLabel(tr("On upload")), a);87 testPanel.add(new JLabel(tr("On demand")), GBC.std()); 88 testPanel.add(new JLabel(tr("On upload")), a); 89 89 90 90 allTests = OsmValidator.getTests(); -
trunk/src/org/openstreetmap/josm/gui/tagging/TagCellEditor.java
r8308 r8444 59 59 // 60 60 for (String key : model.getKeys()) { 61 if (! 61 if (!key.equals(currentTag.getName())) { 62 62 autoCompletionList.remove(key); 63 63 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TagEditorModel.java
r8338 r8444 250 250 * @param tagIndices a list of tag indices 251 251 */ 252 public void deleteTagNames(int 252 public void deleteTagNames(int[] tagIndices) { 253 253 if (tags == null) 254 254 return; … … 268 268 * @param tagIndices the lit of tag indices 269 269 */ 270 public void deleteTagValues(int 270 public void deleteTagValues(int[] tagIndices) { 271 271 if (tags == null) 272 272 return; … … 307 307 * @param tagIndices the list of tag indices 308 308 */ 309 public void deleteTags(int 309 public void deleteTags(int[] tagIndices) { 310 310 if (tags == null) 311 311 return; … … 546 546 String oldName = tag.getName(); 547 547 tag.setName(newName); 548 if (! 548 if (!newName.equals(oldName)) { 549 549 setDirty(true); 550 550 } … … 564 564 String oldValue = tag.getValue(); 565 565 tag.setValue(newValue); 566 if (! 566 if (!newValue.equals(oldValue)) { 567 567 setDirty(true); 568 568 } -
trunk/src/org/openstreetmap/josm/gui/tagging/TagTable.java
r8308 r8444 445 445 public Dimension getPreferredSize(){ 446 446 Container c = getParent(); 447 while(c != null && ! 447 while(c != null && !(c instanceof JViewport)) { 448 448 c = c.getParent(); 449 449 } … … 537 537 if (c!=null) { 538 538 c.requestFocusInWindow(); 539 if ( c instanceof JTextComponent) {540 ( (JTextComponent)c).selectAll();539 if (c instanceof JTextComponent) { 540 ((JTextComponent)c).selectAll(); 541 541 } 542 542 } 543 543 // there was a bug here - on older 1.6 Java versions Tab was not working 544 544 // after such activation. In 1.7 it works OK, 545 // previous solution of usin tawt.Robot was resetting mouse speed on Windows545 // previous solution of using awt.Robot was resetting mouse speed on Windows 546 546 } 547 547 … … 557 557 558 558 @Override 559 public boolean editCellAt(int row, int column, EventObject e) {559 public boolean editCellAt(int row, int column, EventObject e) { 560 560 561 561 // a snipped copied from the Java 1.5 implementation of JTable -
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
r8345 r8444 276 276 for (Role i : roles.roles) { 277 277 if (i.memberExpression != null && i.memberExpression.match(osm) 278 && (i.types == null || i.types.isEmpty() || i.types.contains(TaggingPresetType.forPrimitive(osm)) 278 && (i.types == null || i.types.isEmpty() || i.types.contains(TaggingPresetType.forPrimitive(osm)))) { 279 279 return i.key; 280 280 } … … 334 334 super(Main.parent, title, 335 335 showNewRelation? 336 new String[] { tr("Apply Preset"), tr("New relation"), tr("Cancel") }:337 new String[] { tr("Apply Preset"), tr("Cancel")},336 new String[] {tr("Apply Preset"), tr("New relation"), tr("Cancel")} : 337 new String[] {tr("Apply Preset"), tr("Cancel")}, 338 338 true); 339 339 if (icon != null) -
trunk/src/org/openstreetmap/josm/gui/tagging/ac/AutoCompletingTextField.java
r8394 r8444 292 292 @Override 293 293 public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { 294 setText( 294 setText(value == null ? "" : value.toString()); 295 295 rememberOriginalValue(getText()); 296 296 return this; -
trunk/src/org/openstreetmap/josm/gui/util/AdjustmentSynchronizer.java
r8390 r8444 62 62 @Override 63 63 public void adjustmentValueChanged(AdjustmentEvent e) { 64 if (! 64 if (!enabledMap.get(e.getAdjustable())) 65 65 return; 66 66 for (Adjustable a : synchronizedAdjustables) { … … 78 78 protected void setParticipatingInSynchronizedScrolling(Adjustable adjustable, boolean isParticipating) { 79 79 CheckParameterUtil.ensureParameterNotNull(adjustable, "adjustable"); 80 if (! 80 if (!synchronizedAdjustables.contains(adjustable)) 81 81 throw new IllegalStateException(tr("Adjustable {0} not registered yet. Cannot set participation in synchronized adjustment.", adjustable)); 82 82 … … 93 93 */ 94 94 protected boolean isParticipatingInSynchronizedScrolling(Adjustable adjustable) { 95 if (! 95 if (!synchronizedAdjustables.contains(adjustable)) 96 96 throw new IllegalStateException(tr("Adjustable {0} not registered yet.", adjustable)); 97 97 … … 117 117 CheckParameterUtil.ensureParameterNotNull(view, "view"); 118 118 119 if (! 119 if (!synchronizedAdjustables.contains(adjustable)) { 120 120 participateInSynchronizedScrolling(adjustable); 121 121 } -
trunk/src/org/openstreetmap/josm/gui/util/HighlightHelper.java
r8285 r8444 119 119 DataSet ds = Main.main.getCurrentDataSet(); 120 120 if (ds!=null) { 121 highlightedPrimitives.addAll( ds.allNonDeletedPrimitives());121 highlightedPrimitives.addAll(ds.allNonDeletedPrimitives()); 122 122 } 123 123 } -
trunk/src/org/openstreetmap/josm/gui/widgets/BoundingBoxSelectionPanel.java
r6890 r8444 97 97 } 98 98 if (!LatLon.isValidLon(minlon) || !LatLon.isValidLon(maxlon) 99 || !LatLon.isValidLat(minlat) || ! 99 || !LatLon.isValidLat(minlat) || !LatLon.isValidLat(maxlat)) 100 100 return null; 101 101 if (minlon > maxlon) -
trunk/src/org/openstreetmap/josm/gui/widgets/DateEditorWithSlider.java
r8308 r8444 43 43 public DateEditorWithSlider(String labelText) { 44 44 super(new GridBagLayout()); 45 spinner = new JSpinner( new SpinnerDateModel());45 spinner = new JSpinner(new SpinnerDateModel()); 46 46 String pattern = ((SimpleDateFormat)DateUtils.getDateFormat(DateFormat.DEFAULT)).toPattern(); 47 47 JSpinner.DateEditor timeEditor = new JSpinner.DateEditor(spinner,pattern); -
trunk/src/org/openstreetmap/josm/gui/widgets/MultiSplitPane.java
r8342 r8444 388 388 @Override 389 389 public AccessibleContext getAccessibleContext() { 390 if ( accessibleContext == null) {390 if (accessibleContext == null) { 391 391 accessibleContext = new AccessibleMultiSplitPane(); 392 392 } -
trunk/src/org/openstreetmap/josm/io/imagery/HTMLGrabber.java
r7132 r8444 38 38 } 39 39 40 ProcessBuilder builder = new ProcessBuilder( 40 ProcessBuilder builder = new ProcessBuilder(cmdParams); 41 41 42 42 Process browser; -
trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java
r8404 r8444 153 153 154 154 public static int random(int min, int max) { 155 return (int)(Math.random() * ((max+1)-min) 155 return (int)(Math.random() * ((max+1)-min)) + min; 156 156 } 157 157 … … 268 268 String contentType = conn.getHeaderField("Content-Type"); 269 269 if (conn.getResponseCode() != 200 270 || contentType != null && !contentType.startsWith("image") 270 || contentType != null && !contentType.startsWith("image")) { 271 271 String xml = readException(conn); 272 272 try { … … 302 302 try (BufferedReader br = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))) { 303 303 String line = null; 304 while ((line = br.readLine()) != null) {304 while ((line = br.readLine()) != null) { 305 305 // filter non-ASCII characters and control characters 306 306 exception.append(line.replaceAll("[^\\p{Print}]", "")); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java
r8379 r8444 117 117 */ 118 118 public AddTagsDialog(String[][] tags, String senderName, Collection<? extends OsmPrimitive> primitives) { 119 super(Main.parent, tr("Add tags to selected objects"), new String[] { tr("Add selected tags"), tr("Add all tags"),tr("Cancel")},119 super(Main.parent, tr("Add tags to selected objects"), new String[] {tr("Add selected tags"), tr("Add all tags"), tr("Cancel")}, 120 120 false, 121 121 true); … … 213 213 if (!sender.isEmpty() && !trustedSenders.contains(sender)) { 214 214 final JCheckBox c = new JCheckBox(); 215 c.setAction(new AbstractAction(tr("Accept all tags from {0} for this session", sender) 215 c.setAction(new AbstractAction(tr("Accept all tags from {0} for this session", sender)) { 216 216 @Override public void actionPerformed(ActionEvent e) { 217 217 if (c.isSelected()) … … 220 220 trustedSenders.remove(sender); 221 221 } 222 } 222 }); 223 223 tablePanel.add(c , GBC.eol().insets(20,10,0,0)); 224 224 } … … 274 274 for (String tag : tagSet) { 275 275 // support a = b===c as "a"="b===c" 276 String 276 String[] pair = tag.split("\\s*=\\s*",2); 277 277 keyValue[i][0] = pair[0]; 278 278 keyValue[i][1] = pair.length<2 ? "": pair[1]; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/DNSName.java
r8404 r8444 209 209 else if (thisName.endsWith(inName)) { 210 210 int inNdx = thisName.lastIndexOf(inName); 211 if (thisName.charAt(inNdx-1) == '.' 211 if (thisName.charAt(inNdx-1) == '.') 212 212 constraintType = NAME_WIDENS; 213 213 else … … 215 215 } else if (inName.endsWith(thisName)) { 216 216 int ndx = inName.lastIndexOf(thisName); 217 if (inName.charAt(ndx-1) == '.' 217 if (inName.charAt(ndx-1) == '.') 218 218 constraintType = NAME_NARROWS; 219 219 else -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/AddWayHandler.java
r8394 r8444 53 53 @Override 54 54 public String[] getOptionalParams() { 55 return new String[] { "addtags"};55 return new String[] {"addtags"}; 56 56 } 57 57 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
r8193 r8444 39 39 @Override 40 40 public String[] getOptionalParams() { 41 return new String[] { 41 return new String[] {"title", "type", "cookies", "min_zoom", "max_zoom"}; 42 42 } 43 43 … … 139 139 } 140 140 })); 141 return new String[] { 141 return new String[] {"/imagery?title=osm&type=tms&url=https://a.tile.openstreetmap.org/%7Bzoom%7D/%7Bx%7D/%7By%7D.png", 142 142 "/imagery?title=landsat&type=wms&url=http://irs.gis-lab.info/?layers=landsat&SRS=%7Bproj%7D&WIDTH=%7Bwidth%7D&HEIGHT=%7Bheight%7D&BBOX=%7Bbbox%7D", 143 143 "/imagery?title=...&type={"+types+"}&url=....[&cookies=...][&min_zoom=...][&max_zoom=...]"}; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
r8400 r8444 71 71 @Override 72 72 public String[] getUsageExamples() { 73 return new String[] { "/import?url="+Main.getJOSMWebsite()+"/browser/josm/trunk/data_nodist/direction-arrows.osm"};73 return new String[] {"/import?url="+Main.getJOSMWebsite()+"/browser/josm/trunk/data_nodist/direction-arrows.osm"}; 74 74 } 75 75 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r8394 r8444 68 68 @Override 69 69 public String[] getMandatoryParams() { 70 return new String[] { "bottom", "top", "left", "right"};70 return new String[] {"bottom", "top", "left", "right"}; 71 71 } 72 72 -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/VersionHandler.java
r7937 r8444 59 59 @Override 60 60 public String[] getUsageExamples() { 61 return new String[] { 61 return new String[] {"/version", "/version?jsonp=test"}; 62 62 } 63 63 } -
trunk/src/org/openstreetmap/josm/io/session/SessionReader.java
r8404 r8444 531 531 Main.parent, 532 532 title, 533 new String[] { tr("Cancel"), tr("Skip layer and continue")}533 new String[] {tr("Cancel"), tr("Skip layer and continue")} 534 534 ); 535 535 dlg.setButtonIcons(new String[] {"cancel", "dialogs/next"});
Note: See TracChangeset
for help on using the changeset viewer.