< prev index next >
modules/graphics/src/main/java/javafx/scene/Node.java
Print this page
@@ -416,10 +416,52 @@
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,15 +473,72 @@
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,10 +558,37 @@
@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,36 +922,36 @@
@Override
protected void invalidated() {
if (oldParent != null) {
oldParent.disabledProperty().removeListener(parentDisabledChangedListener);
- oldParent.impl_treeVisibleProperty().removeListener(parentTreeVisibleChangedListener);
+ 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.impl_treeVisibleProperty().addListener(parentTreeVisibleChangedListener);
+ 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.
//
- impl_reapplyCSS();
+ 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
+ // 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,11 +1038,11 @@
}
focusSetDirty(oldScene);
focusSetDirty(newScene);
}
scenesChanged(newScene, newSubScene, oldScene, oldSubScene);
- if (sceneChanged && reapplyCSS) impl_reapplyCSS();
+ 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,11 +1174,11 @@
if (id == null) {
id = new StringPropertyBase() {
@Override
protected void invalidated() {
- impl_reapplyCSS();
+ reapplyCSS();
if (PrismSettings.printRenderGraph) {
NodeHelper.markDirty(Node.this, DirtyBits.DEBUG);
}
}
@@ -1081,11 +1207,11 @@
* @defaultValue null
*/
private ObservableList<String> styleClass = new TrackableObservableList<String>() {
@Override
protected void onChanged(Change<String> c) {
- impl_reapplyCSS();
+ reapplyCSS();
}
@Override
public String toString() {
if (size() == 0) {
@@ -1166,11 +1292,11 @@
@Override
protected void invalidated() {
// If the style has changed, then styles of this node
// and child nodes might be affected.
- impl_reapplyCSS();
+ reapplyCSS();
}
@Override
public Object getBean() {
return Node.this;
@@ -1211,11 +1337,11 @@
boolean oldValue = true;
@Override
protected void invalidated() {
if (oldValue != get()) {
NodeHelper.markDirty(Node.this, DirtyBits.NODE_VISIBLE);
- impl_geomChanged();
+ 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,11 +1983,11 @@
// 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)
+ // 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,11 +2671,11 @@
if (layoutX == null) {
layoutX = new DoublePropertyBase(0.0) {
@Override
protected void invalidated() {
- impl_transformsChanged();
+ 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,11 +2745,11 @@
if (layoutY == null) {
layoutY = new DoublePropertyBase(0.0) {
@Override
protected void invalidated() {
- impl_transformsChanged();
+ 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,11 +3422,11 @@
*
*/
private LazyBoundsProperty layoutBounds = new LazyBoundsProperty() {
@Override
protected Bounds computeBounds() {
- return impl_computeLayoutBounds();
+ return NodeHelper.computeLayoutBounds(Node.this);
}
@Override
public Object getBean() {
return Node.this;
@@ -3375,11 +3501,11 @@
* 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.
+ * 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,17 +3565,14 @@
* 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() {
+ private Bounds doComputeLayoutBounds() {
BaseBounds tempBounds = TempState.getInstance().bounds;
tempBounds = getGeomBounds(tempBounds,
BaseTransform.IDENTITY_TRANSFORM);
return new BoundingBox(tempBounds.getMinX(),
tempBounds.getMinY(),
@@ -3457,33 +3580,29 @@
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
+ * 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 impl_layoutBoundsChanged to
+ * kept in sync. Subclasses must call NodeHelper.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() {
+ 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
- impl_transformsChanged();
+ NodeHelper.transformsChanged(this);
}
}
/**
* Loads the given bounds object with the transformed bounds relative to,
@@ -3622,11 +3741,11 @@
} 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);
+ 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,25 +3755,16 @@
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);
+ geomBounds = NodeHelper.computeGeomBounds(this, geomBounds, BaseTransform.IDENTITY_TRANSFORM);
geomBoundsInvalid = false;
}
}
/**
@@ -3719,17 +3829,10 @@
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
@@ -3740,17 +3843,17 @@
* 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().
+ * 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), impl_geomChanged calls localBoundsChanged(). It should
- * be noted that impl_geomChanged should only be called when the geometry
+ * 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,11 +3861,11 @@
* 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
+ * 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,14 +3889,14 @@
* 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.
+ * NodeHelper.geomChanged() *does not* invalidate the layout bounds.
*
* This interposition happens by providing the
- * impl_notifyLayoutBoundsChanged function. The default implementation
+ * 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,45 +3907,43 @@
* 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
+ * 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.
- * <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
+ * Note: This method MUST only be called via its accessor method.
*/
- @Deprecated
- protected void impl_geomChanged() {
+ 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.
- impl_notifyLayoutBoundsChanged();
+ NodeHelper.notifyLayoutBoundsChanged(this);
transformedBoundsChanged();
return;
}
geomBounds.makeEmpty();
geomBoundsInvalid = true;
NodeHelper.markDirty(this, DirtyBits.NODE_BOUNDS);
- impl_notifyLayoutBoundsChanged();
+ NodeHelper.notifyLayoutBoundsChanged(this);
localBoundsChanged();
}
private boolean geomBoundsInvalid = true;
private boolean localBoundsInvalid = true;
@@ -3875,23 +3976,21 @@
if (isVisible()) {
notifyParentOfBoundsChange();
}
}
- /**
- * Invoked by impl_geomChanged(). Since layoutBounds is by default based
+ /*
+ * 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.
*
- * @treatAsPrivate implementation detail
- * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+ * Note: This method MUST only be called via its accessor method.
*/
- @Deprecated
- protected void impl_notifyLayoutBoundsChanged() {
- impl_layoutBoundsChanged();
+ 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,27 +4036,24 @@
* 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 (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.
- * @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) {
+ 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,63 +4844,44 @@
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() {
+ 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.
- * @treatAsPrivate implementation detail
- * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+ *
+ * Note: This method MUST only be called via its accessor method.
*/
- @Deprecated
- public void impl_transformsChanged() {
+ private void doTransformsChanged() {
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 double 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 double 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 double getPivotZ() {
final Bounds bounds = getLayoutBounds();
return bounds.getMinZ() + bounds.getDepth()/2;
}
/**
@@ -4822,11 +4899,11 @@
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();
+ mirroringCenter = getPivotX();
}
localToParentTx = localToParentTx.deriveWithTranslation(
mirroringCenter, 0.0);
localToParentTx = localToParentTx.deriveWithScale(
@@ -4834,19 +4911,19 @@
localToParentTx = localToParentTx.deriveWithTranslation(
-mirroringCenter, 0.0);
} else {
// mirror later
mirror = true;
- mirroringCenter = impl_getPivotX();
+ mirroringCenter = 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();
+ double pivotX = getPivotX();
+ double pivotY = getPivotY();
+ double pivotZ = getPivotZ();
localToParentTx = localToParentTx.deriveWithTranslation(
getTranslateX() + getLayoutX() + pivotX,
getTranslateY() + getLayoutY() + pivotY,
getTranslateZ() + pivotZ);
@@ -4862,11 +4939,11 @@
getTranslateX() + getLayoutX(),
getTranslateY() + getLayoutY(),
getTranslateZ());
}
- if (impl_hasTransforms()) {
+ if (hasTransforms()) {
for (Transform t : getTransforms()) {
localToParentTx = TransformHelper.derive(t, localToParentTx);
}
}
@@ -4944,31 +5021,27 @@
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
+ *
+ * Note: This method MUST only be called via its accessor method.
*/
- @Deprecated
- protected void impl_pickNodeLocal(PickRay localPickRay, PickResultChooser result) {
- impl_intersects(localPickRay, result);
+ 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.
- * @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) {
+ final void pickNode(PickRay pickRay, PickResultChooser result) {
// In some conditions we can omit picking this node or subgraph
if (!isVisible() || isDisable() || isMouseTransparent()) {
return;
}
@@ -4988,20 +5061,20 @@
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);
+ 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,42 +5082,34 @@
* 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);
+ 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 impl_computeIntersects(pickRay, pickResult);
+ 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.
- *
- * @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) {
+ 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,24 +5128,21 @@
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 double intersectsBounds(PickRay pickRay) {
final Vec3d dir = pickRay.getDirectionNoClone();
double tmin, tmax;
final Vec3d origin = pickRay.getOriginNoClone();
@@ -5227,11 +5289,11 @@
clip.localToParentTx.inverseTransform(origin, origin);
clip.localToParentTx.inverseDeltaTransform(dir, dir);
} catch (NoninvertibleTransformException e) {
hitClip = false;
}
- hitClip = hitClip && clip.impl_intersects(pickRay, null);
+ hitClip = hitClip && clip.intersects(pickRay, null);
pickRay.setOrigin(originX, originY, originZ);
pickRay.setDirection(dirX, dirY, dirZ);
if (!hitClip) {
return Double.NaN;
@@ -5627,16 +5689,11 @@
}
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() {
+ private boolean hasTransforms() {
return (nodeTransformation != null)
&& nodeTransformation.hasTransforms();
}
// for tests only
@@ -5890,11 +5947,11 @@
public final DoubleProperty translateXProperty() {
if (translateX == null) {
translateX = new StyleableDoubleProperty(DEFAULT_TRANSLATE_X) {
@Override
public void invalidated() {
- impl_transformsChanged();
+ NodeHelper.transformsChanged(Node.this);
}
@Override
public CssMetaData getCssMetaData() {
return StyleableProperties.TRANSLATE_X;
@@ -5921,11 +5978,11 @@
public final DoubleProperty translateYProperty() {
if (translateY == null) {
translateY = new StyleableDoubleProperty(DEFAULT_TRANSLATE_Y) {
@Override
public void invalidated() {
- impl_transformsChanged();
+ NodeHelper.transformsChanged(Node.this);
}
@Override
public CssMetaData getCssMetaData() {
return StyleableProperties.TRANSLATE_Y;
@@ -5952,11 +6009,11 @@
public final DoubleProperty translateZProperty() {
if (translateZ == null) {
translateZ = new StyleableDoubleProperty(DEFAULT_TRANSLATE_Z) {
@Override
public void invalidated() {
- impl_transformsChanged();
+ NodeHelper.transformsChanged(Node.this);
}
@Override
public CssMetaData getCssMetaData() {
return StyleableProperties.TRANSLATE_Z;
@@ -5983,11 +6040,11 @@
public final DoubleProperty scaleXProperty() {
if (scaleX == null) {
scaleX = new StyleableDoubleProperty(DEFAULT_SCALE_X) {
@Override
public void invalidated() {
- impl_transformsChanged();
+ NodeHelper.transformsChanged(Node.this);
}
@Override
public CssMetaData getCssMetaData() {
return StyleableProperties.SCALE_X;
@@ -6014,11 +6071,11 @@
public final DoubleProperty scaleYProperty() {
if (scaleY == null) {
scaleY = new StyleableDoubleProperty(DEFAULT_SCALE_Y) {
@Override
public void invalidated() {
- impl_transformsChanged();
+ NodeHelper.transformsChanged(Node.this);
}
@Override
public CssMetaData getCssMetaData() {
return StyleableProperties.SCALE_Y;
@@ -6045,11 +6102,11 @@
public final DoubleProperty scaleZProperty() {
if (scaleZ == null) {
scaleZ = new StyleableDoubleProperty(DEFAULT_SCALE_Z) {
@Override
public void invalidated() {
- impl_transformsChanged();
+ NodeHelper.transformsChanged(Node.this);
}
@Override
public CssMetaData getCssMetaData() {
return StyleableProperties.SCALE_Z;
@@ -6076,11 +6133,11 @@
public final DoubleProperty rotateProperty() {
if (rotate == null) {
rotate = new StyleableDoubleProperty(DEFAULT_ROTATE) {
@Override
public void invalidated() {
- impl_transformsChanged();
+ NodeHelper.transformsChanged(Node.this);
}
@Override
public CssMetaData getCssMetaData() {
return StyleableProperties.ROTATE;
@@ -6109,11 +6166,11 @@
if (rotationAxis == null) {
rotationAxis = new ObjectPropertyBase<Point3D>(
DEFAULT_ROTATION_AXIS) {
@Override
protected void invalidated() {
- impl_transformsChanged();
+ NodeHelper.transformsChanged(Node.this);
}
@Override
public Object getBean() {
return Node.this;
@@ -6140,11 +6197,11 @@
for (Transform t : c.getAddedSubList()) {
TransformHelper.add(t, Node.this);
}
}
- impl_transformsChanged();
+ NodeHelper.transformsChanged(Node.this);
}
};
}
return transforms;
@@ -6333,11 +6390,11 @@
final void parentResolvedOrientationInvalidated() {
if (getNodeOrientation() == NodeOrientation.INHERIT) {
nodeResolvedOrientationInvalidated();
} else {
// mirroring changed
- impl_transformsChanged();
+ NodeHelper.transformsChanged(this);
}
}
final void nodeResolvedOrientationInvalidated() {
final byte oldResolvedNodeOrientation =
@@ -6353,11 +6410,11 @@
oldResolvedNodeOrientation))) {
effectiveNodeOrientationProperty.invalidate();
}
// mirroring changed
- impl_transformsChanged();
+ NodeHelper.transformsChanged(this);
if (resolvedNodeOrientation != oldResolvedNodeOrientation) {
nodeResolvedOrientationChanged();
}
}
@@ -8050,16 +8107,12 @@
/**
* 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) {
+ final boolean traverse(Direction dir) {
if (getScene() == null) {
return false;
}
return getScene().traverse(this, dir);
}
@@ -8151,16 +8204,16 @@
boolean isTreeVisible = isVisible();
final Node parentNode = getParent() != null ? getParent() :
clipParent != null ? clipParent :
getSubScene() != null ? getSubScene() : null;
if (isTreeVisible) {
- isTreeVisible = parentNode == null || parentNode.impl_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.impl_isTreeVisible()
+ if (parentChanged && parentNode != null && parentNode.isTreeVisible()
&& isDirty(DirtyBits.NODE_VISIBLE)) {
addToSceneDirtyList();
}
setTreeVisible(isTreeVisible);
}
@@ -8177,11 +8230,11 @@
getClip().updateTreeVisible(true);
}
if (treeVisible && !isDirtyEmpty()) {
addToSceneDirtyList();
}
- ((TreeVisiblePropertyReadOnly)impl_treeVisibleProperty()).invalidate();
+ ((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,25 +8242,15 @@
}
}
}
}
- /**
- * @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();
+ final boolean isTreeVisible() {
+ return 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() {
+ final BooleanExpression treeVisibleProperty() {
if (treeVisibleRO == null) {
treeVisibleRO = new TreeVisiblePropertyReadOnly();
}
return treeVisibleRO;
}
@@ -8263,11 +8306,11 @@
}
private void updateCanReceiveFocus() {
setCanReceiveFocus(getScene() != null
&& !isDisabled()
- && impl_isTreeVisible());
+ && isTreeVisible());
}
// for indenting messages based on scene-graph depth
String indent() {
String indent = "";
@@ -8277,48 +8320,26 @@
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;
+ private BooleanProperty 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);
+ final void setShowMnemonics(boolean value) {
+ 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();
+ final boolean isShowMnemonics() {
+ return showMnemonics == null ? false : 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) {
+ final BooleanProperty showMnemonicsProperty() {
+ if (showMnemonics == null) {
+ showMnemonics = new BooleanPropertyBase(false) {
@Override
protected void invalidated() {
pseudoClassStateChanged(SHOW_MNEMONICS_PSEUDOCLASS_STATE, get());
}
@@ -8332,11 +8353,11 @@
public String getName() {
return "showMnemonics";
}
};
}
- return impl_showMnemonics;
+ return showMnemonics;
}
/**
* References a node that is a labelFor this node.
@@ -8645,11 +8666,10 @@
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()) {
@@ -8940,63 +8960,50 @@
@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) {
+ // SB-dependency: RT-21096 has been filed to track this
+ static List<Style> 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() {
+ 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
- * @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) {
+ // 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.
- *
- * @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) {
+ // 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,11 +9026,11 @@
// 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.
+ // 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,16 +9119,11 @@
_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() {
+ final void reapplyCSS() {
if (getScene() == null) return;
if (cssFlag == CssFlags.REAPPLY) return;
@@ -9142,11 +9144,11 @@
// 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();
+ NodeHelper.processCSS(this);
} else {
notifyParentsOfInvalidatedCSS();
}
}
@@ -9183,11 +9185,11 @@
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()
+ // 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,11 +9242,11 @@
break;
}
case REAPPLY:
case UPDATE:
default:
- impl_processCSS();
+ NodeHelper.processCSS(this);
}
}
/**
* If required, apply styles to this Node and its children, if any. This method does not normally need to
@@ -9331,24 +9333,22 @@
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
+ * 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.
*
- * @treatAsPrivate implementation detail
- * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+ * Note: This method MUST only be called via its accessor method.
*/
- @Deprecated // SB-dependency: RT-21206 has been filed to track this
- protected void impl_processCSS() {
+ private void doProcessCSS() {
// Nothing to do...
if (cssFlag == CssFlags.CLEAN) return;
// if REAPPLY was deferred, process it now...
@@ -9497,22 +9497,10 @@
}
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.
*
< prev index next >