Changeset 25546 in osm for applications/editors/josm/plugins
- Timestamp:
- 2011-03-08T19:25:36+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pdfimport/src/pdfimport/FilePlacement.java
r25349 r25546 5 5 import java.awt.geom.AffineTransform; 6 6 import java.awt.geom.Point2D; 7 import java.util.Arrays; 8 import java.util.Collection; 7 9 import java.util.Properties; 8 10 … … 11 13 import org.openstreetmap.josm.data.coor.LatLon; 12 14 import org.openstreetmap.josm.data.projection.Projection; 15 import org.openstreetmap.josm.data.projection.ProjectionSubPrefs; 13 16 import org.openstreetmap.josm.data.projection.Projections; 17 import org.openstreetmap.josm.tools.Utils; 14 18 15 19 public class FilePlacement { … … 42 46 } 43 47 48 private String fromCollection(Collection<String> val) { 49 if (val != null && !val.isEmpty()) 50 return Utils.join("\u001e", val); 51 return null; 52 } 53 54 private Collection<String> toCollection(String s) { 55 if (s != null && s.length() != 0) { 56 return Arrays.asList(s.split("\u001e", -1)); 57 } 58 return null; 59 } 60 44 61 public Properties toProperties() { 45 62 Properties p = new Properties(); 46 63 if (projection != null) { 47 64 p.setProperty("Projection", projection.getClass().getCanonicalName()); 65 66 if (projection instanceof ProjectionSubPrefs) { 67 ProjectionSubPrefs projPrefs = (ProjectionSubPrefs) projection; 68 String code = projection.toCode(); 69 String prefs = fromCollection(projPrefs.getPreferencesFromCode(code)); 70 if (prefs != null) { 71 p.setProperty("ProjectionPrefs", prefs); 72 } 73 } 48 74 } 49 75 … … 70 96 projection = proj; 71 97 break; 98 } 99 } 100 if (projection instanceof ProjectionSubPrefs) { 101 ProjectionSubPrefs projPrefs = (ProjectionSubPrefs) projection; 102 103 String s; 104 s = p.getProperty("ProjectionPrefs", null); 105 Collection<String> prefs = toCollection(s); 106 if (prefs != null) { 107 projPrefs.setPreferences(prefs); 72 108 } 73 109 }
Note:
See TracChangeset
for help on using the changeset viewer.