Changeset 8484 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2015-06-11T00:17:21+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPresetType.java
r7937 r8484 10 10 */ 11 11 public enum TaggingPresetType { 12 /** Node */ 12 13 NODE(/* ICON */ "Mf_node", "node"), 14 /** Way */ 13 15 WAY(/* ICON */ "Mf_way", "way"), 16 /** Relation */ 14 17 RELATION(/* ICON */ "Mf_relation", "relation"), 18 /** Closed way */ 15 19 CLOSEDWAY(/* ICON */ "Mf_closedway", "closedway"); 16 20 private final String iconName; … … 18 22 19 23 TaggingPresetType(String iconName, String name) { 20 this.iconName = iconName ;24 this.iconName = iconName + ".svg"; 21 25 this.name = name; 22 26 } 23 27 28 /** 29 * Replies the SVG icon name. 30 * @return the SVG icon name 31 */ 24 32 public String getIconName() { 25 33 return iconName; 26 34 } 27 35 36 /** 37 * Replies the name, as used in XML presets. 38 * @return the name: "node", "way", "relation" or "closedway" 39 */ 28 40 public String getName() { 29 41 return name; 30 42 } 31 43 44 /** 45 * Determines the {@code TaggingPresetType} of a given primitive. 46 * @param p The OSM primitive 47 * @return the {@code TaggingPresetType} of {@code p} 48 */ 32 49 public static TaggingPresetType forPrimitive(OsmPrimitive p) { 33 50 return forPrimitiveType(p.getDisplayType()); 34 51 } 35 52 53 /** 54 * Determines the {@code TaggingPresetType} of a given primitive type. 55 * @param type The OSM primitive type 56 * @return the {@code TaggingPresetType} of {@code type} 57 */ 36 58 public static TaggingPresetType forPrimitiveType(OsmPrimitiveType type) { 37 59 if (type == OsmPrimitiveType.NODE) return NODE; … … 43 65 } 44 66 67 /** 68 * Determines the {@code TaggingPresetType} from a given string. 69 * @param type The OSM primitive type as string ("node", "way", "relation" or "closedway") 70 * @return the {@code TaggingPresetType} from {@code type} 71 */ 45 72 public static TaggingPresetType fromString(String type) { 46 73 for (TaggingPresetType t : TaggingPresetType.values()) { … … 51 78 return null; 52 79 } 53 54 80 }
Note:
See TracChangeset
for help on using the changeset viewer.