Changeset 801 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
- Timestamp:
- 2008-08-17T00:26:23+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
r791 r801 9 9 10 10 import org.openstreetmap.josm.tools.ColorHelper; 11 import org.openstreetmap.josm.Main; 11 12 import org.xml.sax.Attributes; 12 13 import org.xml.sax.helpers.DefaultHandler; … … 32 33 } 33 34 34 /* 35 ElemStyles getElemStyles() 36 { 37 return styles; 38 } 39 */ 35 Color convertColor(String colString) 36 { 37 int i = colString.indexOf("#"); 38 String colorString; 39 if(i < 0) // name only 40 colorString = Main.pref.get("color.mappaint."+colString); 41 else if(i == 0) // value only 42 colorString = colString; 43 else // value and name 44 colorString = Main.pref.get("color.mappaint."+colString.substring(0,i), colString.substring(i)); 45 return ColorHelper.html2color(colorString); 46 } 40 47 41 48 @Override public void startDocument() { … … 73 80 curLineWidth = Integer.parseInt(atts.getValue(count)); 74 81 else if (atts.getQName(count).equals("colour")) 75 curLineColour= ColorHelper.html2color(atts.getValue(count));82 curLineColour=convertColor(atts.getValue(count)); 76 83 else if (atts.getQName(count).equals("realwidth")) 77 84 curLineRealWidth=Integer.parseInt(atts.getValue(count)); … … 123 130 { 124 131 if (atts.getQName(count).equals("colour")) 125 curAreaColour= ColorHelper.html2color(atts.getValue(count));132 curAreaColour=convertColor(atts.getValue(count)); 126 133 } 127 134 }
Note:
See TracChangeset
for help on using the changeset viewer.