public class TextNodeRenderer extends ShapeNodeRenderer
ShapeNodeRenderer.NodeShape
Constructor and Description |
---|
TextNodeRenderer()
Instantiates a new text node renderer.
|
Modifier and Type | Method and Description |
---|---|
void |
drawNode(java.awt.Graphics g,
java.lang.Object node,
java.awt.Point loc)
Draws the node into the Graphics Context.
|
java.awt.Font |
getFont()
Gets the font used by the renderer.
|
java.awt.Rectangle |
getNodeBounds(java.lang.Object node,
java.awt.Point loc)
Returns the bounding box for the node using this renderer.
|
void |
highlightNode(java.awt.Graphics g,
java.lang.Object node,
java.awt.Point loc)
Draws the node into the Graphics Context in a highlighted fashion.
|
boolean |
pickNode(java.lang.Object node,
java.awt.Point nodeLoc,
java.awt.Point pickPoint)
Checks whether the specified pick point is within the drawn area for the
node.
|
void |
setFont(java.awt.Font newFont)
Sets the font used by the renderer.
|
drawNodeShape, getColor, getNodeColor, getNodeShape, getShape, setColor, setShape
public TextNodeRenderer()
public void drawNode(java.awt.Graphics g, java.lang.Object node, java.awt.Point loc)
drawNode
in interface NodeRenderer
drawNode
in class ShapeNodeRenderer
g
- the Graphics context to display the nodenode
- the node to displayloc
- the locpublic java.awt.Font getFont()
public java.awt.Rectangle getNodeBounds(java.lang.Object node, java.awt.Point loc)
getNodeBounds
in interface NodeRenderer
getNodeBounds
in class ShapeNodeRenderer
node
- the node to be checkedloc
- the node locationpublic void highlightNode(java.awt.Graphics g, java.lang.Object node, java.awt.Point loc)
highlightNode
in interface NodeRenderer
highlightNode
in class ShapeNodeRenderer
g
- the Graphics context to display the nodenode
- the node to displayloc
- The node locationpublic boolean pickNode(java.lang.Object node, java.awt.Point nodeLoc, java.awt.Point pickPoint)
pickNode
in interface NodeRenderer
pickNode
in class ShapeNodeRenderer
node
- the node to check for pickingpickPoint
- the coordinate of the point to checknodeLoc
- the node locpublic void setFont(java.awt.Font newFont)
newFont
- the font used by the renderer