|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface DrawingTreeHead<P extends NodeProperties>
The interface defines numerous methods which allow for the drawing of
the entire DrawingTree
onto a given Graphics2D using the head methods. The interface also defines many mutator and accesor
methods for information concerning the drawing of the entire DrawingTree
Field Summary |
---|
Fields inherited from interface edu.princeton.cs.algs4.growingtree.framework.TreeHead |
---|
BALANCE_NODE, CHANGE_DISPLAY, FREEZE, INORDER_TRAVERSAL, INSERT_NODE, LEVELORDER_TRAVERSAL, PARTITION_NODE, POSTORDER_TRAVERSAL, PREORDER_TRAVERSAL, REMOVE_NODE, ROTATE_TO_TOP_NODE, ROTATE_UP, ROTATE_UP_DOUBLE, SEARCH, SELECT, SPLAY_NODE, SWAP, TRAVERSE |
Method Summary | |
---|---|
void |
DrawTree(java.awt.Graphics2D g2)
Draws the entire tree from the null head down. |
DrawingTree<P> |
findNode(double x,
double y)
Finds the node represented by the x-y coordinates given. |
KeySettings |
getDrawingKeySettings()
Gets the KeySettings for the entire tree. |
NodeSettings |
getDrawingNodeSettings()
Gets the NodeSettings for the entire tree. |
double |
getNodeHeight()
Gets the height of the standard node within the tree. |
double |
getNodeWidth()
Gets the width of the standard node within the tree. |
java.awt.geom.Rectangle2D |
getScreenBounds()
Gets the bounds of the screen to which the tree is drawing. |
void |
MakeTree(java.awt.Graphics2D g2)
Makes the entire tree from the null head down. |
void |
setScreenBounds(java.awt.geom.Rectangle2D screen)
Sets the bounds of the screen to which the tree is drawing. |
void |
setTreeSettings(NodeSettings s,
KeySettings k)
Sets the NodeSettings for the entire tree from the head down. |
Methods inherited from interface edu.princeton.cs.algs4.growingtree.framework.TreeHead |
---|
addTreeMessageListener, balance, balanceTree, clear, fixLevel, getChild, getTreeLevel, insert, isTreeEmpty, partition, remove, remove, removeTreeMessageListener, resetTreeLevel, search, select, setChild, size, waitingAction |
Methods inherited from interface edu.princeton.cs.algs4.growingtree.framework.Tree |
---|
getChildren, getKey, getLevel, getParentTree, getValue, isEmpty |
Method Detail |
---|
void setTreeSettings(NodeSettings s, KeySettings k)
NodeSettings
for the entire tree from the head down.
These settings are used for drawing the node and the links of each given tree.
s
- NodeSettings
for use in drawing the entire tree.k
- KeySettings
for use in drawing the keys of the entire tree.NodeSettings getDrawingNodeSettings()
NodeSettings
for the entire tree.
NodeSettings
for defined for the entire tree.KeySettings getDrawingKeySettings()
KeySettings
for the entire tree.
KeySettings
for defined for the entire tree.double getNodeWidth()
double getNodeHeight()
java.awt.geom.Rectangle2D getScreenBounds()
void setScreenBounds(java.awt.geom.Rectangle2D screen)
getClipBounds
on the Graphics2D passed, however, the bounds
can be set in any way.
bounds
- the rectangle representing the bounds of the screen.void MakeTree(java.awt.Graphics2D g2)
g2
- Graphics2D which the tree is made to fit unto.void DrawTree(java.awt.Graphics2D g2)
MakeTree
.
g2
- Graphics2D which the tree is drawn onto.DrawingTree<P> findNode(double x, double y)
x
- x-coordinate to find the node.y
- y-coordinate to find the node.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |