< prev index next >

modules/javafx.graphics/src/main/java/javafx/scene/Node.java

Print this page

        

*** 1825,1834 **** --- 1825,1855 ---- */ public final BooleanProperty disableProperty() { return getMiscProperties().disableProperty(); } + /** + * Indicates whether this {@code Node} is sensitive to CSS processing.<p> + * Nodes with {@code cssSensitive} set to {@code false} and + * their subtrees will be skipped during CSS processing. + * + * @return is this {@code Node} sensitive to CSS processing + * @defaultValue true + * @since 10 + */ + public final BooleanProperty cssSensitiveProperty() { + return getMiscProperties().cssSensitiveProperty(); + } + + public final void setCssSensitive(boolean value) { + cssSensitiveProperty().set(value); + } + + public final boolean isCssSensitive() { + return (miscProperties == null) ? true + : miscProperties.isCssSensitive(); + } // /** // * TODO document - null by default, could be non-null in subclasses (e.g. Control) // */ // public final ObjectProperty<InputMap<?>> inputMapProperty() {
*** 6716,6725 **** --- 6737,6747 ---- private ObjectProperty<CacheHint> cacheHint; private ObjectProperty<Node> clip; private ObjectProperty<Cursor> cursor; private ObjectProperty<DepthTest> depthTest; private BooleanProperty disable; + private BooleanProperty cssSensitive; private ObjectProperty<Effect> effect; private ObjectProperty<InputMethodRequests> inputMethodRequests; private BooleanProperty mouseTransparent; private DoubleProperty viewOrder;
*** 7073,7082 **** --- 7095,7129 ---- }; } return disable; } + public final boolean isCssSensitive() { + return (cssSensitive == null) ? true : cssSensitive.get(); + } + + public final BooleanProperty cssSensitiveProperty() { + if (cssSensitive == null) { + cssSensitive = new BooleanPropertyBase(true) { + @Override + protected void invalidated() { + } + + @Override + public Object getBean() { + return Node.this; + } + + @Override + public String getName() { + return "cssSensitive"; + } + }; + } + return cssSensitive; + } + public final Effect getEffect() { return (effect == null) ? DEFAULT_EFFECT : effect.get(); } public final ObjectProperty<Effect> effectProperty() {
*** 9428,9437 **** --- 9475,9488 ---- // There is no check of the CSS state of a child since reapply takes precedence // over other CSS states. // private void reapplyCss() { + if (isCssSensitive() == false) { + return; + } + // Hang on to current styleHelper so we can know whether // createStyleHelper returned the same styleHelper final CssStyleHelper oldStyleHelper = styleHelper; // CSS state is "REAPPLY"
*** 9499,9508 **** --- 9550,9563 ---- { 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; + + if (isCssSensitive() == false) { + return; + } List<Node> children = me.getChildren(); for (int i=0, max=children.size(); i<max; i++) { children.get(i).processCSS(); } break;
*** 9556,9565 **** --- 9611,9624 ---- * </code></pre> * @since JavaFX 8.0 */ public final void applyCss() { + if (isCssSensitive() == false) { + return; + } + if (getScene() == null) { return; } // update, unless reapply
*** 9624,9633 **** --- 9683,9696 ---- // Clear the flag first in case the flag is set to something // other than clean by downstream processing. cssFlag = CssFlags.CLEAN; + if (isCssSensitive() == false) { + return; + } + // Transition to the new state and apply styles if (styleHelper != null && getScene() != null) { styleHelper.transitionToState(this); } }
< prev index next >