- Timestamp:
- 2016-12-12T17:29:27+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java
r11288 r11383 235 235 switch (mode) { 236 236 case "problem": 237 return modeProblem(v); 237 return modeProblem((ValidatorBoundingXYVisitor) v); 238 238 case "data": 239 239 return modeData(v); … … 250 250 } 251 251 252 private static BoundingXYVisitor modeProblem(BoundingXYVisitor v) { 252 private static BoundingXYVisitor modeProblem(ValidatorBoundingXYVisitor v) { 253 253 TestError error = Main.map.validatorDialog.getSelectedError(); 254 254 if (error == null) 255 255 return null; 256 ((ValidatorBoundingXYVisitor) v).visit(error);256 v.visit(error); 257 257 if (v.getBounds() == null) 258 258 return null; -
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r11292 r11383 238 238 @Override 239 239 public void cloneFrom(OsmPrimitive osm) { 240 if (!(osm instanceof Node)) 241 throw new IllegalArgumentException("Not a node: " + osm); 240 242 boolean locked = writeLock(); 241 243 try { … … 260 262 @Override 261 263 public void mergeFrom(OsmPrimitive other) { 264 if (!(other instanceof Node)) 265 throw new IllegalArgumentException("Not a node: " + other); 262 266 boolean locked = writeLock(); 263 267 try { … … 271 275 } 272 276 273 @Override public void load(PrimitiveData data) { 277 @Override 278 public void load(PrimitiveData data) { 279 if (!(data instanceof NodeData)) 280 throw new IllegalArgumentException("Not a node data: " + data); 274 281 boolean locked = writeLock(); 275 282 try { … … 281 288 } 282 289 283 @Override public NodeData save() { 290 @Override 291 public NodeData save() { 284 292 NodeData data = new NodeData(); 285 293 saveCommonAttributes(data); -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r11373 r11383 1088 1088 * 1089 1089 * Both this and other must be new, or both must be assigned an OSM ID. If both this and <code>other</code> 1090 * have an assig end OSM id, the IDs have to be the same.1090 * have an assigned OSM id, the IDs have to be the same. 1091 1091 * 1092 1092 * @param other the other primitive. Must not be null. -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r11316 r11383 240 240 @Override 241 241 public void cloneFrom(OsmPrimitive osm) { 242 if (!(osm instanceof Relation)) 243 throw new IllegalArgumentException("Not a relation: " + osm); 242 244 boolean locked = writeLock(); 243 245 try { … … 252 254 @Override 253 255 public void load(PrimitiveData data) { 256 if (!(data instanceof RelationData)) 257 throw new IllegalArgumentException("Not a relation data: " + data); 254 258 boolean locked = writeLock(); 255 259 try { … … 271 275 } 272 276 273 @Override public RelationData save() { 277 @Override 278 public RelationData save() { 274 279 RelationData data = new RelationData(); 275 280 saveCommonAttributes(data); -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r11292 r11383 277 277 @Override 278 278 public void load(PrimitiveData data) { 279 if (!(data instanceof WayData)) 280 throw new IllegalArgumentException("Not a way data: " + data); 279 281 boolean locked = writeLock(); 280 282 try { … … 314 316 @Override 315 317 public void cloneFrom(OsmPrimitive osm) { 318 if (!(osm instanceof Way)) 319 throw new IllegalArgumentException("Not a way: " + osm); 316 320 boolean locked = writeLock(); 317 321 try { … … 326 330 @Override 327 331 public String toString() { 328 String nodesDesc = isIncomplete() ? "(incomplete)" : "nodes=" + Arrays.toString(nodes); 332 String nodesDesc = isIncomplete() ? "(incomplete)" : ("nodes=" + Arrays.toString(nodes)); 329 333 return "{Way id=" + getUniqueId() + " version=" + getVersion()+ ' ' + getFlagsAsString() + ' ' + nodesDesc + '}'; 330 334 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/UntaggedNode.java
r11129 r11383 54 54 } 55 55 56 private static OsmPrimitive[] castPrim(AbstractPrimitive n) { 57 return n instanceof OsmPrimitive ? (new OsmPrimitive[]{(OsmPrimitive) n}) : (new OsmPrimitive[0]); 58 } 59 56 60 @Override 57 61 public void visitKeyValue(AbstractPrimitive n, String key, String value) { … … 60 64 errors.add(TestError.builder(this, Severity.WARNING, UNTAGGED_NODE_FIXME) 61 65 .message(ERROR_MESSAGE, marktr("Has tag containing ''fixme'' or ''FIXME''")) 62 .primitives( (OsmPrimitive) n)66 .primitives(castPrim(n)) 63 67 .build()); 64 68 return; … … 87 91 errors.add(TestError.builder(this, Severity.WARNING, code) 88 92 .message(ERROR_MESSAGE, msg) 89 .primitives( (OsmPrimitive) n)93 .primitives(castPrim(n)) 90 94 .build()); 91 95 return; … … 94 98 errors.add(TestError.builder(this, Severity.WARNING, UNTAGGED_NODE_OTHER) 95 99 .message(ERROR_MESSAGE, marktr("Other")) 96 .primitives( (OsmPrimitive) n)100 .primitives(castPrim(n)) 97 101 .build()); 98 102 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r10627 r11383 943 943 @Override 944 944 public void eventDispatched(AWTEvent event) { 945 if (isShowing() && !isCollapsed && isDocked && buttonHiding == ButtonHidingType.DYNAMIC) { 946 if (buttonsPanel != null) { 947 Rectangle b = this.getBounds(); 948 b.setLocation(getLocationOnScreen()); 949 if (b.contains(((MouseEvent) event).getLocationOnScreen())) { 950 if (!buttonsPanel.isVisible()) { 951 buttonsPanel.setVisible(true); 952 } 953 } else if (buttonsPanel.isVisible()) { 954 buttonsPanel.setVisible(false); 955 } 945 if (event instanceof MouseEvent && isShowing() && !isCollapsed && isDocked && buttonHiding == ButtonHidingType.DYNAMIC 946 && buttonsPanel != null) { 947 Rectangle b = this.getBounds(); 948 b.setLocation(getLocationOnScreen()); 949 if (b.contains(((MouseEvent) event).getLocationOnScreen())) { 950 if (!buttonsPanel.isVisible()) { 951 buttonsPanel.setVisible(true); 952 } 953 } else if (buttonsPanel.isVisible()) { 954 buttonsPanel.setVisible(false); 956 955 } 957 956 } -
trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java
r10959 r11383 280 280 @Override 281 281 public void mergeFrom(Layer from) { 282 if (!(from instanceof GpxLayer)) 283 throw new IllegalArgumentException("not a GpxLayer: " + from); 282 284 data.mergeFrom(((GpxLayer) from).data); 283 285 drawHelper.dataChanged(); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r10763 r11383 401 401 @Override 402 402 public void mergeFrom(Layer from) { 403 if (!(from instanceof GeoImageLayer)) 404 throw new IllegalArgumentException("not a GeoImageLayer: " + from); 403 405 GeoImageLayer l = (GeoImageLayer) from; 404 406 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r11374 r11383 622 622 matchingRuleIndex = wayRules; 623 623 } 624 } else { 624 } else if (osm instanceof Relation) { 625 625 if (((Relation) osm).isMultipolygon()) { 626 626 matchingRuleIndex = multipolygonRules; … … 630 630 matchingRuleIndex = relationRules; 631 631 } 632 } 633 634 // the declaration indices are sorted, so it suffices to save the 635 // last used index 632 } else { 633 throw new IllegalArgumentException("Unsupported type: " + osm); 634 } 635 636 // the declaration indices are sorted, so it suffices to save the last used index 636 637 int lastDeclUsed = -1; 637 638
Note:
See TracChangeset
for help on using the changeset viewer.