Changeset 2787 in osm
- Timestamp:
- 2007-05-06T18:12:25+02:00 (18 years ago)
- Location:
- applications/editors/josm/plugins/mappaint
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java
r2768 r2787 18 18 ElemStyle curStyle; 19 19 ElemStyles styles; 20 String curWidth, curKey, curValue; 20 String curKey, curValue ; 21 int curWidth = 1, curRealWidth = 0; 21 22 int curMinZoom; 22 23 ImageIcon curIcon; … … 78 79 { 79 80 if(atts.getQName(count).equals("width")) 80 curWidth = atts.getValue(count);81 curWidth = Integer.parseInt(atts.getValue(count)); 81 82 else if (atts.getQName(count).equals("colour")) 82 83 curColour=ColorHelper.html2color(atts.getValue(count)); 84 else if (atts.getQName(count).equals("realwidth")) 85 curRealWidth=Integer.parseInt(atts.getValue(count)); 83 86 } 84 87 } … … 137 140 { 138 141 inLine = false; 139 curStyle = new LineElemStyle( Integer.parseInt(curWidth), curColour,142 curStyle = new LineElemStyle(curWidth,curRealWidth, curColour, 140 143 curMinZoom); 144 curWidth=1; 145 curRealWidth = 0; 141 146 } 142 147 else if (inIcon && qName.equals("icon")) -
applications/editors/josm/plugins/mappaint/src/mappaint/LineElemStyle.java
r1501 r2787 5 5 { 6 6 int width; 7 int realWidth = 0; //the real width of this line in meter 7 8 Color colour; 8 9 9 public LineElemStyle (int width, Color colour, int minZoom)10 public LineElemStyle (int width, int realWidth, Color colour, int minZoom) 10 11 { 11 12 this.width = width; 13 this.realWidth = realWidth; 12 14 this.colour = colour; 13 15 this.minZoom = minZoom; … … 17 19 { 18 20 return width; 21 } 22 23 public int getRealWidth() 24 { 25 return realWidth; 19 26 } 20 27 -
applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java
r2768 r2787 64 64 // Altered from SimplePaintVisitor 65 65 @Override public void visit(Way w) { 66 double circum = Main.map.mapView.getScale()*100*Main.proj.scaleFactor()*40041455; // circumference of the earth in meter 66 67 Color colour = getPreferencesColor("untagged",Color.GRAY); 67 int width=2; 68 int width = 2; 69 int realWidth = 0; //the real width of the element in meters 68 70 boolean area=false; 69 71 ElemStyle wayStyle = MapPaintPlugin.elemStyles.getStyle(w); … … 74 76 colour = ((LineElemStyle)wayStyle).getColour(); 75 77 width = ((LineElemStyle)wayStyle).getWidth(); 78 realWidth = ((LineElemStyle)wayStyle).getRealWidth(); 76 79 } 77 80 else if (wayStyle instanceof AreaElemStyle) … … 96 99 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,Main.pref.getBoolean("draw.segment.direction"), width,true); 97 100 else 101 if (realWidth > 0 && Main.pref.getBoolean("mappaint.useRealWith",false)){ 102 int tmpWidth = (int) (100 / (float) (circum / realWidth)); 103 if (tmpWidth > width) width = tmpWidth; 104 } 105 98 106 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,Main.pref.getBoolean("draw.segment.direction"), width,false); 99 107 if (!ls.incomplete && Main.pref.getBoolean("draw.segment.order_number")) … … 217 225 // Shows areas before non-areas 218 226 public void visitAll(DataSet data) { 219 227 220 228 Collection<Way> noAreaWays = new LinkedList<Way>(); 221 229 -
applications/editors/josm/plugins/mappaint/styles/standard/elemstyles.xml
r2768 r2787 3 3 <rule> 4 4 <condition k="highway" v="footway"/> 5 <line width="1" colour="#00ff00" />5 <line width="1" realwidth="1" colour="#00ff00" /> 6 6 </rule> 7 7 … … 18 18 <rule> 19 19 <condition k="highway" v="primary"/> 20 <line width="3" colour="#fb805f"/>20 <line width="3" realwidth="8" colour="#fb805f"/> 21 21 </rule> 22 22 … … 28 28 <rule> 29 29 <condition k="highway" v="secondary"/> 30 <line width="3" colour="#fdbf6f"/>30 <line width="3" realwidth="6" colour="#fdbf6f"/> 31 31 </rule> 32 32 33 33 <rule> 34 34 <condition k="highway" v="motorway"/> 35 <line width="3" colour="#809bc0"/>35 <line width="3" realwidth="8" colour="#809bc0"/> 36 36 </rule> 37 37 … … 48 48 <rule> 49 49 <condition k="highway" v="cycleway"/> 50 <line width="1" colour="#ff00ff"/>50 <line width="1" realwidth="2" colour="#ff00ff"/> 51 51 </rule> 52 52 … … 58 58 <rule> 59 59 <condition k="highway" v="residential"/> 60 <line width="2" colour="#c0c0c0"/>60 <line width="2" realwidth="5" colour="#c0c0c0"/> 61 61 </rule> 62 62 … … 69 69 <rule> 70 70 <condition k="waterway" v="river"/> 71 <line width="2" colour="#0000ff" />71 <line realwidth="10" colour="#0000ff" /> 72 72 </rule> 73 73 … … 79 79 <rule> 80 80 <condition k="waterway" v="riverbank"/> 81 <line wid ht="1" colour="#0000ff"/>81 <line width="1" colour="#0000ff"/> 82 82 </rule> 83 83 … … 188 188 <rule> 189 189 <condition k="landuse" v="cemetery"/> 190 <line wid ht="1" colour="#bde3cb"/>190 <line width="1" colour="#bde3cb"/> 191 191 </rule> 192 192
Note:
See TracChangeset
for help on using the changeset viewer.