Top Inners Fields Constructors Methods
com.sun.javafx.scene.traversal

public Class Heuristic2D

extends Object
implements Algorithm
Class Inheritance
All Implemented Interfaces
com.sun.javafx.scene.traversal.Algorithm
Static Imports
com.sun.javafx.scene.traversal.Direction.DOWN, .Direction.LEFT, .Direction.NEXT, .Direction.NEXT_IN_LINE, .Direction.PREVIOUS, .Direction.RIGHT, .Direction.UP

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final Function<Bounds, Double>
private static final Function<Bounds, Double>
private static final Function<Bounds, Double>
private static final Function<Bounds, Double>
protected Node
protected Direction
protected Node
protected boolean
protected Stack<Node>

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private void
private double
centerSideDistance(Direction dir, Bounds cur, Bounds tgt)

Computes the side distance from current center to target center.

private double
cornerSideDistance(Direction dir, Bounds cur, Bounds tgt)

Computes the side distance between the closest corners of the current and target.

public static double
findMin(double... values)

protected Node
protected Node
private boolean
private double
outDistance(Direction dir, Bounds cur, Bounds tgt)

Compute the out-distance to the near edge of the target in the traversal direction.

public Node
select(Node node, Direction dir, TraversalContext context)

Implements com.sun.javafx.scene.traversal.Algorithm.select.

Traverse from owner, in direction dir.

public Node
selectFirst(TraversalContext context)

Implements com.sun.javafx.scene.traversal.Algorithm.selectFirst.

Return the first traversable node for the specified context (root).

public Node
selectLast(TraversalContext context)

Implements com.sun.javafx.scene.traversal.Algorithm.selectLast.

Return the last traversable node for the specified context (root).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BOUNDS_BOTTOM_SIDEback to summary
private static final Function<Bounds, Double> BOUNDS_BOTTOM_SIDE
BOUNDS_LEFT_SIDEback to summary
private static final Function<Bounds, Double> BOUNDS_LEFT_SIDE
BOUNDS_RIGHT_SIDEback to summary
private static final Function<Bounds, Double> BOUNDS_RIGHT_SIDE
BOUNDS_TOP_SIDEback to summary
private static final Function<Bounds, Double> BOUNDS_TOP_SIDE
cacheLastTraversalNodeback to summary
protected Node cacheLastTraversalNode
cacheStartTraversalDirectionback to summary
protected Direction cacheStartTraversalDirection
cacheStartTraversalNodeback to summary
protected Node cacheStartTraversalNode
reverseDirectionback to summary
protected boolean reverseDirection
traversalNodeStackback to summary
protected Stack<Node> traversalNodeStack

Constructor Detail

Heuristic2Dback to summary
pack-priv Heuristic2D()

Method Detail

cacheTraversalback to summary
private void cacheTraversal(Node node, Direction dir)
centerSideDistanceback to summary
private double centerSideDistance(Direction dir, Bounds cur, Bounds tgt)

Computes the side distance from current center to target center. Always positive. This is only used for on-axis nodes.

cornerSideDistanceback to summary
private double cornerSideDistance(Direction dir, Bounds cur, Bounds tgt)

Computes the side distance between the closest corners of the current and target. Always positive. This is only used for off-axis nodes.

findMinback to summary
public static double findMin(double... values)
getNearestNodeLeftOrRightback to summary
protected Node getNearestNodeLeftOrRight(Bounds currentB, Bounds originB, TraversalContext context, Direction dir)
getNearestNodeUpOrDownback to summary
protected Node getNearestNodeUpOrDown(Bounds currentB, Bounds originB, TraversalContext context, Direction dir)
isOnAxisback to summary
private boolean isOnAxis(Direction dir, Bounds cur, Bounds tgt)
outDistanceback to summary
private double outDistance(Direction dir, Bounds cur, Bounds tgt)

Compute the out-distance to the near edge of the target in the traversal direction. Negative means the near edge is "behind".

selectback to summary
public Node select(Node node, Direction dir, TraversalContext context)

Implements com.sun.javafx.scene.traversal.Algorithm.select.

Doc from com.sun.javafx.scene.traversal.Algorithm.select.

Traverse from owner, in direction dir. Return a the new target Node or null if no suitable target is found. Typically, the implementation of override algorithm handles only parent's direct children and looks like this: 1) Find the nearest parent of the "owner" that is handled by this algorithm (i.e. it's a direct child of the root). 2) select the next node within this direct child using the context.selectInSubtree() and return it 2a) if no such node exists, move to the next direct child in the direction (this is where the different order of direct children is defined) or if direct children are not traversable, the select the first node in the next direct child

Annotations
@Override
selectFirstback to summary
public Node selectFirst(TraversalContext context)

Implements com.sun.javafx.scene.traversal.Algorithm.selectFirst.

Doc from com.sun.javafx.scene.traversal.Algorithm.selectFirst.

Return the first traversable node for the specified context (root).

Annotations
@Override
selectLastback to summary
public Node selectLast(TraversalContext context)

Implements com.sun.javafx.scene.traversal.Algorithm.selectLast.

Doc from com.sun.javafx.scene.traversal.Algorithm.selectLast.

Return the last traversable node for the specified context (root).

Annotations
@Override
com.sun.javafx.scene.traversal back to summary

pack-priv final Class Heuristic2D.TargetNode

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv double
pack-priv double
pack-priv double
pack-priv double
pack-priv Bounds
pack-priv double
pack-priv double
pack-priv Node
pack-priv double
pack-priv double
pack-priv double
pack-priv double
pack-priv double

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

averageDistanceback to summary
pack-priv double averageDistance
biased2DMetricback to summary
pack-priv double biased2DMetric
biasShortestDistanceback to summary
pack-priv double biasShortestDistance
bottomCornerDistanceback to summary
pack-priv double bottomCornerDistance
boundsback to summary
pack-priv Bounds bounds
current2DMetricback to summary
pack-priv double current2DMetric
leftCornerDistanceback to summary
pack-priv double leftCornerDistance
nodeback to summary
pack-priv Node node
originLeftCornerDistanceback to summary
pack-priv double originLeftCornerDistance
originTopCornerDistanceback to summary
pack-priv double originTopCornerDistance
rightCornerDistanceback to summary
pack-priv double rightCornerDistance
shortestDistanceback to summary
pack-priv double shortestDistance
topCornerDistanceback to summary
pack-priv double topCornerDistance

Constructor Detail

TargetNodeback to summary
pack-priv TargetNode()

Method Detail

copyback to summary
pack-priv void copy(Heuristic2D.TargetNode source)