Changeset 5590 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2012-11-18T16:40:44+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 3 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;
Note:
See TracChangeset
for help on using the changeset viewer.