public abstract class TraversalEngine extends Object
ParentTraversalEngine
to be used in Parent.setImpl_traversalEngine(ParentTraversalEngine)
to override default behavior
and 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 | Constructor and Description |
---|---|
protected |
TraversalEngine()
Creates engine with no algorithm.
|
protected |
TraversalEngine(Algorithm algorithm)
Creates engine with the specified algorithm
|
Modifier and Type | Method and Description |
---|---|
void |
addTraverseListener(TraverseListener listener)
Add a listener to traversal engine.
|
boolean |
canTraverse()
Returns true only if there's specified algorithm for this engine.
|
protected abstract Parent |
getRoot()
The root of this engine's context.
|
Node |
select(Node from,
Direction dir)
Returns the node that is in the direction
dir starting from the Node from using the engine's algorithm. |
Node |
selectFirst()
Returns the first node in this engine's context (scene/parent) using the engine's algorithm.
|
Node |
selectLast()
Returns the last node in this engine's context (scene/parent) using the engine's algorithm.
|
protected final Algorithm algorithm
protected TraversalEngine(Algorithm algorithm)
algorithm
- protected TraversalEngine()
canTraverse()
public final void addTraverseListener(TraverseListener listener)
listener
- public final Node select(Node from, Direction dir)
dir
starting from the Node from
using the engine's algorithm.
Null means there is no Node in that directionfrom
- the node to start traversal fromdir
- the direction of traversalNullPointerException
- if there is no algorithmpublic final Node selectFirst()
NullPointerException
- if there is no algorithmpublic final Node selectLast()
NullPointerException
- if there is no algorithmprotected abstract Parent getRoot()
public final boolean canTraverse()
Copyright © 2020. All rights reserved.