- Timestamp:
- 2009-01-11T12:00:48+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
r1222 r1241 73 73 if (qName.equals("rule")) 74 74 inRule=true; 75 else if (qName.equals("rules")) 76 { 77 if(styleName == null) 78 { 79 String n = atts.getValue("name"); 80 if(n == null) n = "standard"; 81 styleName = n; 82 } 83 } 75 84 else if (qName.equals("scale_max")) 76 85 inScaleMax = true; -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r1233 r1241 50 50 public static void readFromPreferences() { 51 51 String[] a = null; 52 52 53 53 /* don't prefix icon path, as it should be generic */ 54 54 String internalicon = "resource://images/styles/standard/;resource://images/styles/"; 55 String internalfile = " standard=resource://styles/standard/elemstyles.xml";55 String internalfile = "resource://styles/standard/elemstyles.xml"; 56 56 57 57 iconDirs = Main.pref.get("mappaint.icon.sources"); … … 70 70 a = fileset.split("=", 2); 71 71 else 72 a = new String[] { "standard", fileset};72 a = new String[] {null, fileset}; 73 73 XMLReader xmlReader = XMLReaderFactory.createXMLReader(); 74 74 ElemStyleHandler handler = new ElemStyleHandler(a[0]); -
trunk/src/org/openstreetmap/josm/gui/preferences/ColorPreference.java
r1221 r1241 11 11 import java.awt.event.ActionEvent; 12 12 import java.awt.event.ActionListener; 13 import java.util.regex.Matcher; 14 import java.util.regex.Pattern; 13 15 import java.util.ArrayList; 14 16 import java.util.Collections; … … 67 69 // fill model with colors: 68 70 List<String> colorKeyList = new ArrayList<String>(); 71 List<String> colorKeyList_mappaint = new ArrayList<String>(); 69 72 for(String key : colorMap.keySet()) { 70 colorKeyList.add(key); 73 if(key.startsWith("mappaint.")) 74 colorKeyList_mappaint.add(key); 75 else 76 colorKeyList.add(key); 71 77 } 72 78 Collections.sort(colorKeyList); 79 Collections.sort(colorKeyList_mappaint); 80 colorKeyList.addAll(colorKeyList_mappaint); 73 81 for (String key : colorKeyList) { 74 82 Vector<Object> row = new Vector<Object>(2); … … 117 125 return l; 118 126 } 119 return oldColorsRenderer.getTableCellRendererComponent(t,tr(o.toString()),selected,focus,row,column); 127 return oldColorsRenderer.getTableCellRendererComponent(t,getName(o.toString()),selected,focus,row,column); 128 } 129 private String getName(String o) 130 { 131 try 132 { 133 Matcher m = Pattern.compile("mappaint\\.(.+?)\\.(.+)").matcher(o); 134 m.matches(); 135 return tr("Paint style {0}: {1}", m.group(1), m.group(2)); 136 } 137 catch (Exception e) {} 138 return tr(o); 120 139 } 121 140 });
Note:
See TracChangeset
for help on using the changeset viewer.