Changeset 791 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2008-08-16T01:02:24+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/OsmPrimitive.java
r755 r791 121 121 */ 122 122 public static Collection<String> uninteresting = 123 new HashSet<String>(Arrays.asList(new String[] {"source", "note", "c reated_by"}));123 new HashSet<String>(Arrays.asList(new String[] {"source", "note", "converted_by", "created_by"})); 124 124 125 125 /** -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyleHandler.java
r790 r791 87 87 for (int count=0; count<atts.getLength(); count++) { 88 88 if (atts.getQName(count).equals("src")) { 89 String imageFile = MapPaintStyles.getImageDir()+atts.getValue(count); 90 File f = new File(imageFile); 91 if (f.exists()) { 92 //open icon from user directory 93 curIcon = new ImageIcon(imageFile); 94 } else { 95 try { 96 URL path = getClass().getResource(MapPaintStyles.getImageDir()+atts.getValue(count)); 97 if (path == null) { 98 /* icon not found, using default */ 99 System.out.println("Mappaint: Icon " + atts.getValue(count) + " not found, using default icon"); 100 path = getClass().getResource(MapPaintStyles.getImageDir()+"misc/no_icon.png"); 101 curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path)); 102 } else { 103 curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path)); 104 } 89 if(!MapPaintStyles.isInternal()) 90 { 91 String imageFile = MapPaintStyles.getImageDir()+atts.getValue(count); 92 File f = new File(imageFile); 93 if (f.exists()) { 94 //open icon from user directory 95 curIcon = new ImageIcon(imageFile); 96 continue; 105 97 } 106 catch (Exception e){ 107 URL path = getClass().getResource(MapPaintStyles.getImageDir()+"incomming/amenity.png"); 98 } 99 try { 100 URL path = getClass().getResource(MapPaintStyles.getInternalImageDir()+atts.getValue(count)); 101 if (path == null) { 102 /* icon not found, using default */ 103 System.out.println("Mappaint: Icon " + atts.getValue(count) + " not found, using default icon"); 104 path = getClass().getResource(MapPaintStyles.getInternalImageDir()+"misc/no_icon.png"); 105 curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path)); 106 } else { 108 107 curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path)); 109 108 } 109 } 110 catch (Exception e){ 111 URL path = getClass().getResource(MapPaintStyles.getInternalImageDir()+"incomming/amenity.png"); 112 curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path)); 110 113 } 111 114 } else if (atts.getQName(count).equals("annotate")) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
r627 r791 8 8 { 9 9 HashMap<String, ElemStyle> styles; 10 static int nr = 0;10 // static int nr = 0; 11 11 12 12 … … 69 69 } 70 70 } 71 71 /** 72 72 // not a known key/value combination 73 73 boolean first_line = true; … … 103 103 } 104 104 } 105 */ 105 106 } 106 107 107 return null; 108 108 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
r790 r791 16 16 public class MapPaintStyles { 17 17 18 public static String styleDir; 19 public static String imageDir; 18 private static String styleDir; 19 private static String imageDir; 20 private static String internalImageDir; 21 private static Boolean isInternal = false; 20 22 private static HashMap<String, ElemStyle> styles = new HashMap<String, ElemStyle>(); 21 23 … … 25 27 public static String getImageDir(){ 26 28 return imageDir; 29 } 30 public static String getInternalImageDir(){ 31 return internalImageDir; 32 } 33 public static Boolean isInternal(){ 34 return isInternal; 27 35 } 28 36 … … 62 70 if (elemStylesPath != null) 63 71 { 64 imageDir = "/images/styles/standard/"; 72 internalImageDir = "/images/styles/"+styleName+"/"; 73 isInternal = true; 65 74 try 66 75 {
Note:
See TracChangeset
for help on using the changeset viewer.