Changeset 4536 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2011-10-21T23:57:52+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r4475 r4536 30 30 import javax.swing.event.ListSelectionEvent; 31 31 import javax.swing.event.ListSelectionListener; 32 import javax.swing.event.PopupMenuListener; 32 33 33 34 import org.openstreetmap.josm.Main; … … 808 809 } 809 810 811 public void addPopupMenuListener(PopupMenuListener l) { 812 popupMenu.addPopupMenuListener(l); 813 } 814 815 public void removePopupMenuListener(PopupMenuListener l) { 816 popupMenu.addPopupMenuListener(l); 817 } 818 819 public Collection<Relation> getSelectedRelations() { 820 return model.getSelectedRelations(); 821 } 822 810 823 /* ---------------------------------------------------------------------------------- */ 811 824 /* DataSetListener */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r4462 r4536 35 35 import javax.swing.event.ListSelectionEvent; 36 36 import javax.swing.event.ListSelectionListener; 37 import javax.swing.event.PopupMenuListener; 37 38 38 39 import org.openstreetmap.josm.Main; … … 224 225 return popupMenu.add(a); 225 226 } 226 227 228 public void addPopupMenuListener(PopupMenuListener l) { 229 popupMenu.addPopupMenuListener(l); 230 } 231 232 public void removePopupMenuListener(PopupMenuListener l) { 233 popupMenu.addPopupMenuListener(l); 234 } 235 236 public Collection<OsmPrimitive> getSelectedPrimitives() { 237 return model.getSelected(); 238 } 239 227 240 /** 228 241 * Updates the dialog title with a summary of the current JOSM selection -
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r4526 r4536 58 58 import javax.swing.event.ListSelectionEvent; 59 59 import javax.swing.event.ListSelectionListener; 60 import javax.swing.event.PopupMenuListener; 60 61 import javax.swing.table.DefaultTableCellRenderer; 61 62 import javax.swing.table.DefaultTableModel; … … 71 72 import org.openstreetmap.josm.command.SequenceCommand; 72 73 import org.openstreetmap.josm.data.SelectionChangedListener; 74 import org.openstreetmap.josm.data.osm.IRelation; 73 75 import org.openstreetmap.josm.data.osm.Node; 74 76 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 1256 1258 } 1257 1259 1260 public void addPropertyPopupMenuListener(PopupMenuListener l) { 1261 propertyMenu.addPopupMenuListener(l); 1262 } 1263 1264 public void removePropertyPopupMenuListener(PopupMenuListener l) { 1265 propertyMenu.addPopupMenuListener(l); 1266 } 1267 1268 @SuppressWarnings("unchecked") 1269 public Tag getSelectedProperty() { 1270 int row = propertyTable.getSelectedRow(); 1271 if (row == -1) return null; 1272 TreeMap<String, Integer> map = (TreeMap<String, Integer>) propertyData.getValueAt(row, 1); 1273 return new Tag( 1274 propertyData.getValueAt(row, 0).toString(), 1275 map.size() > 1 ? "" : map.keySet().iterator().next()); 1276 } 1277 1258 1278 public void addMembershipPopupMenuSeparator() { 1259 1279 membershipMenu.addSeparator(); 1260 1280 } 1261 1281 1262 1282 public JMenuItem addMembershipPopupMenuAction(Action a) { 1263 1283 return membershipMenu.add(a); 1264 1284 } 1265 1285 1286 public void addMembershipPopupMenuListener(PopupMenuListener l) { 1287 membershipMenu.addPopupMenuListener(l); 1288 } 1289 1290 public void removeMembershipPopupMenuListener(PopupMenuListener l) { 1291 membershipMenu.addPopupMenuListener(l); 1292 } 1293 1294 public IRelation getSelectedMembershipRelation() { 1295 int row = membershipTable.getSelectedRow(); 1296 return row > -1 ? (IRelation) membershipData.getValueAt(row, 0) : null; 1297 } 1298 1266 1299 public static interface RelationRelated { 1267 1300 public Relation getRelation();
Note:
See TracChangeset
for help on using the changeset viewer.