- Timestamp:
- 2012-11-18T16:40:44+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/CustomConfigurator.java
r5258 r5590 1028 1028 engine.eval(finish); 1029 1029 1030 @SuppressWarnings("unchecked") 1030 1031 Map<String, String> stringMap = (Map<String, String>) engine.get("stringMap"); 1032 @SuppressWarnings("unchecked") 1031 1033 Map<String, List<String>> listMap = (SortedMap<String, List<String>> ) engine.get("listMap"); 1034 @SuppressWarnings("unchecked") 1032 1035 Map<String, List<Collection<String>>> listlistMap = (SortedMap<String, List<Collection<String>>>) engine.get("listlistMap"); 1036 @SuppressWarnings("unchecked") 1033 1037 Map<String, List<Map<String, String>>> listmapMap = (SortedMap<String, List<Map<String,String>>>) engine.get("listmapMap"); 1034 1038 … … 1050 1054 for (Entry<String, List<Collection<String>>> e : listlistMap.entrySet()) { 1051 1055 if (Preferences.equalArray(e.getValue(), tmpPref.arrayDefaults.get(e.getKey()))) continue; 1052 tmpPref.arrayProperties.put(e.getKey(), (List<List<String>>)(List)e.getValue()); 1056 @SuppressWarnings("unchecked") List<List<String>> value = (List)e.getValue(); 1057 tmpPref.arrayProperties.put(e.getKey(), value); 1053 1058 } 1054 1059 -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r5467 r5590 1799 1799 if (a instanceof StringSetting) 1800 1800 return (a.getValue().equals(b.getValue())); 1801 if (a instanceof ListSetting) 1802 return equalCollection((Collection<String>) a.getValue(), (Collection<String>) b.getValue()); 1803 if (a instanceof ListListSetting) 1804 return equalArray((Collection<Collection<String>>) a.getValue(), (Collection<List<String>>) b.getValue()); 1805 if (a instanceof MapListSetting) 1806 return equalListOfStructs((Collection<Map<String, String>>) a.getValue(), (Collection<Map<String, String>>) b.getValue()); 1801 if (a instanceof ListSetting) { 1802 @SuppressWarnings("unchecked") Collection<String> aValue = (Collection) a.getValue(); 1803 @SuppressWarnings("unchecked") Collection<String> bValue = (Collection) b.getValue(); 1804 return equalCollection(aValue, bValue); 1805 } 1806 if (a instanceof ListListSetting) { 1807 @SuppressWarnings("unchecked") Collection<Collection<String>> aValue = (Collection) a.getValue(); 1808 @SuppressWarnings("unchecked") Collection<List<String>> bValue = (Collection) b.getValue(); 1809 return equalArray(aValue, bValue); 1810 } 1811 if (a instanceof MapListSetting) { 1812 @SuppressWarnings("unchecked") Collection<Map<String, String>> aValue = (Collection) a.getValue(); 1813 @SuppressWarnings("unchecked") Collection<Map<String, String>> bValue = (Collection) b.getValue(); 1814 return equalListOfStructs(aValue, bValue); 1815 } 1807 1816 return a.equals(b); 1808 1817 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r5571 r5590 24 24 import java.awt.geom.Rectangle2D; 25 25 import java.util.ArrayList; 26 import java.util.Arrays;27 26 import java.util.Collection; 28 27 import java.util.Collections; … … 61 60 import org.openstreetmap.josm.gui.mappaint.TextElement; 62 61 import org.openstreetmap.josm.tools.ImageProvider; 63 import org.openstreetmap.josm.tools.Pair;64 62 import org.openstreetmap.josm.tools.Utils; 65 63 … … 1194 1192 1195 1193 while (dist < segmentLength) { 1196 for ( Pair<Float, GeneralPath> sizeAndPath : Arrays.asList(new Pair[]{1197 new Pair<Float, GeneralPath>(3f,onewayArrowsCasing),1198 new Pair<Float,GeneralPath>(2f,onewayArrows)})) {1194 for (int i=0; i<2; ++i) { 1195 float onewaySize = i == 0 ? 3f : 2f; 1196 GeneralPath onewayPath = i == 0 ? onewayArrowsCasing : onewayArrows; 1199 1197 1200 1198 // scale such that border is 1 px 1201 final double fac = - (onewayReversed ? -1 : 1) * sizeAndPath.a* (1 + sinPHI) / (sinPHI * cosPHI);1199 final double fac = - (onewayReversed ? -1 : 1) * onewaySize * (1 + sinPHI) / (sinPHI * cosPHI); 1202 1200 final double sx = nx * fac; 1203 1201 final double sy = ny * fac; … … 1205 1203 // Attach the triangle at the incenter and not at the tip. 1206 1204 // Makes the border even at all sides. 1207 final double x = p1.x + nx * (dist + (onewayReversed ? -1 : 1) * ( sizeAndPath.a/ sinPHI));1208 final double y = p1.y + ny * (dist + (onewayReversed ? -1 : 1) * ( sizeAndPath.a/ sinPHI));1209 1210 sizeAndPath.b.moveTo(x, y);1211 sizeAndPath.b.lineTo (x + cosPHI * sx - sinPHI * sy, y + sinPHI * sx + cosPHI * sy);1212 sizeAndPath.b.lineTo (x + cosPHI * sx + sinPHI * sy, y - sinPHI * sx + cosPHI * sy);1213 sizeAndPath.b.lineTo(x, y);1205 final double x = p1.x + nx * (dist + (onewayReversed ? -1 : 1) * (onewaySize / sinPHI)); 1206 final double y = p1.y + ny * (dist + (onewayReversed ? -1 : 1) * (onewaySize / sinPHI)); 1207 1208 onewayPath.moveTo(x, y); 1209 onewayPath.lineTo (x + cosPHI * sx - sinPHI * sy, y + sinPHI * sx + cosPHI * sy); 1210 onewayPath.lineTo (x + cosPHI * sx + sinPHI * sy, y - sinPHI * sx + cosPHI * sy); 1211 onewayPath.lineTo(x, y); 1214 1212 } 1215 1213 dist += interval; -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r5587 r5590 238 238 * @param row The row of the table from which the value is edited. 239 239 */ 240 @SuppressWarnings("unchecked")241 240 private void editProperty(int row) { 242 241 Collection<OsmPrimitive> sel = Main.main.getCurrentDataSet().getSelected(); … … 269 268 p.add(keys, GBC.eol().fill(GBC.HORIZONTAL)); 270 269 270 @SuppressWarnings("unchecked") 271 271 final Map<String, Integer> m = (Map<String, Integer>) propertyData.getValueAt(row, 1); 272 272 … … 1376 1376 row = propertyTable.getSelectedRow(); 1377 1377 String key = URLEncoder.encode(propertyData.getValueAt(row, 0).toString(), "UTF-8"); 1378 String val = URLEncoder.encode( 1379 ((Map<String,Integer>)propertyData.getValueAt(row, 1)) 1380 .entrySet().iterator().next().getKey(), "UTF-8" 1381 ); 1378 @SuppressWarnings("unchecked") 1379 Map<String, Integer> m = (Map<String, Integer>) propertyData.getValueAt(row, 1); 1380 String val = URLEncoder.encode(m.entrySet().iterator().next().getKey(), "UTF-8"); 1382 1381 1383 1382 uris.add(new URI(String.format("%s%sTag:%s=%s", base, lang, key, val))); -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/AdvancedPreference.java
r5438 r5590 585 585 if (llEditor.getValue() == 1) { 586 586 List<List<String>> data = llEditor.getData(); 587 if (!Preferences.equalArray((Collection) llSetting.getValue(), data)) { 587 @SuppressWarnings("unchecked") 588 Collection<Collection<String>> llSettingValue = (Collection) llSetting.getValue(); 589 if (!Preferences.equalArray(llSettingValue, data)) { 588 590 pe.setValue(new ListListSetting(data)); 589 591 ok = true; … … 645 647 if (llEditor.getValue() == 1) { 646 648 List<List<String>> data = llEditor.getData(); 647 if (!Preferences.equalArray((Collection) stg.getValue(), data)) { 649 @SuppressWarnings("unchecked") 650 Collection<Collection<String>> stgValue = (Collection) stg.getValue(); 651 if (!Preferences.equalArray(stgValue, data)) { 648 652 e.setValue(new ListListSetting(data)); 649 653 applyFilter(); -
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/MapListEditor.java
r4637 r5590 203 203 private List<List<String>> data() { 204 204 if (entryIdx == null) return Collections.emptyList(); 205 return Arrays.asList(dataKeys.get(entryIdx), dataValues.get(entryIdx)); 205 @SuppressWarnings("unchecked") 206 List<List<String>> result = Arrays.asList(dataKeys.get(entryIdx), dataValues.get(entryIdx)); 207 return result; 206 208 } 207 209 -
trunk/src/org/openstreetmap/josm/io/GpxReader.java
r5398 r5590 385 385 GpxLink link = new GpxLink(url); 386 386 link.text = urlname; 387 ((Collection<GpxLink>) attr.get(GpxData.META_LINKS)).add(link); 387 @SuppressWarnings("unchecked") 388 Collection<GpxLink> links = (Collection) attr.get(GpxData.META_LINKS); 389 links.add(link); 388 390 } 389 391 }
Note:
See TracChangeset
for help on using the changeset viewer.