Skip to content

Commit 22db96e

Browse files
authored
Merge pull request #74 from petebankhead/closing
Reinstate close methods taking Stage parameter
2 parents 824353c + 6d11667 commit 22db96e

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.4.1
2+
- Reinstate (but deprecate) previous methods to add close shortcuts to stages (https://github.com/qupath/qupath-fxtras/issues/73)
3+
14
## v0.4.0
25
- Use Java and JavaFX 21
36
- Improved `InputDisplay` javadocs, new property to reverse scrolling (https://github.com/qupath/qupath-fxtras/pull/70)

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66

77
base {
88
group = "io.github.qupath"
9-
version = "0.4.0"
9+
version = "0.4.1"
1010
description = "Extra classes built on JavaFX that are used to help create the QuPath user interface. " +
1111
"These don't depend on other QuPath modules, so can be reused elsewhere."
1212
}

src/main/java/qupath/fx/utils/FXUtils.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,11 +612,33 @@ public static void simplifyTitledPane(TitledPane pane, boolean boldTitle) {
612612
}
613613
}
614614

615+
/**
616+
* Add shortcuts to close a stage using the standard shortcuts (Shortcut+W, Esc).
617+
* @param stage
618+
* @deprecated use {@link #addCloseWindowShortcuts(Window)}
619+
*/
620+
@Deprecated
621+
public static void addCloseWindowShortcuts(Stage stage) {
622+
addCloseWindowShortcuts((Window)stage);
623+
}
624+
625+
/**
626+
* Add shortcuts to close a stage using the specified key combinations.
627+
* @param stage
628+
* @param keyCombinations
629+
* @deprecated use {@link #addCloseWindowShortcuts(Window, Collection)}
630+
*/
631+
@Deprecated
632+
public static void addCloseWindowShortcuts(Stage stage, Collection<? extends KeyCombination> keyCombinations) {
633+
addCloseWindowShortcuts((Window)stage, keyCombinations);
634+
}
635+
615636

616637
/**
617638
* Add shortcuts to close a window using the standard shortcuts (Shortcut+W, Esc).
618639
* @param window
619640
* @see #addCloseWindowShortcuts(Window, Collection)
641+
* @since v0.4.0
620642
*/
621643
public static void addCloseWindowShortcuts(Window window) {
622644
addCloseWindowShortcuts(window, Arrays.asList(
@@ -632,6 +654,7 @@ public static void addCloseWindowShortcuts(Window window) {
632654
* @param keyCombinations
633655
* @see #addCloseWindowShortcuts(Window)
634656
* @implSpec this only fires a window close request; any handler may still choose to consume the event quietly
657+
* @since v0.4.0
635658
*/
636659
public static void addCloseWindowShortcuts(Window window, Collection<? extends KeyCombination> keyCombinations) {
637660
if (keyCombinations.isEmpty()) {

0 commit comments

Comments
 (0)