private class SegmentPartitionTree.SearchAnimation extends Animation implements java.util.function.BiConsumer<T,SegmentPartitionTree.LineSegment>
Modifier and Type | Field and Description |
---|---|
private static int |
DEPTH_DURATION
The number of milliseconds to show each search depth in the animation for.
|
private java.util.Map<java.lang.Integer,java.util.List<T>> |
depthData
Nodes to highlight by their depth.
|
private int |
lastDepth
The depth visualised in the last animation frame.
|
private int |
maxDepth
The lowest depth searched by the search.
|
private SegmentPartitionTree.LineSegment |
query
The search query line.
|
private long |
start
The millisecond start time of the animation.
|
Modifier | Constructor and Description |
---|---|
private |
SearchAnimation(SegmentPartitionTree.LineSegment query)
Constructs a new search animation with the given query line.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(T node,
SegmentPartitionTree.LineSegment seg) |
void |
end()
Forcefully ends this animation.
|
protected boolean |
render(java.awt.Graphics2D g)
Renders the next frame of this animation.
|
private static final int DEPTH_DURATION
private java.util.Map<java.lang.Integer,java.util.List<T extends PartitionTree<SegmentPartitionTree.LineSegment,T>>> depthData
private int maxDepth
private long start
private int lastDepth
private SegmentPartitionTree.LineSegment query
private SearchAnimation(SegmentPartitionTree.LineSegment query)
query
- The query line for the search.public void accept(T node, SegmentPartitionTree.LineSegment seg)
accept
in interface java.util.function.BiConsumer<T extends PartitionTree<SegmentPartitionTree.LineSegment,T>,SegmentPartitionTree.LineSegment>
protected boolean render(java.awt.Graphics2D g)
Animation