Changeset 13171 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
- Timestamp:
- 2017-11-27T20:19:15+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r13130 r13171 10 10 import java.awt.FlowLayout; 11 11 import java.awt.event.ActionEvent; 12 import java.awt.event.MouseAdapter; 13 import java.awt.event.MouseEvent; 12 14 import java.io.IOException; 13 15 import java.net.HttpURLConnection; … … 66 68 private transient OsmDataLayer layer; 67 69 70 /** the editAction used in the bottom panel and for doubleClick */ 71 private EditAction editAction; 72 68 73 /** 69 74 * Replies the {@link OsmDataLayer} this editor is related to … … 85 90 86 91 add(buildButtonPanel(), BorderLayout.SOUTH); 92 childTree.setToggleClickCount(0); 93 childTree.addMouseListener(new MouseAdapter() { 94 @Override 95 public void mouseClicked(MouseEvent e) { 96 if (e.getClickCount() == 2 97 && !e.isAltDown() && !e.isAltGraphDown() && !e.isControlDown() && !e.isMetaDown() && !e.isShiftDown() 98 && childTree.getRowForLocation(e.getX(), e.getY()) == childTree.getMinSelectionRow()) { 99 Relation r = (Relation) childTree.getLastSelectedPathComponent(); 100 if (r.isIncomplete()) { 101 childTree.expandPath(childTree.getSelectionPath()); 102 } else { 103 editAction.actionPerformed(new ActionEvent(e.getSource(), ActionEvent.ACTION_PERFORMED, null)); 104 } 105 } 106 } 107 }); 87 108 } 88 109 … … 105 126 106 127 // --- 107 EditActioneditAction = new EditAction();128 editAction = new EditAction(); 108 129 childTree.addTreeSelectionListener(editAction); 109 130 pnl.add(new JButton(editAction));
Note:
See TracChangeset
for help on using the changeset viewer.
