< prev index next >

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

Print this page

        

*** 305,315 **** * of the rectangle. * <p> * A <b>scaling</b> transformation causes a node to either appear larger or * smaller depending on the scaling factor. Scaling alters the coordinate space * of the node such that each unit of distance along the axis in local ! * coordinates is multipled by the scale factor. As with rotation * transformations, scaling transformations are applied about a "pivot" point. * You can think of this as the point in the Node around which you "zoom". For * example, if you create a {@link javafx.scene.shape.Rectangle} with a * {@code strokeWidth} of 5, and a width and height of 50, and you apply a * {@link javafx.scene.transform.Scale} with scale factors (x=2.0, y=2.0) and --- 305,315 ---- * of the rectangle. * <p> * A <b>scaling</b> transformation causes a node to either appear larger or * smaller depending on the scaling factor. Scaling alters the coordinate space * of the node such that each unit of distance along the axis in local ! * coordinates is multiplied by the scale factor. As with rotation * transformations, scaling transformations are applied about a "pivot" point. * You can think of this as the point in the Node around which you "zoom". For * example, if you create a {@link javafx.scene.shape.Rectangle} with a * {@code strokeWidth} of 5, and a width and height of 50, and you apply a * {@link javafx.scene.transform.Scale} with scale factors (x=2.0, y=2.0) and
*** 2069,2079 **** } private void doLayoutPass() { if (this instanceof Parent) { // TODO: As an optimization we only need to layout those dirty ! // roots that are descendents of this node Parent p = (Parent)this; for (int i = 0; i < 3; i++) { p.layout(); } } --- 2069,2079 ---- } private void doLayoutPass() { if (this instanceof Parent) { // TODO: As an optimization we only need to layout those dirty ! // roots that are descendants of this node Parent p = (Parent)this; for (int i = 0; i < 3; i++) { p.layout(); } }
*** 3243,3253 **** * Help application or utility to implement LOD support by returning the * projected area of a Node in pixel unit. The projected area is not clipped. * * For perspective camera, this method first exams node's bounds against * camera's clipping plane to cut off those out of viewing frustrum. After ! * computing areaInScreen, it applys a tight viewing frustrum check using * canonical view volume. * * The result of areaInScreen comes from the product of * (projViewTx x localToSceneTransform x localBounds). * --- 3243,3253 ---- * Help application or utility to implement LOD support by returning the * projected area of a Node in pixel unit. The projected area is not clipped. * * For perspective camera, this method first exams node's bounds against * camera's clipping plane to cut off those out of viewing frustrum. After ! * computing areaInScreen, it applies a tight viewing frustrum check using * canonical view volume. * * The result of areaInScreen comes from the product of * (projViewTx x localToSceneTransform x localBounds). *
*** 3330,3340 **** // Convert node from local coordinate to camera coordinate tempTx.preConcatenate(camera.getSceneToLocalTransform()); tempTx.transform(localBounds, nodeInCameraBounds); ! // Compare in camera coornidate if (nodeInCameraBounds.getMinZ() > camera.getFarClip() || nodeInCameraBounds.getMaxZ() < camera.getNearClip()) { return 0; } } --- 3330,3340 ---- // Convert node from local coordinate to camera coordinate tempTx.preConcatenate(camera.getSceneToLocalTransform()); tempTx.transform(localBounds, nodeInCameraBounds); ! // Compare in camera coordinate if (nodeInCameraBounds.getMinZ() > camera.getFarClip() || nodeInCameraBounds.getMaxZ() < camera.getNearClip()) { return 0; } }
*** 3766,3776 **** | BaseTransform.TYPE_FLIP | BaseTransform.TYPE_QUADRANT_ROTATION)) != 0) { // this is a non-uniform scale / non-quadrant rotate / skew transform return computeLocalBounds(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 // Note: Transforming the local bounds into a 3D space will yield a bounds // that isn't as tight as transforming its geometry and compute it bounds. updateLocalBounds(); --- 3766,3776 ---- | BaseTransform.TYPE_FLIP | BaseTransform.TYPE_QUADRANT_ROTATION)) != 0) { // this is a non-uniform scale / non-quadrant rotate / skew transform return computeLocalBounds(bounds, tx); } else { // 3D transformations and ! // selected 2D transformations (uniform transform, flip, quadrant rotation). // These 2D transformation will yield tight bounds when applied on the pre-computed // geomBounds // Note: Transforming the local bounds into a 3D space will yield a bounds // that isn't as tight as transforming its geometry and compute it bounds. updateLocalBounds();
*** 4276,4288 **** /** * Transforms a point from the coordinate space of the scene * into the local coordinate space of this {@code Node}. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the arguments are in {@link Scene} coordinates ! * of the Node returned by {@link #getScene()}. Othwerwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #sceneToLocal(double, double)} * @param x the x coordinate * @param y the y coordinate * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return local coordinates of the point * @since JavaFX 8u40 --- 4276,4290 ---- /** * Transforms a point from the coordinate space of the scene * into the local coordinate space of this {@code Node}. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the ! * arguments are in {@link Scene} coordinates of the Node returned by {@link #getScene()}. ! * Otherwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #sceneToLocal(double, double)}. ! * * @param x the x coordinate * @param y the y coordinate * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return local coordinates of the point * @since JavaFX 8u40
*** 4315,4327 **** } /** * Transforms a point from the coordinate space of the scene * into the local coordinate space of this {@code Node}. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the arguments are in {@link Scene} coordinates ! * of the Node returned by {@link #getScene()}. Othwerwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #sceneToLocal(javafx.geometry.Point2D)} * @param point the point * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return local coordinates of the point * @since JavaFX 8u40 */ --- 4317,4331 ---- } /** * Transforms a point from the coordinate space of the scene * into the local coordinate space of this {@code Node}. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the ! * arguments are in {@link Scene} coordinates of the Node returned by {@link #getScene()}. ! * Otherwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #sceneToLocal(javafx.geometry.Point2D)}. ! * * @param point the point * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return local coordinates of the point * @since JavaFX 8u40 */
*** 4330,4341 **** } /** * Transforms a bounds from the coordinate space of the scene * into the local coordinate space of this {@code Node}. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the arguments are in {@link Scene} coordinates ! * of the Node returned by {@link #getScene()}. Othwerwise, the subscene coordinates are used, which is equivalent to calling * {@link #sceneToLocal(javafx.geometry.Bounds)}. * <p> * Since 3D bounds cannot be converted with {@code rootScene} set to {@code true}, trying to convert 3D bounds will yield {@code null}. * </p> * @param bounds the bounds --- 4334,4346 ---- } /** * Transforms a bounds from the coordinate space of the scene * into the local coordinate space of this {@code Node}. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the ! * arguments are in {@link Scene} coordinates of the Node returned by {@link #getScene()}. ! * Otherwise, the subscene coordinates are used, which is equivalent to calling * {@link #sceneToLocal(javafx.geometry.Bounds)}. * <p> * Since 3D bounds cannot be converted with {@code rootScene} set to {@code true}, trying to convert 3D bounds will yield {@code null}. * </p> * @param bounds the bounds
*** 4630,4642 **** } /** * Transforms a point from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the result point is in {@link Scene} coordinates ! * of the Node returned by {@link #getScene()}. Othwerwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(javafx.geometry.Point3D)} * * @param localPoint the point in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return transformed point * --- 4635,4648 ---- } /** * Transforms a point from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the ! * result point is in {@link Scene} coordinates of the Node returned by {@link #getScene()}. ! * Otherwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(javafx.geometry.Point3D)}. * * @param localPoint the point in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return transformed point *
*** 4655,4667 **** } /** * Transforms a point from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the result point is in {@link Scene} coordinates ! * of the Node returned by {@link #getScene()}. Othwerwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(double, double, double)} * * @param x the x coordinate of the point in local coordinates * @param y the y coordinate of the point in local coordinates * @param z the z coordinate of the point in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene --- 4661,4674 ---- } /** * Transforms a point from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the ! * result point is in {@link Scene} coordinates of the Node returned by {@link #getScene()}. ! * Otherwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(double, double, double)}. * * @param x the x coordinate of the point in local coordinates * @param y the y coordinate of the point in local coordinates * @param z the z coordinate of the point in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene
*** 4675,4687 **** } /** * Transforms a point from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the result point is in {@link Scene} coordinates ! * of the Node returned by {@link #getScene()}. Othwerwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(javafx.geometry.Point2D)} * * @param localPoint the point in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return transformed point * --- 4682,4695 ---- } /** * Transforms a point from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the ! * result point is in {@link Scene} coordinates of the Node returned by {@link #getScene()}. ! * Otherwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(javafx.geometry.Point2D)}. * * @param localPoint the point in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return transformed point *
*** 4697,4709 **** } /** * Transforms a point from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the result point is in {@link Scene} coordinates ! * of the Node returned by {@link #getScene()}. Othwerwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(double, double)} * * @param x the x coordinate of the point in local coordinates * @param y the y coordinate of the point in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return transformed point --- 4705,4718 ---- } /** * Transforms a point from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the ! * result point is in {@link Scene} coordinates of the Node returned by {@link #getScene()}. ! * Otherwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(double, double)}. * * @param x the x coordinate of the point in local coordinates * @param y the y coordinate of the point in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return transformed point
*** 4716,4728 **** } /** * Transforms a bounds from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the result bounds are in {@link Scene} coordinates ! * of the Node returned by {@link #getScene()}. Othwerwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(javafx.geometry.Bounds)} * * @param localBounds the bounds in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return transformed bounds * --- 4725,4738 ---- } /** * Transforms a bounds from the local coordinate space of this {@code Node} * into the coordinate space of its scene. ! * If the Node does not have any {@link SubScene} or {@code rootScene} is set to true, the ! * result bounds are in {@link Scene} coordinates of the Node returned by {@link #getScene()}. ! * Otherwise, the subscene coordinates are used, which is equivalent to calling ! * {@link #localToScene(javafx.geometry.Bounds)}. * * @param localBounds the bounds in local coordinates * @param rootScene whether Scene coordinates should be used even if the Node is in a SubScene * @return transformed bounds *
*** 7128,7139 **** } oldBits = EffectHelper.effectDirtyProperty(_effect).get(); } NodeHelper.markDirty(Node.this, DirtyBits.NODE_EFFECT); ! // bounds may have changed regardeless whether ! // the dirty flag on efffect is set localBoundsChanged(); } @Override public CssMetaData getCssMetaData() { --- 7138,7149 ---- } oldBits = EffectHelper.effectDirtyProperty(_effect).get(); } NodeHelper.markDirty(Node.this, DirtyBits.NODE_EFFECT); ! // bounds may have changed regardless whether ! // the dirty flag on effect is set localBoundsChanged(); } @Override public CssMetaData getCssMetaData() {
*** 8470,8481 **** clipParent != null ? clipParent : getSubScene() != null ? getSubScene() : null; if (isTreeVisible) { isTreeVisible = parentNode == null || parentNode.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.isTreeVisible() && isDirty(DirtyBits.NODE_VISIBLE)) { addToSceneDirtyList(); } --- 8480,8491 ---- clipParent != null ? clipParent : getSubScene() != null ? getSubScene() : null; if (isTreeVisible) { isTreeVisible = parentNode == null || parentNode.isTreeVisible(); } ! // When the parent has changed to visible and we have unsynchronized visibility, ! // we have to synchronize, because the rendering will now pass through the newly-visible parent // Otherwise an invisible Node might get rendered if (parentChanged && parentNode != null && parentNode.isTreeVisible() && isDirty(DirtyBits.NODE_VISIBLE)) { addToSceneDirtyList(); }
*** 9371,9381 **** NodeHelper.markDirty(root, DirtyBits.NODE_CSS); if (subScene != null) { // If the node is part of a subscene, then we must ensure that // the we not only mark subScene.root dirty, but continue and // call subScene.notifyParentsOfInvalidatedCSS() until ! // Scene.root gets marked dirty, via the recurisve call: subScene.cssFlag = CssFlags.UPDATE; subScene.notifyParentsOfInvalidatedCSS(); } } Parent _parent = getParent(); --- 9381,9391 ---- NodeHelper.markDirty(root, DirtyBits.NODE_CSS); if (subScene != null) { // If the node is part of a subscene, then we must ensure that // the we not only mark subScene.root dirty, but continue and // call subScene.notifyParentsOfInvalidatedCSS() until ! // Scene.root gets marked dirty, via the recursive call: subScene.cssFlag = CssFlags.UPDATE; subScene.notifyParentsOfInvalidatedCSS(); } } Parent _parent = getParent();
*** 9807,9819 **** } /** * The role description of this {@code Node}. * <p> ! * Noramlly, when a role is provided for a node, the screen reader * speaks the role as well as the contents of the node. When this ! * value is set, it is possbile to override the default. This is * useful because the set of roles is predefined. For example, * it is possible to set the role of a node to be a button, but * have the role description be arbitrary text. * * @return the role description of this {@code Node}. --- 9817,9829 ---- } /** * The role description of this {@code Node}. * <p> ! * Normally, when a role is provided for a node, the screen reader * speaks the role as well as the contents of the node. When this ! * value is set, it is possible to override the default. This is * useful because the set of roles is predefined. For example, * it is possible to set the role of a node to be a button, but * have the role description be arbitrary text. * * @return the role description of this {@code Node}.
< prev index next >