changeset 9494:016699a35e07

8144956: Remove impl_cssGet*InitialValue() methods from Node and Labeled
author jgiles
date Wed, 13 Jan 2016 14:13:35 +1300
parents 6d0881d315d2
children 765fd07f22fc
files modules/controls/src/main/java/javafx/scene/control/Accordion.java modules/controls/src/main/java/javafx/scene/control/ButtonBar.java modules/controls/src/main/java/javafx/scene/control/Cell.java modules/controls/src/main/java/javafx/scene/control/Control.java modules/controls/src/main/java/javafx/scene/control/Hyperlink.java modules/controls/src/main/java/javafx/scene/control/Label.java modules/controls/src/main/java/javafx/scene/control/Labeled.java modules/controls/src/main/java/javafx/scene/control/MenuBar.java modules/controls/src/main/java/javafx/scene/control/ProgressBar.java modules/controls/src/main/java/javafx/scene/control/ProgressIndicator.java modules/controls/src/main/java/javafx/scene/control/RadioButton.java modules/controls/src/main/java/javafx/scene/control/ScrollBar.java modules/controls/src/main/java/javafx/scene/control/ScrollPane.java modules/controls/src/main/java/javafx/scene/control/Separator.java modules/controls/src/main/java/javafx/scene/control/SplitPane.java modules/controls/src/main/java/javafx/scene/control/ToggleButton.java modules/controls/src/main/java/javafx/scene/control/ToolBar.java modules/graphics/src/main/java/javafx/scene/Node.java
diffstat 18 files changed, 164 insertions(+), 155 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/control/Accordion.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/Accordion.java	Wed Jan 13 14:13:35 2016 +1300
@@ -212,14 +212,14 @@
     private static final String DEFAULT_STYLE_CLASS = "accordion";
 
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but Accordion returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/ButtonBar.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/ButtonBar.java	Wed Jan 13 14:13:35 2016 +1300
@@ -577,14 +577,14 @@
      **************************************************************************/
 
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but ButtonBar returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/Cell.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/Cell.java	Wed Jan 13 14:13:35 2016 +1300
@@ -728,15 +728,14 @@
             PseudoClass.getPseudoClass("filled");
 
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but Cell returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
-    
 }
--- a/modules/controls/src/main/java/javafx/scene/control/Control.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/Control.java	Wed Jan 13 14:13:35 2016 +1300
@@ -878,12 +878,14 @@
     }
 
     /**
-      * Most Controls return true for focusTraversable initial value.
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. By default all
+     * UI controls are focus traversable, so this method is overridden in Control
+     * to set the initial traversable state to true.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.TRUE;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/Hyperlink.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/Hyperlink.java	Wed Jan 13 14:13:35 2016 +1300
@@ -170,13 +170,14 @@
     private static final PseudoClass PSEUDO_CLASS_VISITED =
             PseudoClass.getPseudoClass("visited");
 
-     /**
-      * Hyperlink uses HAND as the default value for cursor. 
-      * This method provides a way for css to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Cursor impl_cssGetCursorInitialValue() {
+    /**
+     * Returns the initial cursor state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden to use the HAND cursor initially.
+     *
+     * @since 9
+     */
+    @Override protected Cursor getInitialCursor() {
         return Cursor.HAND;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/Label.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/Label.java	Wed Jan 13 14:13:35 2016 +1300
@@ -165,14 +165,15 @@
      **************************************************************************/
 
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but Label returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
+
 }
--- a/modules/controls/src/main/java/javafx/scene/control/Labeled.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/Labeled.java	Wed Jan 13 14:13:35 2016 +1300
@@ -802,13 +802,14 @@
      *                                                                         *
      **************************************************************************/
 
-     /**
-      * Not everything uses the default value of false for alignment. 
-      * This method provides a way to have them return the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated
-    protected Pos impl_cssGetAlignmentInitialValue() {
+    /**
+     * Returns the initial alignment state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden to use Pos.CENTER_LEFT initially.
+     *
+     * @since 9
+     */
+    protected Pos getInitialAlignment() {
         return Pos.CENTER_LEFT;
     }
     
@@ -846,7 +847,7 @@
             
             @Override
             public Pos getInitialValue(Labeled n) {
-                return n.impl_cssGetAlignmentInitialValue();
+                return n.getInitialAlignment();
             }
         };
         
--- a/modules/controls/src/main/java/javafx/scene/control/MenuBar.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/MenuBar.java	Wed Jan 13 14:13:35 2016 +1300
@@ -251,14 +251,14 @@
     }
 
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but MenuBar returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/ProgressBar.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/ProgressBar.java	Wed Jan 13 14:13:35 2016 +1300
@@ -110,16 +110,16 @@
      * this control.
      */
     private static final String DEFAULT_STYLE_CLASS = "progress-bar";
-        
+
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but ProgressBar returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/ProgressIndicator.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/ProgressIndicator.java	Wed Jan 13 14:13:35 2016 +1300
@@ -226,16 +226,16 @@
      */
     private static final PseudoClass PSEUDO_CLASS_INDETERMINATE =
             PseudoClass.getPseudoClass("indeterminate");
-    
+
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but ProgressIndicator returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/RadioButton.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/RadioButton.java	Wed Jan 13 14:13:35 2016 +1300
@@ -129,17 +129,16 @@
     private static final String DEFAULT_STYLE_CLASS = "radio-button";
 
     /**
-      * Labeled return CENTER_LEFT for alignment, but ToggleButton returns
-      * CENTER. RadioButton also returns CENTER_LEFT so we have to override
-      * the override in ToggleButton. 
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected Pos impl_cssGetAlignmentInitialValue() {
+     * Returns the initial alignment state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden to use Pos.CENTER_LEFT initially.
+     *
+     * @since 9
+     */
+    @Override protected Pos getInitialAlignment() {
         return Pos.CENTER_LEFT;
     }
 
