< prev index next >
modules/graphics/src/main/java/javafx/scene/SubScene.java
Print this page
@@ -31,11 +31,10 @@
import com.sun.javafx.scene.traversal.TopMostTraversalEngine;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
import javafx.beans.NamedArg;
import javafx.beans.property.*;
-import javafx.beans.value.WritableValue;
import javafx.geometry.NodeOrientation;
import javafx.geometry.Point3D;
import javafx.scene.input.PickResult;
import javafx.scene.paint.Paint;
@@ -48,11 +47,10 @@
import com.sun.javafx.jmx.MXNodeAlgorithm;
import com.sun.javafx.jmx.MXNodeAlgorithmContext;
import com.sun.javafx.scene.CssFlags;
import com.sun.javafx.scene.DirtyBits;
import com.sun.javafx.scene.NodeHelper;
-import com.sun.javafx.scene.SceneHelper;
import com.sun.javafx.scene.SubSceneHelper;
import com.sun.javafx.scene.input.PickResultChooser;
import com.sun.javafx.sg.prism.NGCamera;
import com.sun.javafx.sg.prism.NGLightBase;
import com.sun.javafx.sg.prism.NGNode;
@@ -116,10 +114,37 @@
public void doUpdatePeer(Node node) {
((SubScene) node).doUpdatePeer();
}
@Override
+ public BaseBounds doComputeGeomBounds(Node node,
+ BaseBounds bounds, BaseTransform tx) {
+ return ((SubScene) node).doComputeGeomBounds(bounds, tx);
+ }
+
+ @Override
+ public boolean doComputeContains(Node node, double localX, double localY) {
+ return ((SubScene) node).doComputeContains(localX, localY);
+ }
+
+ @Override
+ public void doProcessCSS(Node node) {
+ ((SubScene) node).doProcessCSS();
+ }
+
+ @Override
+ public Object doProcessMXNode(Node node, MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx) {
+ return ((SubScene) node).doProcessMXNode(alg, ctx);
+ }
+
+ @Override
+ public void doPickNodeLocal(Node node, PickRay localPickRay,
+ PickResultChooser result) {
+ ((SubScene) node).doPickNodeLocal(localPickRay, result);
+ }
+
+ @Override
public boolean isDepthBuffer(SubScene subScene) {
return subScene.isDepthBufferInternal();
};
@Override
@@ -287,11 +312,11 @@
throw new IllegalArgumentException(_value +
"is already set as root of another scene or subScene");
}
// disabled and isTreeVisible properties are inherrited
- _value.setTreeVisible(impl_isTreeVisible());
+ _value.setTreeVisible(isTreeVisible());
_value.setDisabled(isDisabled());
if (oldRoot != null) {
StyleManager.getInstance().forget(SubScene.this);
oldRoot.setScenes(null, null, /* reapplyCSS*/ false);
@@ -432,17 +457,17 @@
@Override
public void invalidated() {
final Parent _root = getRoot();
//TODO - use a better method to update mirroring
if (_root.getEffectiveNodeOrientation() == NodeOrientation.RIGHT_TO_LEFT) {
- _root.impl_transformsChanged();
+ NodeHelper.transformsChanged(_root);
}
if (_root.isResizable()) {
_root.resize(get() - _root.getLayoutX() - _root.getTranslateX(), _root.getLayoutBounds().getHeight());
}
markDirty(SubSceneDirtyBits.SIZE_DIRTY);
- SubScene.this.impl_geomChanged();
+ NodeHelper.geomChanged(SubScene.this);
getEffectiveCamera().setViewWidth(get());
}
@Override
@@ -483,11 +508,11 @@
final Parent _root = getRoot();
if (_root.isResizable()) {
_root.resize(_root.getLayoutBounds().getWidth(), get() - _root.getLayoutY() - _root.getTranslateY());
}
markDirty(SubSceneDirtyBits.SIZE_DIRTY);
- SubScene.this.impl_geomChanged();
+ NodeHelper.geomChanged(SubScene.this);
getEffectiveCamera().setViewHeight(get());
}
@Override
@@ -598,23 +623,21 @@
}
/***********************************************************************
* CSS *
**********************************************************************/
- /**
- * @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 @Override
- protected void impl_processCSS() {
+ private void doProcessCSS() {
// Nothing to do...
if (cssFlag == CssFlags.CLEAN) { return; }
if (getRoot().cssFlag == CssFlags.CLEAN) {
getRoot().cssFlag = cssFlag;
}
- super.impl_processCSS();
+ SubSceneHelper.superProcessCSS(this);
getRoot().processCSS();
}
@Override
void processCSS() {
@@ -636,11 +659,11 @@
public final ObjectProperty<String> userAgentStylesheetProperty() {
if (userAgentStylesheet == null) {
userAgentStylesheet = new SimpleObjectProperty<String>(SubScene.this, "userAgentStylesheet", null) {
@Override protected void invalidated() {
StyleManager.getInstance().forget(SubScene.this);
- impl_reapplyCSS();
+ reapplyCSS();
}
};
}
return userAgentStylesheet;
}
@@ -692,16 +715,14 @@
}
boolean aa = !(antiAliasing == null || antiAliasing == SceneAntialiasing.DISABLED);
return new NGSubScene(depthBuffer, aa && Toolkit.getToolkit().isMSAASupported());
}
- /**
- * @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 @Override
- public BaseBounds impl_computeGeomBounds(BaseBounds bounds, BaseTransform tx) {
+ private BaseBounds doComputeGeomBounds(BaseBounds bounds, BaseTransform tx) {
int w = (int)Math.ceil(width.get());
int h = (int)Math.ceil(height.get());
bounds = bounds.deriveWithNewBounds(0.0f, 0.0f, 0.0f,
w, h, 0.0f);
bounds = tx.transform(bounds, bounds);
@@ -786,20 +807,18 @@
/***********************************************************************
* Picking *
**********************************************************************/
- /**
- * @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 @Override
- protected boolean impl_computeContains(double localX, double localY) {
+ private boolean doComputeContains(double localX, double localY) {
if (subSceneComputeContains(localX, localY)) {
return true;
} else {
- return getRoot().impl_computeContains(localX, localY);
+ return NodeHelper.computeContains(getRoot(), localX, localY);
}
}
/**
* Determines whether {@code SubScene} contains the given point.
@@ -827,24 +846,23 @@
return null;
}
final PickResultChooser result = new PickResultChooser();
final PickRay pickRay = getEffectiveCamera().computePickRay(localX, localY, new PickRay());
pickRay.getDirectionNoClone().normalize();
- getRoot().impl_pickNode(pickRay, result);
+ getRoot().pickNode(pickRay, result);
return result.toPickResult();
}
/**
* Finds a top-most child node that contains the given local coordinates.
*
* Returns the picked node, null if no such node was found.
- * @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 @Override
- protected void impl_pickNodeLocal(PickRay localPickRay, PickResultChooser result) {
- final double boundsDistance = impl_intersectsBounds(localPickRay);
+ private void doPickNodeLocal(PickRay localPickRay, PickResultChooser result) {
+ final double boundsDistance = intersectsBounds(localPickRay);
if (!Double.isNaN(boundsDistance) && result.isCloser(boundsDistance)) {
final Point3D intersectPt = PickResultChooser.computePoint(
localPickRay, boundsDistance);
final PickResult subSceneResult =
pickRootSG(intersectPt.getX(), intersectPt.getY());
@@ -855,16 +873,14 @@
result.offer(this, boundsDistance, intersectPt);
}
}
}
- /**
- * @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 @Override
- public Object impl_processMXNode(MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx) {
+ private Object doProcessMXNode(MXNodeAlgorithm alg, MXNodeAlgorithmContext ctx) {
throw new UnsupportedOperationException("Not supported yet.");
}
private List<LightBase> lights = new ArrayList<>();
< prev index next >