Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/modules/graphics/src/main/java/com/sun/javafx/tk/TKStage.java b/modules/graphics/src/main/java/com/sun/javafx/tk/TKStage.java
- --- a/modules/graphics/src/main/java/com/sun/javafx/tk/TKStage.java
- +++ b/modules/graphics/src/main/java/com/sun/javafx/tk/TKStage.java
- @@ -115,6 +115,8 @@
- public void setMaximumSize(int maxWidth, int maxHeight);
- public void setFullScreen(boolean fullScreen);
- +
- + public void setFocusable(boolean isFocusable);
- // =================================================================================================================
- // Functions
- diff --git a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/EmbeddedStage.java b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/EmbeddedStage.java
- --- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/EmbeddedStage.java
- +++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/EmbeddedStage.java
- @@ -176,6 +176,10 @@
- @Override public void ungrabFocus() {
- host.ungrabFocus();
- }
- +
- + @Override public void setFocusable(boolean isFocusable) {
- + throw new UnsupportedOperationException("Not supported yet.");
- + }
- private void notifyStageListener(final Runnable r) {
- AccessControlContext acc = getAccessControlContext();
- diff --git a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
- --- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
- +++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java
- @@ -76,6 +76,7 @@
- private boolean isAppletStage = false; // true if this is an embedded applet window
- private boolean isPopupStage = false;
- private boolean isInFullScreen = false;
- + private boolean isFocusable = true;
- // A flag to indicate whether a call was generated from
- // an input event handler.
- @@ -133,6 +134,7 @@
- final void setIsPopup() {
- isPopupStage = true;
- + isFocusable = false;
- }
- // Called by QuantumToolkit, so we can override initPlatformWindow in subclasses
- @@ -157,14 +159,12 @@
- ownerWindow = ((WindowStage)owner).platformWindow;
- }
- boolean resizable = false;
- - boolean focusable = true;
- int windowMask = rtl ? Window.RIGHT_TO_LEFT : 0;
- if (isPopupStage) { // TODO: make it a stage style?
- windowMask |= Window.POPUP;
- if (style == StageStyle.TRANSPARENT) {
- windowMask |= Window.TRANSPARENT;
- }
- - focusable = false;
- } else {
- switch (style) {
- case UNIFIED:
- @@ -189,7 +189,7 @@
- platformWindow =
- app.createWindow(ownerWindow, Screen.getMainScreen(), windowMask);
- platformWindow.setResizable(resizable);
- - platformWindow.setFocusable(focusable);
- + platformWindow.setFocusable(isFocusable);
- }
- }
- platformWindows.put(platformWindow, this);
- @@ -510,6 +510,13 @@
- setFullScreen(false);
- }
- + @Override public void setFocusable(boolean isFocusable) {
- + this.isFocusable = isFocusable;
- + if (platformWindow != null) {
- + platformWindow.setFocusable(isFocusable);
- + }
- + }
- +
- boolean isApplet() {
- return isPrimaryStage && null != appletWindow;
- }
- diff --git a/modules/graphics/src/main/java/javafx/stage/Window.java b/modules/graphics/src/main/java/javafx/stage/Window.java
- --- a/modules/graphics/src/main/java/javafx/stage/Window.java
- +++ b/modules/graphics/src/main/java/javafx/stage/Window.java
- @@ -418,6 +418,10 @@
- }
- public final boolean isFocused() { return focused.get(); }
- public final ReadOnlyBooleanProperty focusedProperty() { return focused.getReadOnlyProperty(); }
- +
- + public void setFocusable(boolean isFocusable) {
- + return impl_getPeer().setFocusable(isFocusable);
- + }
- /**
- * The {@code Scene} to be rendered on this {@code Stage}. There can only
- diff --git a/modules/graphics/src/test/java/com/sun/javafx/pgstub/StubStage.java b/modules/graphics/src/test/java/com/sun/javafx/pgstub/StubStage.java
- --- a/modules/graphics/src/test/java/com/sun/javafx/pgstub/StubStage.java
- +++ b/modules/graphics/src/test/java/com/sun/javafx/pgstub/StubStage.java
- @@ -191,7 +191,11 @@
- public void setFullScreen(boolean fullScreen) {
- notificationSender.changedFullscreen(fullScreen);
- }
- -
- +
- + @Override
- + public void setFocusable(boolean isFocusable) {
- + }
- +
- @Override
- public void requestFocus() {
- notificationSender.changedFocused(true, FocusCause.ACTIVATED);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement