< prev index next >

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

Print this page

        

*** 416,425 **** --- 416,467 ---- public void doUpdatePeer(Node node) { node.doUpdatePeer(); } @Override + public BaseTransform getLeafTransform(Node node) { + return node.getLeafTransform(); + } + + @Override + public Bounds doComputeLayoutBounds(Node node) { + return node.doComputeLayoutBounds(); + } + + @Override + public void doTransformsChanged(Node node) { + node.doTransformsChanged(); + } + + @Override + public void doPickNodeLocal(Node node, PickRay localPickRay, + PickResultChooser result) { + node.doPickNodeLocal(localPickRay, result); + } + + @Override + public boolean doComputeIntersects(Node node, PickRay pickRay, + PickResultChooser pickResult) { + return node.doComputeIntersects(pickRay, pickResult); + } + + @Override + public void doGeomChanged(Node node) { + node.doGeomChanged(); + } + + @Override + public void doNotifyLayoutBoundsChanged(Node node) { + node.doNotifyLayoutBoundsChanged(); + } + + @Override + public void doProcessCSS(Node node) { + node.doProcessCSS(); + } + + @Override public boolean isDirty(Node node, DirtyBits dirtyBit) { return node.isDirty(dirtyBit); } @Override
*** 431,445 **** --- 473,544 ---- public void syncPeer(Node node) { node.syncPeer(); } @Override + public void layoutBoundsChanged(Node node) { + node.layoutBoundsChanged(); + } + + @Override public <P extends NGNode> P getPeer(Node node) { return node.getPeer(); } @Override + public void setShowMnemonics(Node node, boolean value) { + node.setShowMnemonics(value); + } + + @Override + public boolean isShowMnemonics(Node node) { + return node.isShowMnemonics(); + } + + @Override + public BooleanProperty showMnemonicsProperty(Node node) { + return node.showMnemonicsProperty(); + } + + @Override + public boolean traverse(Node node, Direction direction) { + return node.traverse(direction); + } + + @Override + public double getPivotX(Node node) { + return node.getPivotX(); + } + + @Override + public double getPivotY(Node node) { + return node.getPivotY(); + } + + @Override + public double getPivotZ(Node node) { + return node.getPivotZ(); + } + + @Override + public void pickNode(Node node,PickRay pickRay, + PickResultChooser result) { + node.pickNode(pickRay, result); + } + + @Override + public boolean intersects(Node node, PickRay pickRay, + PickResultChooser pickResult) { + return node.intersects(pickRay, pickResult); + } + + @Override + public double intersectsBounds(Node node, PickRay pickRay) { + return node.intersectsBounds(pickRay); + } + + @Override public void layoutNodeForPrinting(Node node) { node.doCSSLayoutSyncForSnapshot(); } @Override
*** 459,468 **** --- 558,594 ---- @Override public Accessible getAccessible(Node node) { return node.getAccessible(); } + + @Override + public void reapplyCSS(Node node) { + node.reapplyCSS(); + } + + @Override + public boolean isTreeVisible(Node node) { + return node.isTreeVisible(); + } + + @Override + public BooleanExpression treeVisibleProperty(Node node) { + return node.treeVisibleProperty(); + } + + @Override + public List<Style> getMatchingStyles(CssMetaData cssMetaData, + Styleable styleable) { + return Node.getMatchingStyles(cssMetaData, styleable); + } + + @Override + public Map<StyleableProperty<?>,List<Style>> findStyles(Node node, + Map<StyleableProperty<?>,List<Style>> styleMap) { + return node.findStyles(styleMap); + } }); } /************************************************************************** * *
*** 796,831 **** @Override protected void invalidated() { if (oldParent != null) { oldParent.disabledProperty().removeListener(parentDisabledChangedListener); ! oldParent.impl_treeVisibleProperty().removeListener(parentTreeVisibleChangedListener); if (nodeTransformation != null && nodeTransformation.listenerReasons > 0) { ((Node) oldParent).localToSceneTransformProperty().removeListener( nodeTransformation.getLocalToSceneInvalidationListener()); } } updateDisabled(); computeDerivedDepthTest(); final Parent newParent = get(); if (newParent != null) { newParent.disabledProperty().addListener(parentDisabledChangedListener); ! newParent.impl_treeVisibleProperty().addListener(parentTreeVisibleChangedListener); if (nodeTransformation != null && nodeTransformation.listenerReasons > 0) { ((Node) newParent).localToSceneTransformProperty().addListener( nodeTransformation.getLocalToSceneInvalidationListener()); } // // if parent changed, then CSS needs to be reapplied so // that this node will get the right styles. This used // to be done from Parent.children's onChanged method. // See the comments there, also. // ! impl_reapplyCSS(); } else { // RT-31168: reset CssFlag to clean so css will be reapplied if the node is added back later. ! // If flag is REAPPLY, then impl_reapplyCSS() will just return and the call to // notifyParentsOfInvalidatedCSS() will be skipped thus leaving the node un-styled. cssFlag = CssFlags.CLEAN; } updateTreeVisible(true); oldParent = newParent; --- 922,957 ---- @Override protected void invalidated() { if (oldParent != null) { oldParent.disabledProperty().removeListener(parentDisabledChangedListener); ! oldParent.treeVisibleProperty().removeListener(parentTreeVisibleChangedListener); if (nodeTransformation != null && nodeTransformation.listenerReasons > 0) { ((Node) oldParent).localToSceneTransformProperty().removeListener( nodeTransformation.getLocalToSceneInvalidationListener()); } } updateDisabled(); computeDerivedDepthTest(); final Parent newParent = get(); if (newParent != null) { newParent.disabledProperty().addListener(parentDisabledChangedListener); ! newParent.treeVisibleProperty().addListener(parentTreeVisibleChangedListener); if (nodeTransformation != null && nodeTransformation.listenerReasons > 0) { ((Node) newParent).localToSceneTransformProperty().addListener( nodeTransformation.getLocalToSceneInvalidationListener()); } // // if parent changed, then CSS needs to be reapplied so // that this node will get the right styles. This used // to be done from Parent.children's onChanged method. // See the comments there, also. // ! reapplyCSS(); } else { // RT-31168: reset CssFlag to clean so css will be reapplied if the node is added back later. ! // If flag is REAPPLY, then reapplyCSS() will just return and the call to // notifyParentsOfInvalidatedCSS() will be skipped thus leaving the node un-styled. cssFlag = CssFlags.CLEAN; } updateTreeVisible(true); oldParent = newParent;
*** 912,922 **** } focusSetDirty(oldScene); focusSetDirty(newScene); } scenesChanged(newScene, newSubScene, oldScene, oldSubScene); ! if (sceneChanged && reapplyCSS) impl_reapplyCSS(); if (sceneChanged && !isDirtyEmpty()) { //Note: no need to remove from scene's dirty list //Scene's is checking if the node's scene is correct /* TODO: looks like an existing bug when a node is moved from one --- 1038,1048 ---- } focusSetDirty(oldScene); focusSetDirty(newScene); } scenesChanged(newScene, newSubScene, oldScene, oldSubScene); ! if (sceneChanged && reapplyCSS) reapplyCSS(); if (sceneChanged && !isDirtyEmpty()) { //Note: no need to remove from scene's dirty list //Scene's is checking if the node's scene is correct /* TODO: looks like an existing bug when a node is moved from one
*** 1048,1058 **** if (id == null) { id = new StringPropertyBase() { @Override protected void invalidated() { ! impl_reapplyCSS(); if (PrismSettings.printRenderGraph) { NodeHelper.markDirty(Node.this, DirtyBits.DEBUG); } } --- 1174,1184 ---- if (id == null) { id = new StringPropertyBase() { @Override protected void invalidated() { ! reapplyCSS(); if (PrismSettings.printRenderGraph) { NodeHelper.markDirty(Node.this, DirtyBits.DEBUG); } }
*** 1081,1091 **** * @defaultValue null */ private ObservableList<String> styleClass = new TrackableObservableList<String>() { @Override protected void onChanged(Change<String> c) { ! impl_reapplyCSS(); } @Override public String toString() { if (size() == 0) { --- 1207,1217 ---- * @defaultValue null */ private ObservableList<String> styleClass = new TrackableObservableList<String>() { @Override protected void onChanged(Change<String> c) { ! reapplyCSS(); } @Override public String toString() { if (size() == 0) {
*** 1166,1176 **** @Override protected void invalidated() { // If the style has changed, then styles of this node // and child nodes might be affected. ! impl_reapplyCSS(); } @Override public Object getBean() { return Node.this; --- 1292,1302 ---- @Override protected void invalidated() { // If the style has changed, then styles of this node // and child nodes might be affected. ! reapplyCSS(); } @Override public Object getBean() { return Node.this;
*** 1211,1221 **** boolean oldValue = true; @Override protected void invalidated() { if (oldValue != get()) { NodeHelper.markDirty(Node.this, DirtyBits.NODE_VISIBLE); ! impl_geomChanged(); updateTreeVisible(false); if (getParent() != null) { // notify the parent of the potential change in visibility // of this node, since visibility affects bounds of the // parent node --- 1337,1347 ---- boolean oldValue = true; @Override protected void invalidated() { if (oldValue != get()) { NodeHelper.markDirty(Node.this, DirtyBits.NODE_VISIBLE); ! NodeHelper.geomChanged(Node.this); updateTreeVisible(false); if (getParent() != null) { // notify the parent of the potential change in visibility // of this node, since visibility affects bounds of the // parent node
*** 1857,1867 **** // the scene graph other than the root. private void doCSSPass() { if (this.cssFlag != CssFlags.CLEAN) { // The dirty bit isn't checked but we must ensure it is cleared. // The cssFlag is set to clean in either Node.processCSS or ! // Node.impl_processCSS(boolean) // 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.clearDirty(com.sun.javafx.scene.DirtyBits.NODE_CSS); --- 1983,1993 ---- // the scene graph other than the root. private void doCSSPass() { if (this.cssFlag != CssFlags.CLEAN) { // The dirty bit isn't checked but we must ensure it is cleared. // The cssFlag is set to clean in either Node.processCSS or ! // NodeHelper.processCSS // 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.clearDirty(com.sun.javafx.scene.DirtyBits.NODE_CSS);
*** 2545,2555 **** if (layoutX == null) { layoutX = new DoublePropertyBase(0.0) { @Override protected void invalidated() { ! impl_transformsChanged(); final Parent p = getParent(); // Propagate layout if this change isn't triggered by its parent if (p != null && !p.isCurrentLayoutChild(Node.this)) { if (isManaged()) { --- 2671,2681 ---- if (layoutX == null) { layoutX = new DoublePropertyBase(0.0) { @Override protected void invalidated() { ! NodeHelper.transformsChanged(Node.this); final Parent p = getParent(); // Propagate layout if this change isn't triggered by its parent if (p != null && !p.isCurrentLayoutChild(Node.this)) { if (isManaged()) {
*** 2619,2629 **** if (layoutY == null) { layoutY = new DoublePropertyBase(0.0) { @Override protected void invalidated() { ! impl_transformsChanged(); final Parent p = getParent(); // Propagate layout if this change isn't triggered by its parent if (p != null && !p.isCurrentLayoutChild(Node.this)) { if (isManaged()) { --- 2745,2755 ---- if (layoutY == null) { layoutY = new DoublePropertyBase(0.0) { @Override protected void invalidated() { ! NodeHelper.transformsChanged(Node.this); final Parent p = getParent(); // Propagate layout if this change isn't triggered by its parent if (p != null && !p.isCurrentLayoutChild(Node.this)) { if (isManaged()) {
*** 3296,3306 **** * */ private LazyBoundsProperty layoutBounds = new LazyBoundsProperty() { @Override protected Bounds computeBounds() { ! return impl_computeLayoutBounds(); } @Override public Object getBean() { return Node.this; --- 3422,3432 ---- * */ private LazyBoundsProperty layoutBounds = new LazyBoundsProperty() { @Override protected Bounds computeBounds() { ! return NodeHelper.computeLayoutBounds(Node.this); } @Override public Object getBean() { return Node.this;
*** 3375,3385 **** * functions all have the same signature. They take a Bounds2D and * BaseTransform, and return a Bounds2D (the same as they took). These * functions essentially populate the supplied bounds2D with the * appropriate bounds information, leveraging cached bounds if possible. * ! * There is a single impl_computeGeomBounds function which is abstract. * This must be implemented in each subclass, and is responsible for * computing the actual geometric bounds for the Node. For example, Parent * is written such that this function is the union of the transformed * bounds of each child. Rectangle is written such that this takes into * account the size and stroke. Text is written such that it is computed --- 3501,3511 ---- * functions all have the same signature. They take a Bounds2D and * BaseTransform, and return a Bounds2D (the same as they took). These * functions essentially populate the supplied bounds2D with the * appropriate bounds information, leveraging cached bounds if possible. * ! * There is a single NodeHelper.computeGeomBoundsImpl function which is abstract. * This must be implemented in each subclass, and is responsible for * computing the actual geometric bounds for the Node. For example, Parent * is written such that this function is the union of the transformed * bounds of each child. Rectangle is written such that this takes into * account the size and stroke. Text is written such that it is computed
*** 3439,3455 **** * really belongs to the Parent of the node and should *only* be modified * by the parent. */ boolean boundsChanged; ! /** * Returns geometric bounds, but may be over-ridden by a subclass. - * @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 Bounds impl_computeLayoutBounds() { BaseBounds tempBounds = TempState.getInstance().bounds; tempBounds = getGeomBounds(tempBounds, BaseTransform.IDENTITY_TRANSFORM); return new BoundingBox(tempBounds.getMinX(), tempBounds.getMinY(), --- 3565,3578 ---- * really belongs to the Parent of the node and should *only* be modified * by the parent. */ boolean boundsChanged; ! /* * Returns geometric bounds, but may be over-ridden by a subclass. */ ! private Bounds doComputeLayoutBounds() { BaseBounds tempBounds = TempState.getInstance().bounds; tempBounds = getGeomBounds(tempBounds, BaseTransform.IDENTITY_TRANSFORM); return new BoundingBox(tempBounds.getMinX(), tempBounds.getMinY(),
*** 3457,3489 **** tempBounds.getWidth(), tempBounds.getHeight(), tempBounds.getDepth()); } ! /** * Subclasses may customize the layoutBounds by means of overriding the ! * impl_computeLayoutBounds method. If the layout bounds need to be * recomputed, the subclass must notify the Node implementation of this * fact so that appropriate notifications and internal state can be ! * kept in sync. Subclasses must call impl_layoutBoundsChanged to * let Node know that the layout bounds are invalid and need to be * recomputed. - * - * @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 final void impl_layoutBoundsChanged() { if (!layoutBounds.valid) { return; } layoutBounds.invalidate(); if ((nodeTransformation != null && nodeTransformation.hasScaleOrRotate()) || hasMirroring()) { // if either the scale or rotate convenience variables are used, // then we need a valid pivot point. Since the layoutBounds // affects the pivot we need to invalidate the transform ! impl_transformsChanged(); } } /** * Loads the given bounds object with the transformed bounds relative to, --- 3580,3608 ---- tempBounds.getWidth(), tempBounds.getHeight(), tempBounds.getDepth()); } ! /* * Subclasses may customize the layoutBounds by means of overriding the ! * NodeHelper.computeLayoutBoundsImpl method. If the layout bounds need to be * recomputed, the subclass must notify the Node implementation of this * fact so that appropriate notifications and internal state can be ! * kept in sync. Subclasses must call NodeHelper.layoutBoundsChanged to * let Node know that the layout bounds are invalid and need to be * recomputed. */ ! final void layoutBoundsChanged() { if (!layoutBounds.valid) { return; } layoutBounds.invalidate(); if ((nodeTransformation != null && nodeTransformation.hasScaleOrRotate()) || hasMirroring()) { // if either the scale or rotate convenience variables are used, // then we need a valid pivot point. Since the layoutBounds // affects the pivot we need to invalidate the transform ! NodeHelper.transformsChanged(this); } } /** * Loads the given bounds object with the transformed bounds relative to,
*** 3622,3632 **** } else if (tx.is2D() && (tx.getType() & ~(BaseTransform.TYPE_UNIFORM_SCALE | BaseTransform.TYPE_TRANSLATION | BaseTransform.TYPE_FLIP | BaseTransform.TYPE_QUADRANT_ROTATION)) != 0) { // this is a non-uniform scale / non-quadrant rotate / skew transform ! return impl_computeGeomBounds(bounds, tx); } else { // 3D transformations and // selected 2D transformations (unifrom transform, flip, quadrant rotation). // These 2D transformation will yield tight bounds when applied on the pre-computed // geomBounds --- 3741,3751 ---- } else if (tx.is2D() && (tx.getType() & ~(BaseTransform.TYPE_UNIFORM_SCALE | BaseTransform.TYPE_TRANSLATION | BaseTransform.TYPE_FLIP | BaseTransform.TYPE_QUADRANT_ROTATION)) != 0) { // this is a non-uniform scale / non-quadrant rotate / skew transform ! return NodeHelper.computeGeomBounds(this, bounds, tx); } else { // 3D transformations and // selected 2D transformations (unifrom transform, flip, quadrant rotation). // These 2D transformation will yield tight bounds when applied on the pre-computed // geomBounds
*** 3636,3660 **** return tx.transform(geomBounds, bounds); } } /** - * Computes the geometric bounds for this Node. This method is abstract - * and must be implemented by each Node subclass. - * @treatAsPrivate implementation detail - * @deprecated This is an internal API that is not intended for use and will be removed in the next version - */ - @Deprecated - public abstract BaseBounds impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx); - - /** * If necessary, recomputes the cached geom bounds. If the bounds are not * invalid, then this method is a no-op. */ void updateGeomBounds() { if (geomBoundsInvalid) { ! geomBounds = impl_computeGeomBounds(geomBounds, BaseTransform.IDENTITY_TRANSFORM); geomBoundsInvalid = false; } } /** --- 3755,3770 ---- return tx.transform(geomBounds, bounds); } } /** * If necessary, recomputes the cached geom bounds. If the bounds are not * invalid, then this method is a no-op. */ void updateGeomBounds() { if (geomBoundsInvalid) { ! geomBounds = NodeHelper.computeGeomBounds(this, geomBounds, BaseTransform.IDENTITY_TRANSFORM); geomBoundsInvalid = false; } } /**
*** 3719,3735 **** txBounds = getLocalBounds(txBounds, localToParentTx); txBoundsInvalid = false; } } - /** - * @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 abstract boolean impl_computeContains(double localX, double localY); - /* * Bounds Invalidation And Notification * * The goal of this section is to efficiently propagate bounds * invalidation through the scenegraph while also being semantically --- 3829,3838 ----
*** 3740,3756 **** * number of requestLayout() calls that are performed when layout bounds * change. Before diving into layout bounds, I will first describe how * normal bounds invalidation occurs. * * When a node's geometry changes (for example, if the width of a ! * Rectangle is changed) then the Node must call impl_geomChanged(). * Invoking this function will eventually clear all cached bounds and * notify to each parent up the tree that their bounds may have changed. * * After invalidating geomBounds (and after kicking off layout bounds ! * notification), impl_geomChanged calls localBoundsChanged(). It should ! * be noted that impl_geomChanged should only be called when the geometry * of the node has changed such that it may result in the geom bounds * actually changing. * * localBoundsChanged() simply invalidates boundsInLocal and then calls * transformedBoundsChanged(). --- 3843,3859 ---- * number of requestLayout() calls that are performed when layout bounds * change. Before diving into layout bounds, I will first describe how * normal bounds invalidation occurs. * * When a node's geometry changes (for example, if the width of a ! * Rectangle is changed) then the Node must call NodeHelper.geomChanged(). * Invoking this function will eventually clear all cached bounds and * notify to each parent up the tree that their bounds may have changed. * * After invalidating geomBounds (and after kicking off layout bounds ! * notification), NodeHelper.geomChanged calls localBoundsChanged(). It should ! * be noted that NodeHelper.geomChanged should only be called when the geometry * of the node has changed such that it may result in the geom bounds * actually changing. * * localBoundsChanged() simply invalidates boundsInLocal and then calls * transformedBoundsChanged().
*** 3758,3768 **** * transformedBoundsChanged() is responsible for invalidating * boundsInParent and txBounds. If the Node is not visible, then there is * no need to notify the parent of the bounds change because the parent's * bounds do not include invisible nodes. If the node is visible, then * it must tell the parent that this child node's bounds have changed. ! * It is up to the parent to eventually invoke its own impl_geomChanged * function. If instead of a parent this node has a clipParent, then the * clipParent's localBoundsChanged() is called instead. * * There are a few other ways in which we enter the invalidate steps * beyond just the geometry changes. If the visibility of a Node changes, --- 3861,3871 ---- * transformedBoundsChanged() is responsible for invalidating * boundsInParent and txBounds. If the Node is not visible, then there is * no need to notify the parent of the bounds change because the parent's * bounds do not include invisible nodes. If the node is visible, then * it must tell the parent that this child node's bounds have changed. ! * It is up to the parent to eventually invoke its own NodeHelper.geomChanged * function. If instead of a parent this node has a clipParent, then the * clipParent's localBoundsChanged() is called instead. * * There are a few other ways in which we enter the invalidate steps * beyond just the geometry changes. If the visibility of a Node changes,
*** 3786,3799 **** * must be invalidated. However in subclasses, especially Resizables, * the layout bounds may not be defined to be the same as the geometric * bounds. This is both useful and provides a very nice performance * optimization for regions and controls. In this case, subclasses * need some way to interpose themselves such that a call to ! * impl_geomChanged() *does not* invalidate the layout bounds. * * This interposition happens by providing the ! * impl_notifyLayoutBoundsChanged function. The default implementation * simply invalidates boundsInLocal. Subclasses (such as Region and * Control) can override this function so that it does not invalidate * the layout bounds. * * An on invalidate trigger on layoutBounds handles kicking off the rest --- 3889,3902 ---- * must be invalidated. However in subclasses, especially Resizables, * the layout bounds may not be defined to be the same as the geometric * bounds. This is both useful and provides a very nice performance * optimization for regions and controls. In this case, subclasses * need some way to interpose themselves such that a call to ! * NodeHelper.geomChanged() *does not* invalidate the layout bounds. * * This interposition happens by providing the ! * NodeHelper.notifyLayoutBoundsChanged function. The default implementation * simply invalidates boundsInLocal. Subclasses (such as Region and * Control) can override this function so that it does not invalidate * the layout bounds. * * An on invalidate trigger on layoutBounds handles kicking off the rest
*** 3804,3848 **** * a Region and if the Node is being managed by the Region, then * we must call requestLayout on the Region whenever the layout bounds * have changed. */ ! /** * Invoked by subclasses whenever their geometric bounds have changed. * Because the default layout bounds is based on the node geometry, this ! * function will invoke impl_notifyLayoutBoundsChanged. The default ! * implementation of impl_notifyLayoutBoundsChanged() will simply invalidate * layoutBounds. Resizable subclasses will want to override this function * in most cases to be a no-op. ! * <p> * This function will also invalidate the cached geom bounds, and then * invoke localBoundsChanged() which will eventually end up invoking a * chain of functions up the tree to ensure that each parent of this * Node is notified that its bounds may have also changed. ! * <p> * This function should be treated as though it were final. It is not * intended to be overridden by subclasses. * ! * @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 void impl_geomChanged() { if (geomBoundsInvalid) { // GeomBoundsInvalid is false when node geometry changed and // the untransformed node bounds haven't been recalculated yet. // Most of the time, the recalculation of layout and transformed // node bounds don't require validation of untransformed bounds // and so we can not skip the following notifications. ! impl_notifyLayoutBoundsChanged(); transformedBoundsChanged(); return; } geomBounds.makeEmpty(); geomBoundsInvalid = true; NodeHelper.markDirty(this, DirtyBits.NODE_BOUNDS); ! impl_notifyLayoutBoundsChanged(); localBoundsChanged(); } private boolean geomBoundsInvalid = true; private boolean localBoundsInvalid = true; --- 3907,3949 ---- * a Region and if the Node is being managed by the Region, then * we must call requestLayout on the Region whenever the layout bounds * have changed. */ ! /* * Invoked by subclasses whenever their geometric bounds have changed. * Because the default layout bounds is based on the node geometry, this ! * function will invoke NodeHelper.notifyLayoutBoundsChanged. The default ! * implementation of NodeHelper.notifyLayoutBoundsChanged() will simply invalidate * layoutBounds. Resizable subclasses will want to override this function * in most cases to be a no-op. ! * * This function will also invalidate the cached geom bounds, and then * invoke localBoundsChanged() which will eventually end up invoking a * chain of functions up the tree to ensure that each parent of this * Node is notified that its bounds may have also changed. ! * * This function should be treated as though it were final. It is not * intended to be overridden by subclasses. * ! * Note: This method MUST only be called via its accessor method. */ ! private void doGeomChanged() { if (geomBoundsInvalid) { // GeomBoundsInvalid is false when node geometry changed and // the untransformed node bounds haven't been recalculated yet. // Most of the time, the recalculation of layout and transformed // node bounds don't require validation of untransformed bounds // and so we can not skip the following notifications. ! NodeHelper.notifyLayoutBoundsChanged(this); transformedBoundsChanged(); return; } geomBounds.makeEmpty(); geomBoundsInvalid = true; NodeHelper.markDirty(this, DirtyBits.NODE_BOUNDS); ! NodeHelper.notifyLayoutBoundsChanged(this); localBoundsChanged(); } private boolean geomBoundsInvalid = true; private boolean localBoundsInvalid = true;
*** 3875,3897 **** if (isVisible()) { notifyParentOfBoundsChange(); } } ! /** ! * Invoked by impl_geomChanged(). Since layoutBounds is by default based * on the geometric bounds, the default implementation of this function will * invalidate the layoutBounds. Resizable Node subclasses generally base * layoutBounds on the width/height instead of the geometric bounds, and so * will generally want to override this function to be a no-op. * ! * @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 void impl_notifyLayoutBoundsChanged() { ! impl_layoutBoundsChanged(); // notify the parent // Group instanceof check a little hoaky, but it allows us to disable // unnecessary layout for the case of a non-resizable within a group Parent p = getParent(); --- 3976,3996 ---- if (isVisible()) { notifyParentOfBoundsChange(); } } ! /* ! * Invoked by geomChanged(). Since layoutBounds is by default based * on the geometric bounds, the default implementation of this function will * invalidate the layoutBounds. Resizable Node subclasses generally base * layoutBounds on the width/height instead of the geometric bounds, and so * will generally want to override this function to be a no-op. * ! * Note: This method MUST only be called via its accessor method. */ ! private void doNotifyLayoutBoundsChanged() { ! layoutBoundsChanged(); // notify the parent // Group instanceof check a little hoaky, but it allows us to disable // unnecessary layout for the case of a non-resizable within a group Parent p = getParent();
*** 3937,3963 **** * this {@code Node}. Note that this method does not take visibility into * account; the test is based on the geometry of this {@code Node} only. */ public boolean contains(double localX, double localY) { if (containsBounds(localX, localY)) { ! return (isPickOnBounds() || impl_computeContains(localX, localY)); } return false; } ! /** * This method only does the contains check based on the bounds, clip and * effect of this node, excluding its shape (or geometry). * * Returns true if the given point (specified in the local * coordinate space of this {@code Node}) is contained within the bounds, * clip and effect of this node. - * @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 boolean containsBounds(double localX, double localY) { final TempState tempState = TempState.getInstance(); BaseBounds tempBounds = tempState.bounds; // first, we do a quick test to see if the point is contained in // our local bounds. If so, then we will go the next step and check --- 4036,4059 ---- * this {@code Node}. Note that this method does not take visibility into * account; the test is based on the geometry of this {@code Node} only. */ public boolean contains(double localX, double localY) { if (containsBounds(localX, localY)) { ! return (isPickOnBounds() || NodeHelper.computeContains(this, localX, localY)); } return false; } ! /* * This method only does the contains check based on the bounds, clip and * effect of this node, excluding its shape (or geometry). * * Returns true if the given point (specified in the local * coordinate space of this {@code Node}) is contained within the bounds, * clip and effect of this node. */ ! private boolean containsBounds(double localX, double localY) { final TempState tempState = TempState.getInstance(); BaseBounds tempBounds = tempState.bounds; // first, we do a quick test to see if the point is contained in // our local bounds. If so, then we will go the next step and check
*** 4748,4810 **** updateLocalToParentTransform(); tx.setTransform(localToParentTx); return tx; } ! /** * Currently used only by PathTransition - * @treatAsPrivate implementation detail - * @deprecated This is an internal API that is not intended for use and will be removed in the next version */ ! @Deprecated ! public final BaseTransform impl_getLeafTransform() { return getLocalToParentTransform(TempState.getInstance().leafTx); } ! /** * Invoked whenever the transforms[] ObservableList changes, or by the transforms * in that ObservableList whenever they are changed. ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version */ ! @Deprecated ! public void impl_transformsChanged() { if (!transformDirty) { NodeHelper.markDirty(this, DirtyBits.NODE_TRANSFORM); transformDirty = true; transformedBoundsChanged(); } invalidateLocalToParentTransform(); invalidateLocalToSceneTransform(); } ! /** ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version ! */ ! @Deprecated ! public final double impl_getPivotX() { final Bounds bounds = getLayoutBounds(); return bounds.getMinX() + bounds.getWidth()/2; } ! /** ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version ! */ ! @Deprecated ! public final double impl_getPivotY() { final Bounds bounds = getLayoutBounds(); return bounds.getMinY() + bounds.getHeight()/2; } ! /** ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version ! */ ! @Deprecated ! public final double impl_getPivotZ() { final Bounds bounds = getLayoutBounds(); return bounds.getMinZ() + bounds.getDepth()/2; } /** --- 4844,4887 ---- updateLocalToParentTransform(); tx.setTransform(localToParentTx); return tx; } ! /* * Currently used only by PathTransition */ ! final BaseTransform getLeafTransform() { return getLocalToParentTransform(TempState.getInstance().leafTx); } ! /* * Invoked whenever the transforms[] ObservableList changes, or by the transforms * in that ObservableList whenever they are changed. ! * ! * Note: This method MUST only be called via its accessor method. */ ! private void doTransformsChanged() { if (!transformDirty) { NodeHelper.markDirty(this, DirtyBits.NODE_TRANSFORM); transformDirty = true; transformedBoundsChanged(); } invalidateLocalToParentTransform(); invalidateLocalToSceneTransform(); } ! final double getPivotX() { final Bounds bounds = getLayoutBounds(); return bounds.getMinX() + bounds.getWidth()/2; } ! final double getPivotY() { final Bounds bounds = getLayoutBounds(); return bounds.getMinY() + bounds.getHeight()/2; } ! final double getPivotZ() { final Bounds bounds = getLayoutBounds(); return bounds.getMinZ() + bounds.getDepth()/2; } /**
*** 4822,4832 **** if ((sceneValue != null) && (sceneValue.getRoot() == this)) { // handle scene mirroring in this branch // (must be the last transformation) mirroringCenter = sceneValue.getWidth() / 2; if (mirroringCenter == 0.0) { ! mirroringCenter = impl_getPivotX(); } localToParentTx = localToParentTx.deriveWithTranslation( mirroringCenter, 0.0); localToParentTx = localToParentTx.deriveWithScale( --- 4899,4909 ---- if ((sceneValue != null) && (sceneValue.getRoot() == this)) { // handle scene mirroring in this branch // (must be the last transformation) mirroringCenter = sceneValue.getWidth() / 2; if (mirroringCenter == 0.0) { ! mirroringCenter = getPivotX(); } localToParentTx = localToParentTx.deriveWithTranslation( mirroringCenter, 0.0); localToParentTx = localToParentTx.deriveWithScale(
*** 4834,4852 **** localToParentTx = localToParentTx.deriveWithTranslation( -mirroringCenter, 0.0); } else { // mirror later mirror = true; ! mirroringCenter = impl_getPivotX(); } } if (getScaleX() != 1 || getScaleY() != 1 || getScaleZ() != 1 || getRotate() != 0) { // recompute pivotX, pivotY and pivotZ ! double pivotX = impl_getPivotX(); ! double pivotY = impl_getPivotY(); ! double pivotZ = impl_getPivotZ(); localToParentTx = localToParentTx.deriveWithTranslation( getTranslateX() + getLayoutX() + pivotX, getTranslateY() + getLayoutY() + pivotY, getTranslateZ() + pivotZ); --- 4911,4929 ---- localToParentTx = localToParentTx.deriveWithTranslation( -mirroringCenter, 0.0); } else { // mirror later mirror = true; ! mirroringCenter = getPivotX(); } } if (getScaleX() != 1 || getScaleY() != 1 || getScaleZ() != 1 || getRotate() != 0) { // recompute pivotX, pivotY and pivotZ ! double pivotX = getPivotX(); ! double pivotY = getPivotY(); ! double pivotZ = getPivotZ(); localToParentTx = localToParentTx.deriveWithTranslation( getTranslateX() + getLayoutX() + pivotX, getTranslateY() + getLayoutY() + pivotY, getTranslateZ() + pivotZ);
*** 4862,4872 **** getTranslateX() + getLayoutX(), getTranslateY() + getLayoutY(), getTranslateZ()); } ! if (impl_hasTransforms()) { for (Transform t : getTransforms()) { localToParentTx = TransformHelper.derive(t, localToParentTx); } } --- 4939,4949 ---- getTranslateX() + getLayoutX(), getTranslateY() + getLayoutY(), getTranslateZ()); } ! if (hasTransforms()) { for (Transform t : getTransforms()) { localToParentTx = TransformHelper.derive(t, localToParentTx); } }
*** 4944,4974 **** void localToParent(com.sun.javafx.geom.Vec3d pt) { updateLocalToParentTransform(); localToParentTx.transform(pt, pt); } ! /** * Finds a top-most child node that contains the given local coordinates. * * The result argument is used for storing the picking result. ! * @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 void impl_pickNodeLocal(PickRay localPickRay, PickResultChooser result) { ! impl_intersects(localPickRay, result); } ! /** * Finds a top-most child node that intersects the given ray. * * The result argument is used for storing the picking result. - * @treatAsPrivate implementation detail - * @deprecated This is an internal API that is not intended for use and will be removed in the next version */ ! @Deprecated ! public final void impl_pickNode(PickRay pickRay, PickResultChooser result) { // In some conditions we can omit picking this node or subgraph if (!isVisible() || isDisable() || isMouseTransparent()) { return; } --- 5021,5047 ---- void localToParent(com.sun.javafx.geom.Vec3d pt) { updateLocalToParentTransform(); localToParentTx.transform(pt, pt); } ! /* * Finds a top-most child node that contains the given local coordinates. * * The result argument is used for storing the picking result. ! * ! * Note: This method MUST only be called via its accessor method. */ ! private void doPickNodeLocal(PickRay localPickRay, PickResultChooser result) { ! intersects(localPickRay, result); } ! /* * Finds a top-most child node that intersects the given ray. * * The result argument is used for storing the picking result. */ ! final void pickNode(PickRay pickRay, PickResultChooser result) { // In some conditions we can omit picking this node or subgraph if (!isVisible() || isDisable() || isMouseTransparent()) { return; }
*** 4988,5007 **** localToParentTx.inverseDeltaTransform(d, d); // Delegate to a function which can be overridden by subclasses which // actually does the pick. The implementation is markedly different // for leaf nodes vs. parent nodes vs. region nodes. ! impl_pickNodeLocal(pickRay, result); } catch (NoninvertibleTransformException e) { // in this case we just don't pick anything } pickRay.setOrigin(ox, oy, oz); pickRay.setDirection(dx, dy, dz); } ! /** * Returns {@code true} if the given ray (start, dir), specified in the * local coordinate space of this {@code Node}, intersects the * shape of this {@code Node}. Note that this method does not take visibility * into account; the test is based on the geometry of this {@code Node} only. * <p> --- 5061,5080 ---- localToParentTx.inverseDeltaTransform(d, d); // Delegate to a function which can be overridden by subclasses which // actually does the pick. The implementation is markedly different // for leaf nodes vs. parent nodes vs. region nodes. ! NodeHelper.pickNodeLocal(this, pickRay, result); } catch (NoninvertibleTransformException e) { // in this case we just don't pick anything } pickRay.setOrigin(ox, oy, oz); pickRay.setDirection(dx, dy, dz); } ! /* * Returns {@code true} if the given ray (start, dir), specified in the * local coordinate space of this {@code Node}, intersects the * shape of this {@code Node}. Note that this method does not take visibility * into account; the test is based on the geometry of this {@code Node} only. * <p>
*** 5009,5050 **** * the currently held one. * <p> * Note that this is a conditional feature. See * {@link javafx.application.ConditionalFeature#SCENE3D ConditionalFeature.SCENE3D} * for more information. - * - * @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 final boolean impl_intersects(PickRay pickRay, PickResultChooser pickResult) { ! double boundsDistance = impl_intersectsBounds(pickRay); if (!Double.isNaN(boundsDistance)) { if (isPickOnBounds()) { if (pickResult != null) { pickResult.offer(this, boundsDistance, PickResultChooser.computePoint(pickRay, boundsDistance)); } return true; } else { ! return impl_computeIntersects(pickRay, pickResult); } } return false; } ! /** * Computes the intersection of the pickRay with this node. * The pickResult argument is updated if the found intersection * is closer than the passed one. On the other hand, the return value * specifies whether the intersection exists, regardless of its comparison * with the given pickResult. - * - * @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 boolean impl_computeIntersects(PickRay pickRay, PickResultChooser pickResult) { double origZ = pickRay.getOriginNoClone().z; double dirZ = pickRay.getDirectionNoClone().z; // Handle the case where pickRay is almost parallel to the Z-plane if (almostZero(dirZ)) { return false; --- 5082,5115 ---- * the currently held one. * <p> * Note that this is a conditional feature. See * {@link javafx.application.ConditionalFeature#SCENE3D ConditionalFeature.SCENE3D} * for more information. */ ! final boolean intersects(PickRay pickRay, PickResultChooser pickResult) { ! double boundsDistance = intersectsBounds(pickRay); if (!Double.isNaN(boundsDistance)) { if (isPickOnBounds()) { if (pickResult != null) { pickResult.offer(this, boundsDistance, PickResultChooser.computePoint(pickRay, boundsDistance)); } return true; } else { ! return NodeHelper.computeIntersects(this, pickRay, pickResult); } } return false; } ! /* * Computes the intersection of the pickRay with this node. * The pickResult argument is updated if the found intersection * is closer than the passed one. On the other hand, the return value * specifies whether the intersection exists, regardless of its comparison * with the given pickResult. */ ! private boolean doComputeIntersects(PickRay pickRay, PickResultChooser pickResult) { double origZ = pickRay.getOriginNoClone().z; double dirZ = pickRay.getDirectionNoClone().z; // Handle the case where pickRay is almost parallel to the Z-plane if (almostZero(dirZ)) { return false;
*** 5063,5086 **** return true; } return false; } ! /** * Computes the intersection of the pickRay with the bounds of this node. * The return value is the distance between the camera and the intersection * point, measured in pickRay direction magnitudes. If there is * no intersection, it returns NaN. * * @param pickRay The pick ray * @return Distance of the intersection point, a NaN if there * is no intersection - * @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 final double impl_intersectsBounds(PickRay pickRay) { final Vec3d dir = pickRay.getDirectionNoClone(); double tmin, tmax; final Vec3d origin = pickRay.getOriginNoClone(); --- 5128,5148 ---- return true; } return false; } ! /* * Computes the intersection of the pickRay with the bounds of this node. * The return value is the distance between the camera and the intersection * point, measured in pickRay direction magnitudes. If there is * no intersection, it returns NaN. * * @param pickRay The pick ray * @return Distance of the intersection point, a NaN if there * is no intersection */ ! final double intersectsBounds(PickRay pickRay) { final Vec3d dir = pickRay.getDirectionNoClone(); double tmin, tmax; final Vec3d origin = pickRay.getOriginNoClone();
*** 5227,5237 **** clip.localToParentTx.inverseTransform(origin, origin); clip.localToParentTx.inverseDeltaTransform(dir, dir); } catch (NoninvertibleTransformException e) { hitClip = false; } ! hitClip = hitClip && clip.impl_intersects(pickRay, null); pickRay.setOrigin(originX, originY, originZ); pickRay.setDirection(dirX, dirY, dirZ); if (!hitClip) { return Double.NaN; --- 5289,5299 ---- clip.localToParentTx.inverseTransform(origin, origin); clip.localToParentTx.inverseDeltaTransform(dir, dir); } catch (NoninvertibleTransformException e) { hitClip = false; } ! hitClip = hitClip && clip.intersects(pickRay, null); pickRay.setOrigin(originX, originY, originZ); pickRay.setDirection(dirX, dirY, dirZ); if (!hitClip) { return Double.NaN;
*** 5627,5642 **** } return nodeTransformation; } ! /** ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version ! */ ! @Deprecated ! public boolean impl_hasTransforms() { return (nodeTransformation != null) && nodeTransformation.hasTransforms(); } // for tests only --- 5689,5699 ---- } return nodeTransformation; } ! private boolean hasTransforms() { return (nodeTransformation != null) && nodeTransformation.hasTransforms(); } // for tests only
*** 5890,5900 **** public final DoubleProperty translateXProperty() { if (translateX == null) { translateX = new StyleableDoubleProperty(DEFAULT_TRANSLATE_X) { @Override public void invalidated() { ! impl_transformsChanged(); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.TRANSLATE_X; --- 5947,5957 ---- public final DoubleProperty translateXProperty() { if (translateX == null) { translateX = new StyleableDoubleProperty(DEFAULT_TRANSLATE_X) { @Override public void invalidated() { ! NodeHelper.transformsChanged(Node.this); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.TRANSLATE_X;
*** 5921,5931 **** public final DoubleProperty translateYProperty() { if (translateY == null) { translateY = new StyleableDoubleProperty(DEFAULT_TRANSLATE_Y) { @Override public void invalidated() { ! impl_transformsChanged(); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.TRANSLATE_Y; --- 5978,5988 ---- public final DoubleProperty translateYProperty() { if (translateY == null) { translateY = new StyleableDoubleProperty(DEFAULT_TRANSLATE_Y) { @Override public void invalidated() { ! NodeHelper.transformsChanged(Node.this); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.TRANSLATE_Y;
*** 5952,5962 **** public final DoubleProperty translateZProperty() { if (translateZ == null) { translateZ = new StyleableDoubleProperty(DEFAULT_TRANSLATE_Z) { @Override public void invalidated() { ! impl_transformsChanged(); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.TRANSLATE_Z; --- 6009,6019 ---- public final DoubleProperty translateZProperty() { if (translateZ == null) { translateZ = new StyleableDoubleProperty(DEFAULT_TRANSLATE_Z) { @Override public void invalidated() { ! NodeHelper.transformsChanged(Node.this); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.TRANSLATE_Z;
*** 5983,5993 **** public final DoubleProperty scaleXProperty() { if (scaleX == null) { scaleX = new StyleableDoubleProperty(DEFAULT_SCALE_X) { @Override public void invalidated() { ! impl_transformsChanged(); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.SCALE_X; --- 6040,6050 ---- public final DoubleProperty scaleXProperty() { if (scaleX == null) { scaleX = new StyleableDoubleProperty(DEFAULT_SCALE_X) { @Override public void invalidated() { ! NodeHelper.transformsChanged(Node.this); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.SCALE_X;
*** 6014,6024 **** public final DoubleProperty scaleYProperty() { if (scaleY == null) { scaleY = new StyleableDoubleProperty(DEFAULT_SCALE_Y) { @Override public void invalidated() { ! impl_transformsChanged(); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.SCALE_Y; --- 6071,6081 ---- public final DoubleProperty scaleYProperty() { if (scaleY == null) { scaleY = new StyleableDoubleProperty(DEFAULT_SCALE_Y) { @Override public void invalidated() { ! NodeHelper.transformsChanged(Node.this); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.SCALE_Y;
*** 6045,6055 **** public final DoubleProperty scaleZProperty() { if (scaleZ == null) { scaleZ = new StyleableDoubleProperty(DEFAULT_SCALE_Z) { @Override public void invalidated() { ! impl_transformsChanged(); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.SCALE_Z; --- 6102,6112 ---- public final DoubleProperty scaleZProperty() { if (scaleZ == null) { scaleZ = new StyleableDoubleProperty(DEFAULT_SCALE_Z) { @Override public void invalidated() { ! NodeHelper.transformsChanged(Node.this); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.SCALE_Z;
*** 6076,6086 **** public final DoubleProperty rotateProperty() { if (rotate == null) { rotate = new StyleableDoubleProperty(DEFAULT_ROTATE) { @Override public void invalidated() { ! impl_transformsChanged(); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.ROTATE; --- 6133,6143 ---- public final DoubleProperty rotateProperty() { if (rotate == null) { rotate = new StyleableDoubleProperty(DEFAULT_ROTATE) { @Override public void invalidated() { ! NodeHelper.transformsChanged(Node.this); } @Override public CssMetaData getCssMetaData() { return StyleableProperties.ROTATE;
*** 6109,6119 **** if (rotationAxis == null) { rotationAxis = new ObjectPropertyBase<Point3D>( DEFAULT_ROTATION_AXIS) { @Override protected void invalidated() { ! impl_transformsChanged(); } @Override public Object getBean() { return Node.this; --- 6166,6176 ---- if (rotationAxis == null) { rotationAxis = new ObjectPropertyBase<Point3D>( DEFAULT_ROTATION_AXIS) { @Override protected void invalidated() { ! NodeHelper.transformsChanged(Node.this); } @Override public Object getBean() { return Node.this;
*** 6140,6150 **** for (Transform t : c.getAddedSubList()) { TransformHelper.add(t, Node.this); } } ! impl_transformsChanged(); } }; } return transforms; --- 6197,6207 ---- for (Transform t : c.getAddedSubList()) { TransformHelper.add(t, Node.this); } } ! NodeHelper.transformsChanged(Node.this); } }; } return transforms;
*** 6333,6343 **** final void parentResolvedOrientationInvalidated() { if (getNodeOrientation() == NodeOrientation.INHERIT) { nodeResolvedOrientationInvalidated(); } else { // mirroring changed ! impl_transformsChanged(); } } final void nodeResolvedOrientationInvalidated() { final byte oldResolvedNodeOrientation = --- 6390,6400 ---- final void parentResolvedOrientationInvalidated() { if (getNodeOrientation() == NodeOrientation.INHERIT) { nodeResolvedOrientationInvalidated(); } else { // mirroring changed ! NodeHelper.transformsChanged(this); } } final void nodeResolvedOrientationInvalidated() { final byte oldResolvedNodeOrientation =
*** 6353,6363 **** oldResolvedNodeOrientation))) { effectiveNodeOrientationProperty.invalidate(); } // mirroring changed ! impl_transformsChanged(); if (resolvedNodeOrientation != oldResolvedNodeOrientation) { nodeResolvedOrientationChanged(); } } --- 6410,6420 ---- oldResolvedNodeOrientation))) { effectiveNodeOrientationProperty.invalidate(); } // mirroring changed ! NodeHelper.transformsChanged(this); if (resolvedNodeOrientation != oldResolvedNodeOrientation) { nodeResolvedOrientationChanged(); } }
*** 8050,8065 **** /** * Traverses from this node in the direction indicated. Note that this * node need not actually have the focus, nor need it be focusTraversable. * However, the node must be part of a scene, otherwise this request * is ignored. - * - * @treatAsPrivate implementation detail - * @deprecated This is an internal API that is not intended for use and will be removed in the next version */ ! @Deprecated ! public final boolean impl_traverse(Direction dir) { if (getScene() == null) { return false; } return getScene().traverse(this, dir); } --- 8107,8118 ---- /** * Traverses from this node in the direction indicated. Note that this * node need not actually have the focus, nor need it be focusTraversable. * However, the node must be part of a scene, otherwise this request * is ignored. */ ! final boolean traverse(Direction dir) { if (getScene() == null) { return false; } return getScene().traverse(this, dir); }
*** 8151,8166 **** boolean isTreeVisible = isVisible(); final Node parentNode = getParent() != null ? getParent() : clipParent != null ? clipParent : getSubScene() != null ? getSubScene() : null; if (isTreeVisible) { ! isTreeVisible = parentNode == null || parentNode.impl_isTreeVisible(); } // When the parent has changed to visible and we have unsynchornized visibility, // we have to synchronize, because the rendering will now pass throught the newly-visible parent // Otherwise an invisible Node might get rendered ! if (parentChanged && parentNode != null && parentNode.impl_isTreeVisible() && isDirty(DirtyBits.NODE_VISIBLE)) { addToSceneDirtyList(); } setTreeVisible(isTreeVisible); } --- 8204,8219 ---- boolean isTreeVisible = isVisible(); final Node parentNode = getParent() != null ? getParent() : clipParent != null ? clipParent : getSubScene() != null ? getSubScene() : null; if (isTreeVisible) { ! isTreeVisible = parentNode == null || NodeHelper.isTreeVisible(parentNode); } // When the parent has changed to visible and we have unsynchornized visibility, // we have to synchronize, because the rendering will now pass throught the newly-visible parent // Otherwise an invisible Node might get rendered ! if (parentChanged && parentNode != null && parentNode.isTreeVisible() && isDirty(DirtyBits.NODE_VISIBLE)) { addToSceneDirtyList(); } setTreeVisible(isTreeVisible); }
*** 8177,8187 **** getClip().updateTreeVisible(true); } if (treeVisible && !isDirtyEmpty()) { addToSceneDirtyList(); } ! ((TreeVisiblePropertyReadOnly)impl_treeVisibleProperty()).invalidate(); if (Node.this instanceof SubScene) { Node subSceneRoot = ((SubScene)Node.this).getRoot(); if (subSceneRoot != null) { // SubScene.getRoot() is only null if it's constructor // has not finished. --- 8230,8240 ---- getClip().updateTreeVisible(true); } if (treeVisible && !isDirtyEmpty()) { addToSceneDirtyList(); } ! ((TreeVisiblePropertyReadOnly) treeVisibleProperty()).invalidate(); if (Node.this instanceof SubScene) { Node subSceneRoot = ((SubScene)Node.this).getRoot(); if (subSceneRoot != null) { // SubScene.getRoot() is only null if it's constructor // has not finished.
*** 8189,8213 **** } } } } ! /** ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version ! */ ! @Deprecated ! public final boolean impl_isTreeVisible() { ! return impl_treeVisibleProperty().get(); } ! /** ! * @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 final BooleanExpression impl_treeVisibleProperty() { if (treeVisibleRO == null) { treeVisibleRO = new TreeVisiblePropertyReadOnly(); } return treeVisibleRO; } --- 8242,8256 ---- } } } } ! final boolean isTreeVisible() { ! return treeVisibleProperty().get(); } ! final BooleanExpression treeVisibleProperty() { if (treeVisibleRO == null) { treeVisibleRO = new TreeVisiblePropertyReadOnly(); } return treeVisibleRO; }
*** 8263,8273 **** } private void updateCanReceiveFocus() { setCanReceiveFocus(getScene() != null && !isDisabled() ! && impl_isTreeVisible()); } // for indenting messages based on scene-graph depth String indent() { String indent = ""; --- 8306,8316 ---- } private void updateCanReceiveFocus() { setCanReceiveFocus(getScene() != null && !isDisabled() ! && isTreeVisible()); } // for indenting messages based on scene-graph depth String indent() { String indent = "";
*** 8277,8324 **** p = p.getParent(); } return indent; } ! ! ! ! /** * Should we underline the mnemonic character? - * - * @treatAsPrivate implementation detail - * @deprecated This is an internal API that is not intended for use and will be removed in the next version */ ! @Deprecated ! private BooleanProperty impl_showMnemonics; ! /** ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version ! */ ! @Deprecated ! public final void impl_setShowMnemonics(boolean value) { ! impl_showMnemonicsProperty().set(value); } ! /** ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version ! */ ! @Deprecated ! public final boolean impl_isShowMnemonics() { ! return impl_showMnemonics == null ? false : impl_showMnemonics.get(); } ! /** ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version ! */ ! @Deprecated ! public final BooleanProperty impl_showMnemonicsProperty() { ! if (impl_showMnemonics == null) { ! impl_showMnemonics = new BooleanPropertyBase(false) { @Override protected void invalidated() { pseudoClassStateChanged(SHOW_MNEMONICS_PSEUDOCLASS_STATE, get()); } --- 8320,8345 ---- p = p.getParent(); } return indent; } ! /* * Should we underline the mnemonic character? */ ! private BooleanProperty showMnemonics; ! final void setShowMnemonics(boolean value) { ! showMnemonicsProperty().set(value); } ! final boolean isShowMnemonics() { ! return showMnemonics == null ? false : showMnemonics.get(); } ! final BooleanProperty showMnemonicsProperty() { ! if (showMnemonics == null) { ! showMnemonics = new BooleanPropertyBase(false) { @Override protected void invalidated() { pseudoClassStateChanged(SHOW_MNEMONICS_PSEUDOCLASS_STATE, get()); }
*** 8332,8342 **** public String getName() { return "showMnemonics"; } }; } ! return impl_showMnemonics; } /** * References a node that is a labelFor this node. --- 8353,8363 ---- public String getName() { return "showMnemonics"; } }; } ! return showMnemonics; } /** * References a node that is a labelFor this node.
*** 8645,8655 **** return null; } /** * Super-lazy instantiation pattern from Bill Pugh. - * @treatAsPrivate implementation detail */ private static class StyleableProperties { private static final CssMetaData<Node,Cursor> CURSOR = new CssMetaData<Node,Cursor>("-fx-cursor", CursorConverter.getInstance()) { --- 8666,8675 ----
*** 8940,9002 **** @Override public List<CssMetaData<? extends Styleable, ?>> getCssMetaData() { return getClassCssMetaData(); } ! /** * @return The Styles that match this CSS property for the given Node. The * list is sorted by descending specificity. - * @treatAsPrivate implementation detail - * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions */ ! @Deprecated // SB-dependency: RT-21096 has been filed to track this ! public static List<Style> impl_getMatchingStyles(CssMetaData cssMetaData, Styleable styleable) { return CssStyleHelper.getMatchingStyles(styleable, cssMetaData); } ! /** ! * RT-17293 ! * @treatAsPrivate implementation detail ! * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions ! */ ! @Deprecated // SB-dependency: RT-21096 has been filed to track this ! public final ObservableMap<StyleableProperty<?>, List<Style>> impl_getStyleMap() { ObservableMap<StyleableProperty<?>, List<Style>> map = (ObservableMap<StyleableProperty<?>, List<Style>>)getProperties().get("STYLEMAP"); Map<StyleableProperty<?>, List<Style>> ret = CssStyleHelper.getMatchingStyles(map, this); if (ret != null) { if (ret instanceof ObservableMap) return (ObservableMap)ret; return FXCollections.observableMap(ret); } return FXCollections.<StyleableProperty<?>, List<Style>>emptyObservableMap(); } ! /** * RT-17293 - * @treatAsPrivate implementation detail - * @deprecated This is an experimental API that is not intended for general use and is subject to change in future versions */ ! @Deprecated // SB-dependency: RT-21096 has been filed to track this ! public final void impl_setStyleMap(ObservableMap<StyleableProperty<?>, List<Style>> styleMap) { if (styleMap != null) getProperties().put("STYLEMAP", styleMap); else getProperties().remove("STYLEMAP"); } ! /** * Find CSS styles that were used to style this Node in its current pseudo-class state. The map will contain the styles from this node and, * if the node is a Parent, its children. The node corresponding to an entry in the Map can be obtained by casting a StyleableProperty key to a * javafx.beans.property.Property and calling getBean(). The List contains only those styles used to style the property and will contain * styles used to resolve lookup values. * * @param styleMap A Map to be populated with the styles. If null, a new Map will be allocated. * @return The Map populated with matching styles. - * - * @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-21096 has been filed to track this ! public Map<StyleableProperty<?>,List<Style>> impl_findStyles(Map<StyleableProperty<?>,List<Style>> styleMap) { Map<StyleableProperty<?>, List<Style>> ret = CssStyleHelper.getMatchingStyles(styleMap, this); return (ret != null) ? ret : Collections.<StyleableProperty<?>, List<Style>>emptyMap(); } --- 8960,9009 ---- @Override public List<CssMetaData<? extends Styleable, ?>> getCssMetaData() { return getClassCssMetaData(); } ! /* * @return The Styles that match this CSS property for the given Node. The * list is sorted by descending specificity. */ ! // SB-dependency: RT-21096 has been filed to track this ! static List<Style> getMatchingStyles(CssMetaData cssMetaData, Styleable styleable) { return CssStyleHelper.getMatchingStyles(styleable, cssMetaData); } ! final ObservableMap<StyleableProperty<?>, List<Style>> getStyleMap() { ObservableMap<StyleableProperty<?>, List<Style>> map = (ObservableMap<StyleableProperty<?>, List<Style>>)getProperties().get("STYLEMAP"); Map<StyleableProperty<?>, List<Style>> ret = CssStyleHelper.getMatchingStyles(map, this); if (ret != null) { if (ret instanceof ObservableMap) return (ObservableMap)ret; return FXCollections.observableMap(ret); } return FXCollections.<StyleableProperty<?>, List<Style>>emptyObservableMap(); } ! /* * RT-17293 */ ! // SB-dependency: RT-21096 has been filed to track this ! final void setStyleMap(ObservableMap<StyleableProperty<?>, List<Style>> styleMap) { if (styleMap != null) getProperties().put("STYLEMAP", styleMap); else getProperties().remove("STYLEMAP"); } ! /* * Find CSS styles that were used to style this Node in its current pseudo-class state. The map will contain the styles from this node and, * if the node is a Parent, its children. The node corresponding to an entry in the Map can be obtained by casting a StyleableProperty key to a * javafx.beans.property.Property and calling getBean(). The List contains only those styles used to style the property and will contain * styles used to resolve lookup values. * * @param styleMap A Map to be populated with the styles. If null, a new Map will be allocated. * @return The Map populated with matching styles. */ ! // SB-dependency: RT-21096 has been filed to track this ! Map<StyleableProperty<?>,List<Style>> findStyles(Map<StyleableProperty<?>,List<Style>> styleMap) { Map<StyleableProperty<?>, List<Style>> ret = CssStyleHelper.getMatchingStyles(styleMap, this); return (ret != null) ? ret : Collections.<StyleableProperty<?>, List<Style>>emptyMap(); }
*** 9019,9029 **** // If there is no scene, then we cannot make it dirty, so we'll leave // the flag alone if (getScene() == null) return; // Don't bother doing anything if the cssFlag is not CLEAN. // If the flag indicates a DIRTY_BRANCH, the flag needs to be changed ! // to UPDATE to ensure that impl_processCSS is called on the node. if (cssFlag == CssFlags.CLEAN || cssFlag == CssFlags.DIRTY_BRANCH) { cssFlag = CssFlags.UPDATE; notifyParentsOfInvalidatedCSS(); } } --- 9026,9036 ---- // If there is no scene, then we cannot make it dirty, so we'll leave // the flag alone if (getScene() == null) return; // Don't bother doing anything if the cssFlag is not CLEAN. // If the flag indicates a DIRTY_BRANCH, the flag needs to be changed ! // to UPDATE to ensure that NodeHelper.processCSS is called on the node. if (cssFlag == CssFlags.CLEAN || cssFlag == CssFlags.DIRTY_BRANCH) { cssFlag = CssFlags.UPDATE; notifyParentsOfInvalidatedCSS(); } }
*** 9112,9127 **** _parent = null; } } } ! /** ! * @treatAsPrivate implementation detail ! * @deprecated This is an internal API that is not intended for use and will be removed in the next version ! */ ! @Deprecated ! public final void impl_reapplyCSS() { if (getScene() == null) return; if (cssFlag == CssFlags.REAPPLY) return; --- 9119,9129 ---- _parent = null; } } } ! final void reapplyCSS() { if (getScene() == null) return; if (cssFlag == CssFlags.REAPPLY) return;
*** 9142,9152 **** // it determines that it needs to. In such situations we must // apply the CSS immediately and not add it to the scene's queue // for deferred action. // if (getParent() != null && getParent().isPerformingLayout()) { ! impl_processCSS(); } else { notifyParentsOfInvalidatedCSS(); } } --- 9144,9154 ---- // it determines that it needs to. In such situations we must // apply the CSS immediately and not add it to the scene's queue // for deferred action. // if (getParent() != null && getParent().isPerformingLayout()) { ! NodeHelper.processCSS(this); } else { notifyParentsOfInvalidatedCSS(); } }
*** 9183,9193 **** styleHelper == null || // if the styleHelper changed, then we definitely need to visit the children // since the new styles may have an effect on the children's styles calculated values. (oldStyleHelper != styleHelper) || // If our parent is null, then we're the root of a scene or sub-scene, most likely, ! // and we'll visit children because elsewhere the code depends on root.impl_reapplyCSS() // to force css to be reapplied (whether it needs to be or not). (getParent() == null) || // If our parent's cssFlag is other than clean, then the parent may have just had // CSS reapplied. If the parent just had CSS reapplied, then some of its styles // may affect my children's styles. --- 9185,9195 ---- styleHelper == null || // if the styleHelper changed, then we definitely need to visit the children // since the new styles may have an effect on the children's styles calculated values. (oldStyleHelper != styleHelper) || // If our parent is null, then we're the root of a scene or sub-scene, most likely, ! // and we'll visit children because elsewhere the code depends on root.reapplyCSS() // to force css to be reapplied (whether it needs to be or not). (getParent() == null) || // If our parent's cssFlag is other than clean, then the parent may have just had // CSS reapplied. If the parent just had CSS reapplied, then some of its styles // may affect my children's styles.
*** 9240,9250 **** break; } case REAPPLY: case UPDATE: default: ! impl_processCSS(); } } /** * If required, apply styles to this Node and its children, if any. This method does not normally need to --- 9242,9252 ---- break; } case REAPPLY: case UPDATE: default: ! NodeHelper.processCSS(this); } } /** * If required, apply styles to this Node and its children, if any. This method does not normally need to
*** 9331,9354 **** topMost.processCSS(); } ! /** * If invoked, will update styles from here on down. This method should not be called directly. If ! * overridden, the overriding method must at some point call {@code super.impl_processCSS()} to ensure that * this Node's CSS state is properly updated. * * Note that the difference between this method and {@link #applyCss()} is that this method * updates styles for this node on down; whereas, {@code applyCss()} looks for the top-most ancestor that needs * CSS update and apply styles from that node on down. * ! * @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 ! protected void impl_processCSS() { // Nothing to do... if (cssFlag == CssFlags.CLEAN) return; // if REAPPLY was deferred, process it now... --- 9333,9354 ---- topMost.processCSS(); } ! /* * If invoked, will update styles from here on down. This method should not be called directly. If ! * overridden, the overriding method must at some point call {@code super.processCSSImpl} to ensure that * this Node's CSS state is properly updated. * * Note that the difference between this method and {@link #applyCss()} is that this method * updates styles for this node on down; whereas, {@code applyCss()} looks for the top-most ancestor that needs * CSS update and apply styles from that node on down. * ! * Note: This method MUST only be called via its accessor method. */ ! private void doProcessCSS() { // Nothing to do... if (cssFlag == CssFlags.CLEAN) return; // if REAPPLY was deferred, process it now...
*** 9497,9518 **** } private static final BoundsAccessor boundsAccessor = (bounds, tx, node) -> node.getGeomBounds(bounds, tx); /** - * This method is used by Scene-graph JMX bean to obtain the Scene-graph structure. - * - * @param alg current algorithm to process this node - * @param ctx current context - * @return the algorithm specific result for this node - * @treatAsPrivate implementation detail - * @deprecated This is an internal API that is not intended for use and will be removed in the next version - */ - @Deprecated - public abstract Object impl_processMXNode(MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx); - - /** * The accessible role for this {@code Node}. * <p> * The screen reader uses the role of a node to determine the * attributes and actions that are supported. * --- 9497,9506 ----
< prev index next >