📄 node.html
字号:
<dd> label - Label of the new node. </dl></dd></dl><a name="methods"></a><h2> <img src="images/methods.gif" width=151 height=38 alt="Methods"></h2><a name="setWeight(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setWeight"><b>setWeight</b></a><pre> public void setWeight(int weight)</pre><dl> <dd> Set the weight of this node.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> weight - The weight to be assigned to this node. </dl></dd></dl><a name="setLabel(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setLabel"><b>setLabel</b></a><pre> public void setLabel(String label)</pre><dl> <dd> Set the label of this node.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> label - The label to be assigned to this node. </dl></dd></dl><a name="getWeight()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getWeight"><b>getWeight</b></a><pre> public int getWeight()</pre><dl> <dd> Get the weight of this node.<p> <dd><dl> <dt> <b>Returns:</b> <dd> Weight of this node. </dl></dd></dl><a name="getLabel()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getLabel"><b>getLabel</b></a><pre> public String getLabel()</pre><dl> <dd> Get the label of this node.<p> <dd><dl> <dt> <b>Returns:</b> <dd> Label of this node. </dl></dd></dl><a name="setLeftNode(Node)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setLeftNode"><b>setLeftNode</b></a><pre> public void setLeftNode(<a href="#_top_">Node</a> node)</pre><dl> <dd> Link the left branch of this node to the node passed in as the parameter.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> node - The new left child of this node. </dl></dd></dl><a name="setRightNode(Node)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setRightNode"><b>setRightNode</b></a><pre> public void setRightNode(<a href="#_top_">Node</a> node)</pre><dl> <dd> Link the right branch of this node to the node passed in as the parameter.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> node - The new right child of this node. </dl></dd></dl><a name="getLeftNode()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getLeftNode"><b>getLeftNode</b></a><pre> public <a href="#_top_">Node</a> getLeftNode()</pre><dl> <dd> Get the left child of this node.<p> <dd><dl> <dt> <b>Returns:</b> <dd> the left child this this node. </dl></dd></dl><a name="getRightNode()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getRightNode"><b>getRightNode</b></a><pre> public <a href="#_top_">Node</a> getRightNode()</pre><dl> <dd> Get the right child of this node.<p> <dd><dl> <dt> <b>Returns:</b> <dd> the right child this this node. </dl></dd></dl><a name="isLeaf()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="isLeaf"><b>isLeaf</b></a><pre> public boolean isLeaf()</pre><dl> <dd> Check if this node is a leaf node. A leaf node has both left and right nodes null.<p> <dd><dl> <dt> <b>Returns:</b> <dd> true if the node is a leaf node; false otherwise. </dl></dd></dl><a name="setX(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setX"><b>setX</b></a><pre> public void setX(int x)</pre><dl> <dd> Sets the x coordinate of the top-left corner of the node<p></dl><a name="setY(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setY"><b>setY</b></a><pre> public void setY(int y)</pre><dl> <dd> Sets the y coordinate of the top-left corner of the node<p></dl><a name="getX()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getX"><b>getX</b></a><pre> public int getX()</pre><dl> <dd> Get the left most position of the node.<p> <dd><dl> <dt> <b>Returns:</b> <dd> The x coordinates of the top-left corner of the node </dl></dd></dl><a name="getY()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getY"><b>getY</b></a><pre> public int getY()</pre><dl> <dd> Get the top most position of the node.<p> <dd><dl> <dt> <b>Returns:</b> <dd> The y coordinates of the top-left corner of the node </dl></dd></dl><a name="getDepth()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getDepth"><b>getDepth</b></a><pre> public int getDepth()</pre><dl> <dd> Get the depth of his node.<p> <dd><dl> <dt> <b>Returns:</b> <dd> The depth of this node in a tree. </dl></dd></dl><a name="setDepth(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setDepth"><b>setDepth</b></a><pre> public void setDepth(int depth)</pre><dl> <dd> Sets the depth of this node corresponding to the root node of the tree.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> depth - Depth of the node. </dl></dd></dl><a name="move(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="move"><b>move</b></a><pre> public void move(int x, int y)</pre><dl> <dd> Move the node and all its branches based on the parameters.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> x - The horizontal destination position of this node. <dd> y - The vertical destination position of this node. </dl></dd></dl><a name="moveNode(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="moveNode"><b>moveNode</b></a><pre> public void moveNode(int dx, int dy)</pre><dl> <dd> Move the tree starting with node dx pixels to the right and dy pixels down.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> node - The root node of the tree to be moved. <dd> dx - The change in x direction. <dd> dy - The change in y direction. </dl></dd></dl><a name="initFonts(java.awt.Font, java.awt.Font)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="initFonts"><b>initFonts</b></a><pre> public void initFonts(Font hugeFont, Font bigFont)</pre><dl> <dd> Assign some font instances to reduce initialization over during redraw.<p></dl><a name="initColors(java.awt.Color)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="initColors"><b>initColors</b></a><pre> public void initColors(Color nodeColor)</pre><dl> <dd> Set the color of the node.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> nodeColor - new color of the node. </dl></dd></dl><a name="draw(java.awt.Graphics)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="draw"><b>draw</b></a><pre> public void draw(Graphics g)</pre><dl> <dd> This method draws the node on the corresponding graphical context normally passed in from the drawing panel.<p></dl></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -