Changeset 1439 in josm
- Timestamp:
- 2009-02-24T18:23:53+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/Preferences.java
r1424 r1439 479 479 synchronized public Collection<String> getCollection(String key, Collection<String> def) { 480 480 String s = get(key); 481 if(def != null) 482 { 483 String d = null; 484 for(String a : def) 485 { 486 if(d != null) 487 d += ";" + a; 488 else 489 d = a; 490 } 491 putDefault(key, d); 492 } 481 493 if(s != null && s.length() != 0) 482 494 return Arrays.asList(s.split(";")); -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r1200 r1439 4 4 import static org.openstreetmap.josm.tools.I18n.trn; 5 5 6 import java.util.Arrays; 6 7 import java.util.ArrayList; 8 import java.util.Collection; 7 9 import java.util.List; 8 10 9 11 import org.openstreetmap.josm.data.osm.visitor.Visitor; 12 import org.openstreetmap.josm.Main; 10 13 11 14 /** … … 21 24 */ 22 25 public final List<RelationMember> members = new ArrayList<RelationMember>(); 26 27 final static String[] defnames = {"name", "ref", "restriction", "note"}; 28 static Collection<String> names = null; 23 29 24 30 @Override public void visit(Visitor visitor) { … … 82 88 83 89 name += " ("; 84 String nameTag = get("name"); 85 if (nameTag == null) nameTag = get("ref"); 86 if (nameTag == null) nameTag = get("note"); 87 if (nameTag != null) name += "\"" + nameTag + "\", "; 90 if(names == null) 91 names = Main.pref.getCollection("relation.nameOrder", Arrays.asList(defnames)); 92 String nameTag = null; 93 for (String n : names) { 94 nameTag = get(n); 95 if (nameTag != null) break; 96 } 97 if (nameTag != null) 98 name += "\"" + nameTag + "\", "; 99 88 100 int mbno = members.size(); 89 101 name += trn("{0} member", "{0} members", mbno, mbno) + ")"; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1423 r1439 16 16 import java.awt.Stroke; 17 17 import java.awt.geom.GeneralPath; 18 import java.util.Arrays; 18 19 import java.util.ArrayList; 19 20 import java.util.Collection; … … 64 65 protected double circum; 65 66 protected double dist; 66 protected String regionalNameOrder[];67 protected Collection<String> regionalNameOrder; 67 68 protected Boolean selectedCall; 68 69 protected Boolean useStyleCache; … … 1094 1095 String name = null; 1095 1096 if (n.keys != null) { 1096 for ( int i = 0; i < regionalNameOrder.length; i++) {1097 name = n.keys.get(r egionalNameOrder[i]);1097 for (String rn : regionalNameOrder) { 1098 name = n.keys.get(rn); 1098 1099 if (name != null) break; 1099 1100 } … … 1244 1245 leftHandTraffic = Main.pref.getBoolean("mappaint.lefthandtraffic",false); 1245 1246 orderFont = new Font(Main.pref.get("mappaint.font","Helvetica"), Font.PLAIN, Main.pref.getInteger("mappaint.fontsize", 8)); 1246 String currentLocale = Locale.getDefault().getLanguage();1247 regionalNameOrder = Main.pref.get ("mappaint.nameOrder", "name:"+currentLocale+";name;int_name;ref;operator;brand").split(";");1247 String[] names = {"name:"+Main.getLanguageCode(), "name", "int_name", "ref", "operator", "brand"}; 1248 regionalNameOrder = Main.pref.getCollection("mappaint.nameOrder", Arrays.asList(names)); 1248 1249 minEN = nc.getEastNorth(0,nc.getHeight()-1); 1249 1250 maxEN = nc.getEastNorth(nc.getWidth()-1,0);
Note:
See TracChangeset
for help on using the changeset viewer.