Changeset 2787 in osm for applications/editors/josm/plugins/mappaint/src
- Timestamp:
- 2007-05-06T18:12:25+02:00 (18 years ago)
- Location:
- applications/editors/josm/plugins/mappaint/src/mappaint
- Files:
-
- 3 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
Note:
See TracChangeset
for help on using the changeset viewer.