changeset 5255:f7b87969cd45

RT-32249 fixing Full Screen overly hint Summary: Changing full screen overlay hint when the default exit key has been changed Reviewed-by: kcr, bair
author David Hill <David.Hill@oracle.com>
date Thu, 03 Oct 2013 13:02:17 -0400
parents da16b3edc363
children 8b1a40fed5c8
files modules/graphics/src/main/java/com/sun/javafx/tk/quantum/OverlayWarning.java modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java modules/graphics/src/main/java/javafx/stage/Stage.java modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_de.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_es.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_fr.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_it.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_ja.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_ko.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_pt_BR.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_sv.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_zh_CN.properties modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_zh_TW.properties
diffstat 14 files changed, 44 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/OverlayWarning.java	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/OverlayWarning.java	Thu Oct 03 13:02:17 2013 -0400
@@ -45,16 +45,6 @@
 import java.util.ResourceBundle;
 
 public class OverlayWarning {
-    
-    private static final Locale LOCALE = Locale.getDefault();
-    
-    private static final ResourceBundle RESOURCES =
-        ResourceBundle.getBundle(OverlayWarning.class.getPackage().getName() +
-                                 ".QuantumMessagesBundle", LOCALE);
-    
-    public static String localize(String msg) {
-        return RESOURCES.getString(msg);
-    }
 
     private static final float  PAD      = 40f;
     private static final float  RECTW    = 600f;
@@ -128,9 +118,7 @@
    }
     
     protected void warn(String msg) {
-        text.setText(msg == null
-                ? localize("OverlayWarningESC")
-                : msg);
+        text.setText(msg);
         // needed to force the text to update...
         text.impl_updatePeer();
         
--- a/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/java/com/sun/javafx/tk/quantum/WindowStage.java	Thu Oct 03 13:02:17 2013 -0400
@@ -57,6 +57,8 @@
 import com.sun.prism.PixelFormat;
 import com.sun.javafx.accessible.providers.AccessibleProvider;
 import com.sun.javafx.accessible.providers.AccessibleStageProvider;
+import java.util.Locale;
+import java.util.ResourceBundle;
 
 class WindowStage extends GlassStage {
 
@@ -96,6 +98,13 @@
         return appletWindow;
     }
 
+    private static final Locale LOCALE = Locale.getDefault();
+    
+    private static final ResourceBundle RESOURCES =
+        ResourceBundle.getBundle(WindowStage.class.getPackage().getName() +
+                                 ".QuantumMessagesBundle", LOCALE);
+
+
     public WindowStage(javafx.stage.Window peerWindow, final StageStyle stageStyle, Modality modality, TKStage owner) {
         this.style = stageStyle;
         this.owner = (GlassStage)owner;
@@ -559,15 +568,23 @@
                                 ? defaultFullScreenExitKeycombo
                                 : key;
 
-                        // if the hint is "" dont show
-                        if (exitMessage != null &&
-                                (exitMessage.equals(""))) {
+                        if (
+                            // the hint is "" 
+                            "".equals(exitMessage) ||
+                            // if the key is NO_MATCH 
+                            (savedFullScreenExitKey.equals(KeyCombination.NO_MATCH))
+                                ) {
                             showWarning = false;
                         }
 
-                        // if the key is NO_MATCH dont show
-                        if (savedFullScreenExitKey.equals(KeyCombination.NO_MATCH)) {
-                            showWarning = false;
+                        // the hint is not set, use the key for the message
+                        if (showWarning && exitMessage == null) {
+                            if (key == null) {
+                                exitMessage = RESOURCES.getString("OverlayWarningESC");
+                            } else {
+                                String f = RESOURCES.getString("OverlayWarningKey");
+                                exitMessage = f.format(f, savedFullScreenExitKey.toString()); 
+                            }
                         }
                         
                         if (showWarning && warning == null) {
--- a/modules/graphics/src/main/java/javafx/stage/Stage.java	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/java/javafx/stage/Stage.java	Thu Oct 03 13:02:17 2013 -0400
@@ -1132,19 +1132,16 @@
             new SimpleObjectProperty<KeyCombination>(this, "fullScreenExitCombination", null);
 
     /**
-     * Specifies what KeyCombination will allow the user to exit full screen
+     * Specifies the KeyCombination that will allow the user to exit full screen
      * mode. A value of KeyCombination.NO_MATCH will not match any KeyEvent and
-     * will make it so the user is not able to escape from Full Screen mode. In 
-     * addition, using NO_MATCH will disable the Full Screen Exit Hint.
-     * A value of null means that the default platform specific key combination
+     * will make it so the user is not able to escape from Full Screen mode.
+     * A value of null indicates that the default platform specific key combination
      * should be used. 
      * <p>
      * An internal copy of this value is made when entering FullScreen mode and will be 
      * used to trigger the exit from the mode. If an application does not have
      * the proper permissions, this setting will be ignored.
      * </p>
-     * The default string displayed is controlled using the {@code fullScreenExitKeyProperty}
-     * and should be changed to match the {@code KeyCombination} used.
      * @param keyCombination the key combination to exit on
      * @since JavaFX 8.0 
      */
@@ -1177,9 +1174,12 @@
      * Specifies the text to show when a user enters full screen mode, usually
      * used to indicate the way a user should go about exiting out of full
      * screen mode. A value of null will result in the default per-locale
-     * message being displayed. If set to the empty string, then no message will
-     * be displayed. If an application does not have the proper permissions, 
-     * this setting will be ignored.
+     * message being displayed. 
+     * If set to the empty string, then no message will be displayed. 
+     * <p>
+     * If an application does not have the proper permissions, this setting 
+     * will be ignored.
+     * </p>
      * @param value the string to be displayed.
      * @since JavaFX 8.0 
      */
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = Press ESC to exit full-screen mode.
+OverlayWarningKey = Press %s to exit full-screen mode.
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_de.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_de.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = Dr\u00FCcken Sie ESC, um den Vollbildmodus zu beenden.
+OverlayWarningKey = Dr\u00FCcken Sie %s, um den Vollbildmodus zu beenden.
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_es.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_es.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = Pulse ESC para salir del modo de pantalla completa.
+OverlayWarningKey = Pulse %s para salir del modo de pantalla completa.
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_fr.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_fr.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = Appuyez sur Echap pour quitter le mode plein \u00E9cran.
+OverlayWarningKey = Appuyez sur %s pour quitter le mode plein \u00E9cran.
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_it.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_it.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = Premere ESC per disattivare la modalit\u00E0 schermo intero.
+OverlayWarningKey = Premere %s per disattivare la modalit\u00E0 schermo intero.
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_ja.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_ja.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = \u5168\u753B\u9762\u30E2\u30FC\u30C9\u3092\u7D42\u4E86\u3059\u308B\u306B\u306F\u3001[ESC]\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002
+OverlayWarningKey = \u5168\u753B\u9762\u30E2\u30FC\u30C9\u3092\u7D42\u4E86\u3059\u308B\u306B\u306F\u3001[%s]\u3092\u62BC\u3057\u3066\u304F\u3060\u3055\u3044\u3002
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_ko.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_ko.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = \uC804\uCCB4 \uD654\uBA74 \uBAA8\uB4DC\uB97C \uC885\uB8CC\uD558\uB824\uBA74 ESC\uB97C \uB204\uB974\uC2ED\uC2DC\uC624.
+OverlayWarningKey = \uC804\uCCB4 \uD654\uBA74 \uBAA8\uB4DC\uB97C \uC885\uB8CC\uD558\uB824\uBA74 %s\uB97C \uB204\uB974\uC2ED\uC2DC\uC624.
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_pt_BR.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_pt_BR.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = Pressione ESC para sair do modo de exibi\u00E7\u00E3o de tela inteira.
+OverlayWarningKey = Pressione %s para sair do modo de exibi\u00E7\u00E3o de tela inteira.
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_sv.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_sv.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = Tryck p\u00E5 ESC f\u00F6r att st\u00E4nga helsk\u00E4rmsl\u00E4get.
+OverlayWarningKey = Tryck p\u00E5 %s f\u00F6r att st\u00E4nga helsk\u00E4rmsl\u00E4get.
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_zh_CN.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_zh_CN.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = \u6309 ESC \u53EF\u9000\u51FA\u5168\u5C4F\u6A21\u5F0F\u3002
+OverlayWarningKey = \u6309 %s \u53EF\u9000\u51FA\u5168\u5C4F\u6A21\u5F0F\u3002
--- a/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_zh_TW.properties	Thu Oct 03 09:44:46 2013 -0700
+++ b/modules/graphics/src/main/resources/com/sun/javafx/tk/quantum/QuantumMessagesBundle_zh_TW.properties	Thu Oct 03 13:02:17 2013 -0400
@@ -1,1 +1,2 @@
 OverlayWarningESC = \u6309 ESC \u5373\u53EF\u96E2\u958B\u5168\u87A2\u5E55\u6A21\u5F0F.
+OverlayWarningKey = \u6309 %s \u5373\u53EF\u96E2\u958B\u5168\u87A2\u5E55\u6A21\u5F0F.