- Timestamp:
- 2008-10-13T11:30:36+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/UserListDialog.java
r1023 r1040 6 6 import java.awt.BorderLayout; 7 7 import java.awt.event.KeyEvent; 8 import java.awt.event.MouseEvent; 9 import java.awt.event.MouseListener; 8 10 import java.util.Arrays; 9 11 import java.util.Collection; 10 12 import java.util.Comparator; 11 13 import java.util.HashMap; 14 import java.util.LinkedList; 12 15 13 16 import javax.swing.JScrollPane; … … 29 32 * @author Frederik Ramm <frederik@remote.org> 30 33 */ 31 public class UserListDialog extends ToggleDialog implements SelectionChangedListener 34 public class UserListDialog extends ToggleDialog implements SelectionChangedListener, MouseListener{ 32 35 33 36 /** … … 55 58 add(new JScrollPane(userTable), BorderLayout.CENTER); 56 59 selectionChanged(Main.ds.getSelected()); 57 60 userTable.addMouseListener(this); 58 61 DataSet.selListeners.add(this); 59 62 } … … 108 111 } 109 112 113 public void mouseClicked(MouseEvent e) { 114 if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount()==2) { 115 int index = userTable.getSelectedRow(); 116 String userName = (String) data.getValueAt(index, 0); 117 if (userName==null) 118 return; 119 Collection<OsmPrimitive> selected = Main.ds.getSelected(); 120 Collection<OsmPrimitive> byUser = new LinkedList<OsmPrimitive>(); 121 for (OsmPrimitive p : selected) { 122 if (p.user!= null && userName.equals(p.user.name)) 123 byUser.add(p); 124 } 125 Main.ds.setSelected(byUser); 126 } 127 } 128 129 public void mouseEntered(MouseEvent e) { 130 } 131 132 public void mouseExited(MouseEvent e) { 133 } 134 135 public void mousePressed(MouseEvent e) { 136 } 137 138 public void mouseReleased(MouseEvent e) { 139 } 140 110 141 }
Note:
See TracChangeset
for help on using the changeset viewer.