## javafx-ui-common/src/javafx/scene/Node.java

Print this page

    rev 1582 : RT-22121: Have StyleManager for Parent, also

    *** 1549,1559 ****
                  // Don't clear the dirty bit in case it will cause problems
                  // with a full CSS pass on the scene.
                  // TODO: is this the right thing to do?
                  // this.impl_clearDirty(com.sun.javafx.scene.DirtyBits.NODE_CSS);

    !             this.processCSS();
              }
          }

          /**
           * Recursive function for synchronizing a node and all descendents
    --- 1549,1559 ----
                  // Don't clear the dirty bit in case it will cause problems
                  // with a full CSS pass on the scene.
                  // TODO: is this the right thing to do?
                  // this.impl_clearDirty(com.sun.javafx.scene.DirtyBits.NODE_CSS);

    !             this.processCSS(getScene().styleManager);
              }
          }

          /**
           * Recursive function for synchronizing a node and all descendents
    *** 7306,7316 ****
              }
          }

          // this function primarily exists as a hook to aid in testing
          boolean isPseudoclassUsed(String pseudoclass) {
    -         final StyleHelper styleHelper = impl_getStyleHelper();
              return (styleHelper != null) ? styleHelper.isPseudoclassUsed(pseudoclass) : false;
          }

          /**
           * @treatAsPrivate implementation detail
    --- 7306,7315 ----
    *** 7370,7397 ****
              } else if (getScene() != null) {
                  notifyParentsOfInvalidatedCSS();
              }
          }

    !     void processCSS() {
              switch (cssFlag) {
                  case CLEAN:
                      break;
                  case DIRTY_BRANCH:
                      Parent me = (Parent)this;
                      // clear the flag first in case the flag is set to something
                      // other than clean by downstream processing.
                      me.cssFlag = CSSFlags.CLEAN;
                      List<Node> children = me.getChildren();
                      for (int i=0, max=children.size(); i<max; i++) {
    !                     children.get(i).processCSS();
                      }
                      break;
                  case REAPPLY:
                  case UPDATE:
                  default:
    !                 impl_processCSS(cssFlag == CSSFlags.REAPPLY);
              }
          }

          /**
           * If invoked, will update / reapply styles from here on down. If reapply
    --- 7369,7396 ----
              } else if (getScene() != null) {
                  notifyParentsOfInvalidatedCSS();
              }
          }

    !     void processCSS(StyleManager styleManager) {
              switch (cssFlag) {
                  case CLEAN:
                      break;
                  case DIRTY_BRANCH:
                      Parent me = (Parent)this;
                      // clear the flag first in case the flag is set to something
                      // other than clean by downstream processing.
                      me.cssFlag = CSSFlags.CLEAN;
                      List<Node> children = me.getChildren();
                      for (int i=0, max=children.size(); i<max; i++) {
    !                     children.get(i).processCSS(styleManager);
                      }
                      break;
                  case REAPPLY:
                  case UPDATE:
                  default:
    !                 impl_processCSS(styleManager, cssFlag == CSSFlags.REAPPLY);
              }
          }

          /**
           * If invoked, will update / reapply styles from here on down. If reapply
    *** 7401,7420 ****
           * @treatAsPrivate implementation detail
           * @deprecated This is an internal API that is not intended for use and will be removed in the next version
           */
          @Deprecated // SB-dependency: RT-21206 has been filed to track this
          public void impl_processCSS(boolean reapply) {

    -         StyleHelper styleHelper = null;
              // Create a new StyleHelper either if I am told I need to reapply
              // or if my own flag indicates I need to reapply
              if (reapply || (cssFlag == CSSFlags.REAPPLY)) {

    !             styleHelper = impl_createStyleHelper();

    -         } else {
    -             styleHelper = impl_getStyleHelper();
              }

              // Clear the flag first in case the flag is set to something
              // other than clean by downstream processing.
              cssFlag = CSSFlags.CLEAN;
    --- 7400,7430 ----
           * @treatAsPrivate implementation detail
           * @deprecated This is an internal API that is not intended for use and will be removed in the next version
           */
          @Deprecated // SB-dependency: RT-21206 has been filed to track this
          public void impl_processCSS(boolean reapply) {
    +         final StyleManager styleManager = StyleManager.getStyleManager(this.getScene());
    +         impl_processCSS(styleManager, reapply);
    +     }
    +
    +     /**
    +      * If invoked, will update / reapply styles from here on down. If reapply
    +      * is false, then we will only update from here on down, otherwise we will
    +      * do a full reapply.
    +      *
    +      * @treatAsPrivate implementation detail
    +      * @deprecated This is an internal API that is not intended for use and will be removed in the next version
    +      */
    +     @Deprecated // SB-dependency: RT-21206 has been filed to track this
    +     public void impl_processCSS(StyleManager styleManager, boolean reapply) {

              // Create a new StyleHelper either if I am told I need to reapply
              // or if my own flag indicates I need to reapply
              if (reapply || (cssFlag == CSSFlags.REAPPLY)) {

    !             styleHelper = styleManager.getStyleHelper(this);

              }

              // Clear the flag first in case the flag is set to something
              // other than clean by downstream processing.
              cssFlag = CSSFlags.CLEAN;
    *** 7434,7449 ****

          /**
           * @treatAsPrivate implementation detail
           * @deprecated This is an internal API that is not intended for use and will be removed in the next version
           */
    !     @Deprecated
    !     protected StyleHelper impl_createStyleHelper() {
    !
    !         styleHelper = getScene().styleManager.getStyleHelper(this);
    !         return styleHelper;
    !     }

          /**
           * Get this nodes StyleHelper
           * @treatAsPrivate implementation detail
           * @deprecated This is an internal API that is not intended for use and will be removed in the next version
    --- 7444,7459 ----

          /**
           * @treatAsPrivate implementation detail
           * @deprecated This is an internal API that is not intended for use and will be removed in the next version
           */
    ! //    @Deprecated
    ! //    protected StyleHelper impl_createStyleHelper() {
    ! //
    ! //        styleHelper = getScene().styleManager.getStyleHelper(this);
    ! //        return styleHelper;
    ! //    }

          /**
           * Get this nodes StyleHelper
           * @treatAsPrivate implementation detail
           * @deprecated This is an internal API that is not intended for use and will be removed in the next version