Changeset 5453 in josm for trunk/src/org
- Timestamp:
- 2012-08-18T21:10:08+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitiveTypesComboBox.java
r5450 r5453 5 5 6 6 /** 7 * A Combo box containing OSM primitive types (Node, Way, Relation). 7 8 * @author Matthias Julius 9 * @see OsmPrimitiveType#dataValues 10 * @since 2923 8 11 */ 9 12 public class OsmPrimitiveTypesComboBox extends JosmComboBox { 10 13 14 /** 15 * Constructs a new {@code OsmPrimitiveTypesComboBox}. 16 */ 11 17 public OsmPrimitiveTypesComboBox() { 12 super(OsmPrimitiveType.dataValues() );18 super(OsmPrimitiveType.dataValues().toArray()); 13 19 } 14 20 21 /** 22 * Replies the currently selected {@code OsmPrimitiveType}. 23 * @return the currently selected {@code OsmPrimitiveType}. 24 */ 15 25 public OsmPrimitiveType getType() { 16 try { 17 return (OsmPrimitiveType)this.getSelectedItem(); 18 } catch (Exception e) { 19 return null; 20 } 26 Object selectedItem = this.getSelectedItem(); 27 return selectedItem instanceof OsmPrimitiveType ? (OsmPrimitiveType) selectedItem : null; 21 28 } 22 29 }
Note:
See TracChangeset
for help on using the changeset viewer.