Changeset 3252 in josm for trunk/src/org/openstreetmap/josm/gui/MapView.java
- Timestamp:
- 2010-05-15T18:59:10+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r3229 r3252 29 29 30 30 import javax.swing.AbstractButton; 31 import javax.swing.JComponent;32 31 import javax.swing.JOptionPane; 32 import javax.swing.JPanel; 33 33 34 34 import org.openstreetmap.josm.Main; 35 35 import org.openstreetmap.josm.actions.AutoScaleAction; 36 import org.openstreetmap.josm.actions.JosmAction;37 36 import org.openstreetmap.josm.actions.MoveAction; 38 37 import org.openstreetmap.josm.actions.mapmode.MapMode; … … 189 188 private Rectangle lastClipBounds = new Rectangle(); 190 189 191 public MapView( ) {190 public MapView(final JPanel contentPane) { 192 191 Main.pref.addPreferenceChangeListener(this); 193 192 addComponentListener(new ComponentAdapter(){ … … 213 212 } 214 213 215 new MapMover(MapView.this, Main.contentPane); 216 JosmAction mv; 217 mv = new MoveAction(MoveAction.Direction.UP); 218 if (mv.getShortcut() != null) { 219 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(mv.getShortcut().getKeyStroke(), "UP"); 220 Main.contentPane.getActionMap().put("UP", mv); 221 } 222 mv = new MoveAction(MoveAction.Direction.DOWN); 223 if (mv.getShortcut() != null) { 224 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(mv.getShortcut().getKeyStroke(), "DOWN"); 225 Main.contentPane.getActionMap().put("DOWN", mv); 226 } 227 mv = new MoveAction(MoveAction.Direction.LEFT); 228 if (mv.getShortcut() != null) { 229 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(mv.getShortcut().getKeyStroke(), "LEFT"); 230 Main.contentPane.getActionMap().put("LEFT", mv); 231 } 232 mv = new MoveAction(MoveAction.Direction.RIGHT); 233 if (mv.getShortcut() != null) { 234 Main.contentPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(mv.getShortcut().getKeyStroke(), "RIGHT"); 235 Main.contentPane.getActionMap().put("RIGHT", mv); 236 } 214 new MapMover(MapView.this, contentPane); 215 new MoveAction(MoveAction.Direction.UP); 216 new MoveAction(MoveAction.Direction.DOWN); 217 new MoveAction(MoveAction.Direction.LEFT); 218 new MoveAction(MoveAction.Direction.RIGHT); 237 219 } 238 220 });
Note:
See TracChangeset
for help on using the changeset viewer.