Changeset 5053 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2012-03-08T10:31:34+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r5050 r5053 12 12 import java.awt.BasicStroke; 13 13 import java.awt.Color; 14 import java.awt.Component;15 14 import java.awt.Cursor; 16 15 import java.awt.Graphics2D; 17 import java.awt.KeyboardFocusManager;18 16 import java.awt.MenuItem; 19 17 import java.awt.Point; … … 39 37 import java.util.Map; 40 38 import java.util.Set; 41 42 39 import java.util.TreeSet; 43 import javax.swing.*; 40 import javax.swing.AbstractAction; 41 import javax.swing.JOptionPane; 42 import javax.swing.JPopupMenu; 43 import javax.swing.Timer; 44 44 45 import org.openstreetmap.josm.Main; 45 46 import org.openstreetmap.josm.actions.JosmAction; … … 222 223 return; 223 224 if (event instanceof KeyEvent) { 224 Component focused = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();225 Component wantedFocus = Main.map.mapView.getParent();226 boolean foundMapViewAncestor=false;227 while (focused!=null) {228 if (focused==wantedFocus) {229 foundMapViewAncestor=true;230 }231 focused = focused.getParent();232 }233 // we accept only events that come from map or toggle dialogs, not from menu and dialogs234 if (!foundMapViewAncestor) return;235 225 processKeyEvent((KeyEvent) event); 236 226 } // toggle angle snapping … … 247 237 private Timer timer; 248 238 void processKeyEvent(KeyEvent e) { 249 if (!snappingShortcut.isEvent(e) && !getShortcut().isEvent(e))239 if (!snappingShortcut.isEvent(e)) 250 240 return; 251 241
Note:
See TracChangeset
for help on using the changeset viewer.