- Timestamp:
- 2010-03-11T18:34:17+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r3105 r3114 13 13 import java.awt.event.ActionListener; 14 14 import java.awt.event.KeyEvent; 15 import java.awt.event.MouseAdapter; 15 16 import java.awt.event.MouseEvent; 16 17 import java.util.ArrayList; … … 35 36 import javax.swing.ListSelectionModel; 36 37 import javax.swing.SwingConstants; 38 import javax.swing.SwingUtilities; 37 39 import javax.swing.event.ListDataEvent; 38 40 import javax.swing.event.ListDataListener; … … 171 173 172 174 lstPrimitives.addMouseListener(new SelectionPopupMenuLauncher()); 175 lstPrimitives.addMouseListener(new DblClickHandler()); 173 176 } 174 177 … … 198 201 parentButton.add(arrowButton, BorderLayout.EAST); 199 202 return arrowButton; 203 } 204 205 /** 206 * Responds to double clicks on the list of selected objects 207 */ 208 class DblClickHandler extends MouseAdapter { 209 @Override 210 public void mouseClicked(MouseEvent e) { 211 if (e.getClickCount() < 2 || ! SwingUtilities.isLeftMouseButton(e)) return; 212 int idx = lstPrimitives.locationToIndex(e.getPoint()); 213 if (idx < 0) return; 214 OsmDataLayer layer = Main.main.getEditLayer(); 215 if(layer == null) return; 216 layer.data.setSelected(Collections.singleton((OsmPrimitive)model.getElementAt(idx))); 217 } 200 218 } 201 219
Note:
See TracChangeset
for help on using the changeset viewer.