public class DrawList
extends java.lang.Object
Each leaf node to be drawn is represented in this list by an array of nodes. The last node in each array is the leaf node to be drawn, the next to last node is that leaf node's parent, and so on. The first node in each array is the root node of the scene graph.
Conceptually, this list draws each array of nodes as follows. Starting
with the first (top) node, and working from top to bottom, this list
calls Node.drawBegin(DrawContext)
for each node in the array.
It then calls Node.draw(DrawContext)
for the last (bottom) node.
Finally, starting with that last node, and working from bottom to top,
it calls Node.drawEnd(DrawContext)
for each node in the array.
In practice, at least some parent nodes are likely to be the same from
one array to the next. For example, the first (top) node is likely to
be the same in all arrays of nodes. Therefore, during drawing, this
list avoids any redundant calls to Node.drawEnd(DrawContext)
and Node.drawBegin(DrawContext)
.
Constructor and Description |
---|
DrawList() |
Modifier and Type | Method and Description |
---|---|
void |
append(Node[] nodes)
Appends the specified array of nodes to this draw list.
|
void |
draw(DrawContext dc)
Draws all nodes in this list.
|
public void append(Node[] nodes)
nodes
- the array of nodes; referenced, not copied.public void draw(DrawContext dc)
dc
- the draw context.