diff options
author | Ben Burwell <ben.burwell@trifecta.com> | 2016-11-20 03:07:14 -0500 |
---|---|---|
committer | Ben Burwell <ben.burwell@trifecta.com> | 2016-11-20 03:07:14 -0500 |
commit | 46f3cb1df2d24180b9bfddf008798cd695554e28 (patch) | |
tree | e44ae61788a05ba941b9502dc33a3dfb63a99f08 /src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java | |
parent | 7411558abf4aba7d600bb9fc713d36032e4a6df3 (diff) |
Implement flexible display modes
Diffstat (limited to 'src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java')
-rw-r--r-- | src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java b/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java index db3e603..0899543 100644 --- a/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java +++ b/src/main/java/com/benburwell/planes/gui/aircraftmap/AircraftMapComponent.java @@ -47,6 +47,23 @@ public class AircraftMapComponent implements Tabbable { this.mapPanel.setCenter(40.6188942, -75.4947205); } + /** + * Handle keyboard shortcuts + * + * Key Function + * === ======== + * h pan west + * j pan south + * k pan north + * l pan east + * + zoom in + * - zoom out + * 0 reset lat/lon to home + * + * n toggle navaids + * v toggle routes + * f toggle airfields + */ private void bindKeys() { KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(e -> { if (e.getKeyCode() == KeyEvent.VK_EQUALS && e.isShiftDown() && e.getID() == KeyEvent.KEY_PRESSED) { @@ -65,9 +82,9 @@ public class AircraftMapComponent implements Tabbable { this.mapPanel.setCenter(40.6188942, -75.4947205); } else if (e.getKeyCode() == KeyEvent.VK_N && e.getID() == KeyEvent.KEY_PRESSED) { this.mapPanel.toggleNavAids(); - } else if (e.getKeyCode() == KeyEvent.VK_A && e.getID() == KeyEvent.KEY_PRESSED) { + } else if (e.getKeyCode() == KeyEvent.VK_F && e.getID() == KeyEvent.KEY_PRESSED) { this.mapPanel.toggleAirports(); - } else if (e.getKeyCode() == KeyEvent.VK_R && e.getID() == KeyEvent.KEY_PRESSED) { + } else if (e.getKeyCode() == KeyEvent.VK_V && e.getID() == KeyEvent.KEY_PRESSED) { this.mapPanel.toggleRoutes(); } return false; |