-
     /***************************************************************************
      *                                                                         *
      * Accessibility handling                                                  *
--- a/modules/controls/src/main/java/javafx/scene/control/ScrollBar.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/ScrollBar.java	Wed Jan 13 14:13:35 2016 +1300
@@ -473,16 +473,16 @@
      */
     private static final PseudoClass HORIZONTAL_PSEUDOCLASS_STATE =
             PseudoClass.getPseudoClass("horizontal");
-    
+
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but ScrollBar returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/ScrollPane.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/ScrollPane.java	Wed Jan 13 14:13:35 2016 +1300
@@ -767,16 +767,16 @@
             PseudoClass.getPseudoClass("fitToWidth");
     private static final PseudoClass FIT_TO_HEIGHT_PSEUDOCLASS_STATE =
             PseudoClass.getPseudoClass("fitToHeight");
-    
+
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but ScrollPane returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/Separator.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/Separator.java	Wed Jan 13 14:13:35 2016 +1300
@@ -324,16 +324,16 @@
 
     private static final PseudoClass VERTICAL_PSEUDOCLASS_STATE = PseudoClass.getPseudoClass("vertical");
     private static final PseudoClass HORIZONTAL_PSEUDOCLASS_STATE = PseudoClass.getPseudoClass("horizontal");
-    
+
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but Separator returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
     
--- a/modules/controls/src/main/java/javafx/scene/control/SplitPane.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/SplitPane.java	Wed Jan 13 14:13:35 2016 +1300
@@ -453,14 +453,14 @@
     private static final PseudoClass HORIZONTAL_PSEUDOCLASS_STATE = PseudoClass.getPseudoClass("horizontal");
 
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but SplitPane returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
     
--- a/modules/controls/src/main/java/javafx/scene/control/ToggleButton.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/ToggleButton.java	Wed Jan 13 14:13:35 2016 +1300
@@ -273,13 +273,14 @@
     private static final PseudoClass PSEUDO_CLASS_SELECTED =
             PseudoClass.getPseudoClass("selected");
 
-     /**
-      * Not everything uses the default value of false for alignment. 
-      * This method provides a way to have them return the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected Pos impl_cssGetAlignmentInitialValue() {
+    /**
+     * Returns the initial alignment state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden to use Pos.CENTER initially.
+     *
+     * @since 9
+     */
+    @Override protected Pos getInitialAlignment() {
         return Pos.CENTER;
     }
 
--- a/modules/controls/src/main/java/javafx/scene/control/ToolBar.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/controls/src/main/java/javafx/scene/control/ToolBar.java	Wed Jan 13 14:13:35 2016 +1300
@@ -253,15 +253,14 @@
     private static final PseudoClass HORIZONTAL_PSEUDOCLASS_STATE = PseudoClass.getPseudoClass("horizontal");
 
     /**
-      * Most Controls return true for focusTraversable, so Control overrides
-      * this method to return true, but ToolBar returns false for
-      * focusTraversable's initial value; hence the override of the override. 
-      * This method is called from CSS code to get the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated @Override
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+     * Returns the initial focus traversable state of this control, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * is overridden as by default UI controls have focus traversable set to true,
+     * but that is not appropriate for this control.
+     *
+     * @since 9
+     */
+    @Override protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
-
 }
--- a/modules/graphics/src/main/java/javafx/scene/Node.java	Tue Jan 12 15:10:55 2016 -0800
+++ b/modules/graphics/src/main/java/javafx/scene/Node.java	Wed Jan 13 14:13:35 2016 +1300
@@ -8475,23 +8475,29 @@
     }
 
 
-     /**
-      * Not everything uses the default value of false for focusTraversable.
-      * This method provides a way to have them return the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated
-    protected /*do not make final*/ Boolean impl_cssGetFocusTraversableInitialValue() {
+    /**
+     * Returns the initial focus traversable state of this node, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * can be overridden by subclasses in instances where focus traversable should
+     * initially be true (as the default implementation of this method is to return
+     * false).
+     *
+     * @since 9
+     */
+    protected Boolean getInitialFocusTraversable() {
         return Boolean.FALSE;
     }
 
-     /**
-      * Not everything uses the default value of null for cursor.
-      * This method provides a way to have them return the correct initial value.
-      * @treatAsPrivate implementation detail
-      */
-    @Deprecated
-    protected /*do not make final*/ Cursor impl_cssGetCursorInitialValue() {
+    /**
+     * Returns the initial cursor state of this node, for use
+     * by the JavaFX CSS engine to correctly set its initial value. This method
+     * can be overridden by subclasses in instances where the cursor should
+     * initially be non-null (as the default implementation of this method is to return
+     * null).
+     *
+     * @since 9
+     */
+    protected Cursor getInitialCursor() {
         return null;
     }
 
@@ -8518,7 +8524,7 @@
                 public Cursor getInitialValue(Node node) {
                     // Most controls default focusTraversable to true.
                     // Give a way to have them return the correct default value.
-                    return node.impl_cssGetCursorInitialValue();
+                    return node.getInitialCursor();
                 }
 
             };
@@ -8553,7 +8559,7 @@
                 public Boolean getInitialValue(Node node) {
                     // Most controls default focusTraversable to true.
                     // Give a way to have them return the correct default value.
-                    return node.impl_cssGetFocusTraversableInitialValue();
+                    return node.getInitialFocusTraversable();
                 }
 
             };