A user reported the following issues with the document:
1) Each node in a scene graph has a single parent (except for the root node of the scene graph) and zero or more children.
>>> Even though it seems pretty obvious not "each" node has a parent (otherwise, you 'd have an infinite number of nodes in each scene graph), it did confuse me to read this sentence. And I actually wrote a little program to find out what the parent of the root node of a Scene is (as I 'm sure you know, it is null).
2) The javafx.scene API allows the creation and specification of several types of content, such as:
[...]
* Animation (javafx.animation): Varying properties of the scene graph objects over time
>>> Since Animation is not inside the set of javax.scene packages, I would either mention that it 's in the javafx.animation package or leave out the Animation bullet altogether.
3) Any "live" scene, which is a scene that is part of a window, must be accessed from this thread. However, scenes can be created in background threads.
>>> The javadoc of the javafx.application.Application class says:
Creation of JavaFX Scene and Stage objects as well as modification of scene graph operations to live objects (those objects already attached to a scene) must be done on the JavaFX application thread.
This seems to contradict the tutorial document, especially whether or not Scene objects can be created outside the JavaFX application thread (the javadoc says no, the tutorial seems to say yes). The way I understand the javadoc, any Scene or Stage, and any Node that is attached to a Scene, must be accessed from the JavaFX application thread. So you can create & manipulate a tree of nodes on a background thread, but as soon as you attach its root node to a Scene object, the whole tree (i.e. scene graph) has to be accessed from the JavaFX application thread.
Will you please clarify this part in the tutorial? Or, in case my interpretation of the javadoc is incorrect, file a bug report to clarify the javadoc to explain what exactly is and isn't allowed to be done outside the JavaFX application thread?
4) Application developers can also manually trigger layout or CSS passes as needed to take measurements prior to a pulse.
>>> Please clarify this sentence. The "or" in this sentence seems to imply that layout and CSS passes can be triggered separately. But the only method I could find was the "layout()" method in javafx.scene.Parent
So either:
1) I overlooked an analog method to trigger a CSS pass
2) only layout passes can be manually triggered
3) there is actually no distinction between a layout pass & a CSS pass, and calling the "layout()" method will update everything: size, position, & style (= CSS) of the nodes
1) Each node in a scene graph has a single parent (except for the root node of the scene graph) and zero or more children.
>>> Even though it seems pretty obvious not "each" node has a parent (otherwise, you 'd have an infinite number of nodes in each scene graph), it did confuse me to read this sentence. And I actually wrote a little program to find out what the parent of the root node of a Scene is (as I 'm sure you know, it is null).
2) The javafx.scene API allows the creation and specification of several types of content, such as:
[...]
* Animation (javafx.animation): Varying properties of the scene graph objects over time
>>> Since Animation is not inside the set of javax.scene packages, I would either mention that it 's in the javafx.animation package or leave out the Animation bullet altogether.
3) Any "live" scene, which is a scene that is part of a window, must be accessed from this thread. However, scenes can be created in background threads.
>>> The javadoc of the javafx.application.Application class says:
Creation of JavaFX Scene and Stage objects as well as modification of scene graph operations to live objects (those objects already attached to a scene) must be done on the JavaFX application thread.
This seems to contradict the tutorial document, especially whether or not Scene objects can be created outside the JavaFX application thread (the javadoc says no, the tutorial seems to say yes). The way I understand the javadoc, any Scene or Stage, and any Node that is attached to a Scene, must be accessed from the JavaFX application thread. So you can create & manipulate a tree of nodes on a background thread, but as soon as you attach its root node to a Scene object, the whole tree (i.e. scene graph) has to be accessed from the JavaFX application thread.
Will you please clarify this part in the tutorial? Or, in case my interpretation of the javadoc is incorrect, file a bug report to clarify the javadoc to explain what exactly is and isn't allowed to be done outside the JavaFX application thread?
4) Application developers can also manually trigger layout or CSS passes as needed to take measurements prior to a pulse.
>>> Please clarify this sentence. The "or" in this sentence seems to imply that layout and CSS passes can be triggered separately. But the only method I could find was the "layout()" method in javafx.scene.Parent
So either:
1) I overlooked an analog method to trigger a CSS pass
2) only layout passes can be manually triggered
3) there is actually no distinction between a layout pass & a CSS pass, and calling the "layout()" method will update everything: size, position, & style (= CSS) of the nodes