Changeset 2768 in osm for applications/editors/josm/plugins
- Timestamp:
- 2007-05-05T19:38:16+02:00 (18 years ago)
- Location:
- applications/editors/josm/plugins/mappaint
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mappaint/build.xml
r2708 r2768 19 19 20 20 <target name="build" depends="compile"> 21 <copy todir="build/standard /icons">22 <fileset dir="styles/standard /icons"></fileset>21 <copy todir="build/standard"> 22 <fileset dir="styles/standard"></fileset> 23 23 </copy> 24 24 <jar destfile="dist/mappaint.jar" basedir="build"> -
applications/editors/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java
r2711 r2768 104 104 curIcon = new ImageIcon(imageFile); 105 105 } else { 106 URL path = getClass().getResource("/standard/icons/"+atts.getValue(count)); 107 if (path != null ) { 106 URL path = getClass().getResource("/standard/icons/amenity.png"); 108 107 curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path)); 109 } else{110 path = getClass().getResource("/standard/icons/amenity.png");111 curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path));112 }113 108 } 114 109 } else if (atts.getQName(count).equals("annotate")) -
applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintPlugin.java
r2711 r2768 4 4 import java.io.FileReader; 5 5 6 import java.net.URL; 7 import org.openstreetmap.josm.Main; 6 8 import org.openstreetmap.josm.gui.MapFrame; 7 9 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; … … 24 26 25 27 public MapPaintPlugin() { 26 styleDir = getPluginDir()+"standard/"; //some day we will support diferent icon directories over options 28 String styleName = Main.pref.get("mappaint.style", "standard"); 29 styleDir = getPluginDir()+styleName+"/"; //some day we will support diferent icon directories over options 27 30 String elemStylesFile = getStyleDir()+"elemstyles.xml"; 28 31 File f = new File(elemStylesFile); … … 44 47 } 45 48 } 46 else{ //just for backwards compatibility 47 elemStylesFile = getPluginDir()+"elemstyles.xml"; 48 f = new File(elemStylesFile); 49 if (f.exists()) 49 else{ //use the standart elemstyle of this style 50 URL elemStylesPath = getClass().getResource("/"+styleName+"/elemstyles.xml"); 51 if (elemStylesPath != null) 50 52 { 51 53 try … … 57 59 handler.setElemStyles(elemStyles); 58 60 // temporary only! 59 xmlReader.parse(new InputSource( new FileReader(f)));61 xmlReader.parse(new InputSource(elemStylesPath.openStream())); 60 62 } 61 63 catch (Exception e) -
applications/editors/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java
r2708 r2768 91 91 if (area && fillAreas) 92 92 //Draw segments in a different colour so direction arrows show against the fill 93 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : getPreferencesColor("untagged",Color.GRAY),Main.pref.getBoolean("draw.segment.direction"), width );93 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : getPreferencesColor("untagged",Color.GRAY),Main.pref.getBoolean("draw.segment.direction"), width,true); 94 94 else 95 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,Main.pref.getBoolean("draw.segment.direction"), width); 95 if (area) 96 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,Main.pref.getBoolean("draw.segment.direction"), width,true); 97 else 98 drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.YELLOW) : colour,Main.pref.getBoolean("draw.segment.direction"), width,false); 96 99 if (!ls.incomplete && Main.pref.getBoolean("draw.segment.order_number")) 97 100 { … … 158 161 // Altered - now specify width 159 162 @Override protected void drawSegment(Segment ls, Color col,boolean showDirection) { 160 drawSegment(ls,col,showDirection,1 );163 drawSegment(ls,col,showDirection,1,false); 161 164 } 162 165 163 166 164 167 // Altered - now specify width 165 private void drawSegment (Segment ls, Color col,boolean showDirection, int width ) {168 private void drawSegment (Segment ls, Color col,boolean showDirection, int width,boolean dashed) { 166 169 //do not draw already visible segments 167 170 if (ls.shown) return; … … 174 177 g.setColor(col); 175 178 //g.setWidth(width); 176 g2d.setStroke(new BasicStroke(width)); 179 if (dashed) 180 g2d.setStroke(new BasicStroke(width,BasicStroke.CAP_BUTT,BasicStroke.JOIN_ROUND,0,new float[] {9},0)); 181 else 182 g2d.setStroke(new BasicStroke(width)); 183 177 184 Point p1 = nc.getPoint(ls.from.eastNorth); 178 185 Point p2 = nc.getPoint(ls.to.eastNorth); -
applications/editors/josm/plugins/mappaint/styles/standard/elemstyles.xml
r2708 r2768 203 203 <rule> 204 204 <condition k="natural" v="heath"/> 205 <line wid ht="1" colour="#ffffc0"/>205 <line width="1" colour="#ffffc0"/> 206 206 </rule> 207 207
Note:
See TracChangeset
for help on using the changeset viewer.