Changeset 990 in josm
- Timestamp:
- 2008-09-18T16:50:16+02:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r987 r990 134 134 if (tmpWidth > width) width = tmpWidth; 135 135 } 136 if(w.selected) 137 color = selectedColor; 136 138 137 139 Node lastN; … … 146 148 { 147 149 if(lastN != null) 148 drawSeg(lastN, n, s.color != null ? s.color : color, false, s.getWidth(width), s.dashed); 150 { 151 drawSeg(lastN, n, s.color != null && !w.selected ? s.color : color, 152 false, s.getWidth(width), s.dashed); 153 } 149 154 lastN = n; 150 155 } … … 157 162 { 158 163 if(lastN != null) 159 drawSeg(lastN, n, w.selected ? selectedColor :color, showDirection, width, dashed);164 drawSeg(lastN, n, color, showDirection, width, dashed); 160 165 lastN = n; 161 166 } … … 171 176 { 172 177 if(lastN != null) 173 drawSeg(lastN, n, s.color != null ? s.color : color, false, s.getWidth(width), s.dashed); 178 { 179 drawSeg(lastN, n, s.color != null && !w.selected ? s.color : color, 180 false, s.getWidth(width), s.dashed); 181 } 174 182 lastN = n; 175 183 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
r987 r990 51 51 String colorString; 52 52 if(i < 0) // name only 53 colorString = Main.pref.get("color.mappaint."+ colString);53 colorString = Main.pref.get("color.mappaint."+styleName+"."+colString); 54 54 else if(i == 0) // value only 55 55 colorString = colString; 56 56 else // value and name 57 colorString = Main.pref.get("color.mappaint."+ colString.substring(0,i), colString.substring(i));57 colorString = Main.pref.get("color.mappaint."+styleName+"."+colString.substring(0,i), colString.substring(i)); 58 58 return ColorHelper.html2color(colorString); 59 59 } … … 108 108 else if (qName.equals("linemod")) 109 109 { 110 hadLineMod = inLine = true;110 hadLineMod = inLineMod = true; 111 111 for (int count=0; count<atts.getLength(); count++) 112 112 { … … 116 116 if(val.startsWith("+")) 117 117 { 118 rule.line .width = Integer.parseInt(val.substring(1));119 rule.line .widthMode = LineElemStyle.WidthMode.OFFSET;118 rule.linemod.width = Integer.parseInt(val.substring(1)); 119 rule.linemod.widthMode = LineElemStyle.WidthMode.OFFSET; 120 120 } 121 121 else if(val.startsWith("-")) 122 122 { 123 rule.line .width = Integer.parseInt(val);124 rule.line .widthMode = LineElemStyle.WidthMode.OFFSET;123 rule.linemod.width = Integer.parseInt(val); 124 rule.linemod.widthMode = LineElemStyle.WidthMode.OFFSET; 125 125 } 126 126 else if(val.endsWith("%")) 127 127 { 128 rule.line .width = Integer.parseInt(val.substring(0, val.length()-1));129 rule.line .widthMode = LineElemStyle.WidthMode.PERCENT;128 rule.linemod.width = Integer.parseInt(val.substring(0, val.length()-1)); 129 rule.linemod.widthMode = LineElemStyle.WidthMode.PERCENT; 130 130 } 131 131 else 132 rule.line .width = Integer.parseInt(val);132 rule.linemod.width = Integer.parseInt(val); 133 133 } 134 134 else if (atts.getQName(count).equals("colour")) 135 rule.line .color=convertColor(atts.getValue(count));135 rule.linemod.color=convertColor(atts.getValue(count)); 136 136 else if (atts.getQName(count).equals("realwidth")) 137 rule.line .realWidth=Integer.parseInt(atts.getValue(count));137 rule.linemod.realWidth=Integer.parseInt(atts.getValue(count)); 138 138 else if (atts.getQName(count).equals("dashed")) 139 rule.line .dashed=Boolean.parseBoolean(atts.getValue(count));140 else if(atts.getQName(count).equals("priority")) 141 rule.line .priority = Integer.parseInt(atts.getValue(count));139 rule.linemod.dashed=Boolean.parseBoolean(atts.getValue(count)); 140 else if(atts.getQName(count).equals("priority")) 141 rule.linemod.priority = Integer.parseInt(atts.getValue(count)); 142 142 else if(atts.getQName(count).equals("mode")) 143 rule.line .over = !atts.getValue(count).equals("under");143 rule.linemod.over = !atts.getValue(count).equals("under"); 144 144 } 145 145 } … … 180 180 if(hadLineMod) 181 181 styles.addModifier(styleName, rule.key, rule.value, rule.boolValue, 182 new LineElemStyle(rule.line , rule.scaleMax, rule.scaleMin));182 new LineElemStyle(rule.linemod, rule.scaleMax, rule.scaleMin)); 183 183 if(hadIcon) 184 184 styles.add(styleName, rule.key, rule.value, rule.boolValue, … … 195 195 else if (inLine && qName.equals("line")) 196 196 inLine = false; 197 else if (inLineMod && qName.equals("linemod")) 198 inLineMod = false; 197 199 else if (inIcon && qName.equals("icon")) 198 200 inIcon = false; -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r987 r990 117 117 AreaElemStyle retArea = null; 118 118 LineElemStyle retLine = null; 119 List<LineElemStyle> over = new LinkedList<LineElemStyle>(); 119 String linestring = null; 120 HashMap<String, LineElemStyle> over = new HashMap<String, LineElemStyle>(); 120 121 Iterator<String> iterator = w.keys.keySet().iterator(); 121 122 while(iterator.hasNext()) … … 129 130 retArea = styleArea; 130 131 if((styleLine = ss.lines.get(idx)) != null && (retLine == null || styleLine.priority > retLine.priority)) 132 { 131 133 retLine = styleLine; 134 linestring = idx; 135 } 132 136 if((styleLine = ss.modifiers.get(idx)) != null) 133 over. add(styleLine);137 over.put(idx, styleLine); 134 138 idx = "b" + key + "=" + OsmUtils.getNamedOsmBoolean(val); 135 139 if((styleArea = ss.areas.get(idx)) != null && (retArea == null || styleArea.priority > retArea.priority)) 136 140 retArea = styleArea; 137 141 if((styleLine = ss.lines.get(idx)) != null && (retLine == null || styleLine.priority > retLine.priority)) 142 { 138 143 retLine = styleLine; 144 linestring = idx; 145 } 139 146 if((styleLine = ss.modifiers.get(idx)) != null) 140 over. add(styleLine);147 over.put(idx, styleLine); 141 148 idx = "x" + key; 142 149 if((styleArea = ss.areas.get(idx)) != null && (retArea == null || styleArea.priority > retArea.priority)) 143 150 retArea = styleArea; 144 151 if((styleLine = ss.lines.get(idx)) != null && (retLine == null || styleLine.priority > retLine.priority)) 152 { 145 153 retLine = styleLine; 154 linestring = idx; 155 } 146 156 if((styleLine = ss.modifiers.get(idx)) != null) 147 over. add(styleLine);157 over.put(idx, styleLine); 148 158 } 159 over.remove(linestring); 149 160 if(over.size() != 0 && retLine != null) 150 161 { 151 Collections.sort(over); 152 retLine = new LineElemStyle(retLine, over); 162 List<LineElemStyle> s = new LinkedList<LineElemStyle>(over.values()); 163 Collections.sort(s); 164 retLine = new LineElemStyle(retLine, s); 153 165 } 154 166 if(retArea != null) -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r885 r990 2 2 3 3 import java.awt.Color; 4 import java.util.LinkedList; 5 import java.util.List; 4 import java.util.Collection; 6 5 7 6 public class LineElemStyle extends ElemStyle implements Comparable<LineElemStyle> … … 16 15 public WidthMode widthMode; 17 16 18 public List<LineElemStyle> overlays;17 public Collection<LineElemStyle> overlays; 19 18 20 19 public LineElemStyle(LineElemStyle s, long maxScale, long minScale) { … … 31 30 } 32 31 33 public LineElemStyle(LineElemStyle s, List<LineElemStyle> overlays) {32 public LineElemStyle(LineElemStyle s, Collection<LineElemStyle> overlays) { 34 33 this.width = s.width; 35 34 this.realWidth = s.realWidth;
Note:
See TracChangeset
for help on using the changeset viewer.