-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor key-combinations into separate class.
- Loading branch information
Showing
8 changed files
with
129 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/com/github/mfl28/boundingboxeditor/controller/KeyCombinations.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.github.mfl28.boundingboxeditor.controller; | ||
|
||
import javafx.scene.input.KeyCode; | ||
import javafx.scene.input.KeyCodeCombination; | ||
import javafx.scene.input.KeyCombination; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Class containing possible key-combinations. | ||
*/ | ||
public class KeyCombinations { | ||
public static final KeyCombination navigateNext = new KeyCodeCombination(KeyCode.D, | ||
KeyCombination.SHORTCUT_DOWN); | ||
public static final KeyCombination navigatePrevious = new KeyCodeCombination(KeyCode.A, | ||
KeyCombination.SHORTCUT_DOWN); | ||
|
||
public static final List<KeyCode> navigationReleaseKeyCodes = List.of( | ||
KeyCode.A, KeyCode.D); | ||
public static final KeyCombination showAllBoundingShapes = | ||
new KeyCodeCombination(KeyCode.V, KeyCombination.SHORTCUT_DOWN, KeyCombination.ALT_DOWN); | ||
public static final KeyCombination hideAllBoundingShapes = | ||
new KeyCodeCombination(KeyCode.H, KeyCombination.SHORTCUT_DOWN, KeyCombination.ALT_DOWN); | ||
public static final KeyCombination showSelectedBoundingShape = | ||
new KeyCodeCombination(KeyCode.V, KeyCombination.SHORTCUT_DOWN); | ||
public static final KeyCombination hideSelectedBoundingShape = | ||
new KeyCodeCombination(KeyCode.H, KeyCombination.SHORTCUT_DOWN); | ||
|
||
public static final KeyCombination resetSizeAndCenterImage = | ||
new KeyCodeCombination(KeyCode.R, KeyCombination.SHORTCUT_DOWN); | ||
public static final KeyCombination focusCategoryNameTextField = | ||
new KeyCodeCombination(KeyCode.N, KeyCombination.SHORTCUT_DOWN); | ||
public static final KeyCombination focusCategorySearchField = | ||
new KeyCodeCombination(KeyCode.F, KeyCombination.SHORTCUT_DOWN); | ||
public static final KeyCombination focusTagTextField = | ||
new KeyCodeCombination(KeyCode.T, KeyCombination.SHORTCUT_DOWN); | ||
public static final KeyCombination focusFileSearchField = | ||
new KeyCodeCombination(KeyCode.F, KeyCombination.SHORTCUT_DOWN, KeyCombination.ALT_DOWN); | ||
public static final KeyCombination deleteSelectedBoundingShape = new KeyCodeCombination(KeyCode.DELETE); | ||
public static final KeyCombination selectRectangleDrawingMode = | ||
new KeyCodeCombination(KeyCode.DIGIT1, KeyCombination.SHORTCUT_DOWN); | ||
public static final KeyCombination selectPolygonDrawingMode = | ||
new KeyCodeCombination(KeyCode.DIGIT2, KeyCombination.SHORTCUT_DOWN); | ||
public static final KeyCombination selectFreehandDrawingMode = | ||
new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.SHORTCUT_DOWN); | ||
public static final KeyCombination removeEditingVerticesWhenBoundingPolygonSelected = | ||
new KeyCodeCombination(KeyCode.DELETE, KeyCombination.SHIFT_DOWN); | ||
public static final KeyCombination addVerticesToPolygon = | ||
KeyCombination.keyCombination("Shift + Middle-Click inside Polygon"); | ||
public static final KeyCombination changeSelectedBoundingShapeCategory = | ||
new KeyCodeCombination(KeyCode.C, KeyCombination.SHIFT_DOWN); | ||
public static final KeyCombination hideNonSelectedBoundingShapes = | ||
new KeyCodeCombination(KeyCode.H, KeyCombination.SHIFT_DOWN); | ||
|
||
public static final KeyCombination simplifyPolygon = | ||
new KeyCodeCombination(KeyCode.S, KeyCombination.SHIFT_DOWN); | ||
public static final KeyCombination saveBoundingShapeAsImage = | ||
new KeyCodeCombination(KeyCode.I, KeyCombination.SHIFT_DOWN); | ||
|
||
public static final KeyCombination openSettings = | ||
new KeyCodeCombination(KeyCode.COMMA, KeyCombination.SHORTCUT_DOWN); | ||
|
||
private KeyCombinations() { | ||
throw new IllegalStateException("Key Combination Class"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.