com.sun.javafx.scene.traversal.ParentTraversalEngine
to be used in Parent#setTraversalEngine(ParentTraversalEngine) to override default behavior
and com.sun.javafx.scene.traversal.TopMostTraversalEngine that is the default traversal engine for scene and subscene.
Every engine is basically a wrapper of an algorithm + some specific parent (or scene/subscene), which define engine's root.
| Modifier and Type | Class and Description |
|---|---|
| private abstract class | TraversalEngine.
The base class for all engine contexts |
| private class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| protected final Algorithm | |
| private final TraversalContext | |
| pack-priv static final Algorithm | DEFAULT_ALGORITHM
This is the default algorithm for the running platform. |
| private final Bounds | |
| private final ArrayList | |
| private final TraversalEngine. |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final boolean | |
| private Bounds | Returns: bounds of node inforParent coordinates or scene coordinates if forParent is nullGets the appropriate bounds for the given node, transformed into the scene's or the specified node's coordinates. |
| protected abstract Parent | |
| pack-priv final void | |
| public final Node | |
| public final Node | Returns: The first node or null if none existsReturns the first node in this engine's context (scene/parent) using the engine's algorithm. |
| public final Node | Returns: The last node or null if none existsReturns the last node in this engine's context (scene/parent) using the engine's algorithm. |
| algorithm | back to summary |
|---|---|
| protected final Algorithm algorithm | |
| context | back to summary |
|---|---|
| private final TraversalContext context | |
| DEFAULT_ALGORITHM | back to summary |
|---|---|
| pack-priv static final Algorithm DEFAULT_ALGORITHM This is the default algorithm for the running platform. It's the algorithm that's used in TopMostTraversalEngine | |
| initialBounds | back to summary |
|---|---|
| private final Bounds initialBounds | |
| listeners | back to summary |
|---|---|
| private final ArrayList<TraverseListener> listeners | |
| tempEngineContext | back to summary |
|---|---|
| private final TraversalEngine. | |
| TraversalEngine | back to summary |
|---|---|
| protected TraversalEngine(Algorithm algorithm) Creates engine with the specified algorithm | |
| TraversalEngine | back to summary |
|---|---|
| protected TraversalEngine() Creates engine with no algorithm. This makes all the select* calls invalid.
| |
| addTraverseListener | back to summary |
|---|---|
| public final void addTraverseListener(TraverseListener listener) Add a listener to traversal engine. The listener is notified whenever focus is changed by traversal inside the associated scene or parent. This can be used with ParentTraversalEngine that has no algorithm to observe changes to the focus inside the parent. | |
| canTraverse | back to summary |
|---|---|
| public final boolean canTraverse() Returns true only if there's specified algorithm for this engine. Otherwise, this engine cannot be used for traversal. The engine might be still useful however, e.g. for listening on traversal changes. | |
| getLayoutBounds | back to summary |
|---|---|
| private Bounds getLayoutBounds(Node n, Parent forParent) Gets the appropriate bounds for the given node, transformed into the scene's or the specified node's coordinates.
| |
| getRoot | back to summary |
|---|---|
| protected abstract Parent getRoot() The root of this engine's context. This is the node that is the root of the tree that is traversed by this engine.
| |
| notifyTraversedTo | back to summary |
|---|---|
| pack-priv final void notifyTraversedTo(Node newNode) Fire notifications for listeners. This is called from the TopMostTraversalEngine
| |
| select | back to summary |
|---|---|
| public final Node select(Node from, Direction dir) Returns the node that is in the direction
| |
| selectFirst | back to summary |
|---|---|
| public final Node selectFirst() Returns the first node in this engine's context (scene/parent) using the engine's algorithm. This can be null only if there are no traversable nodes
| |
| selectLast | back to summary |
|---|---|
| public final Node selectLast() Returns the last node in this engine's context (scene/parent) using the engine's algorithm. This can be null only if there are no traversable nodes
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public List | getAllTargetNodes()
Implements com. Returns all traversable nodes in the context's (engine's) root |
| public Bounds | getSceneLayoutBounds(Node n)
Implements com. Returns layout bounds of the Node in the relevant (Sub)Scene. |
| public Node | selectFirstInParent(Parent parent)
Implements com. If the TraversalEngine does not want to handle traversal inside some inner child (Parent), it can use this method to apply default algorithm inside that Parent and return the first Node |
| public Node | selectInSubtree(Parent subTreeRoot, Node from, Direction dir)
Implements com. If the TraversalEngine does not want to handle traversal inside some inner child (Parent), it can use this method to apply default algorithm inside that Parent and return the next Node within the Parent or null if there's no successor. |
| public Node | selectLastInParent(Parent parent)
Implements com. If the TraversalEngine does not want to handle traversal inside some inner child (Parent), it can use this method to apply default algorithm inside that Parent and return the last Node |
| BaseEngineContext | back to summary |
|---|---|
| private BaseEngineContext() | |
| addFocusableChildrenToList | back to summary |
|---|---|
| private void addFocusableChildrenToList(List<Node> list, Parent parent) | |
| getAllTargetNodes | back to summary |
|---|---|
| public List Implements com. Returns all traversable nodes in the context's (engine's) root
| |
| getSceneLayoutBounds | back to summary |
|---|---|
| public Bounds getSceneLayoutBounds(Node n) Implements com. Doc from com. Returns layout bounds of the Node in the relevant (Sub)Scene. Note that these bounds are the most important for traversal as they define the final position within the scene.
| |
| selectFirstInParent | back to summary |
|---|---|
| public Node selectFirstInParent(Parent parent) Implements com. Doc from com. If the TraversalEngine does not want to handle traversal inside some inner child (Parent), it can use this method to apply default algorithm inside that Parent and return the first Node
| |
| selectInSubtree | back to summary |
|---|---|
| public Node selectInSubtree(Parent subTreeRoot, Node from, Direction dir) Implements com. Doc from com. If the TraversalEngine does not want to handle traversal inside some inner child (Parent), it can use this method to apply default algorithm inside that Parent and return the next Node within the Parent or null if there's no successor.
| |
| selectLastInParent | back to summary |
|---|---|
| public Node selectLastInParent(Parent parent) Implements com. Doc from com. If the TraversalEngine does not want to handle traversal inside some inner child (Parent), it can use this method to apply default algorithm inside that Parent and return the last Node
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Parent | getRoot()
Implements com. The root for this context, Traversal should be done only within the root |
| EngineContext | back to summary |
|---|---|
| private EngineContext() | |
| getRoot | back to summary |
|---|---|
| public Parent getRoot() Implements com. Doc from com. The root for this context, Traversal should be done only within the root
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Parent | getRoot()
Implements com. The root for this context, Traversal should be done only within the root |
| public void |
| root | back to summary |
|---|---|
| private Parent root | |
| TempEngineContext | back to summary |
|---|---|
| private TempEngineContext() | |
| getRoot | back to summary |
|---|---|
| public Parent getRoot() Implements com. Doc from com. The root for this context, Traversal should be done only within the root
| |
| setRoot | back to summary |
|---|---|
| public void setRoot(Parent root) | |