public class SimpleEdgeRenderer extends java.lang.Object implements EdgeRenderer
Constructor and Description |
---|
SimpleEdgeRenderer() |
Modifier and Type | Method and Description |
---|---|
void |
drawEdge(java.awt.Graphics g,
java.lang.Object edge,
java.awt.Point origLoc,
java.awt.Point destLoc)
Draws the edge into the Graphics Context.
|
java.awt.Color |
getColor()
Gets the color for the Renderer
|
protected java.awt.Color |
getEdgeColor(java.lang.Object edge)
Get the color used for the edge.
|
java.util.List<java.awt.Point> |
getEdgePoints(java.lang.Object edge,
java.awt.Point origLoc,
java.awt.Point destLoc)
Method to return the sequence of points used to draw the path for a
particular edge.
|
java.awt.Color |
getHighlight()
Gets the highlight color for the Renderer
|
void |
highlightEdge(java.awt.Graphics g,
java.lang.Object edge,
java.awt.Point origLoc,
java.awt.Point destLoc)
Highlights the edge into the Graphics Context.
|
boolean |
pickEdge(java.lang.Object edge,
java.awt.Point pickPoint,
java.awt.Point origLoc,
java.awt.Point destLoc)
Checks whether the specified pickpoint is within the drawn area for the
edge.
|
void |
setColor(java.awt.Color edgeColor)
Sets the color for the EdgeRenderer.
|
void |
setHighlight(java.awt.Color highlight)
Sets the highlight color for the EdgeRenderer.
|
public void drawEdge(java.awt.Graphics g, java.lang.Object edge, java.awt.Point origLoc, java.awt.Point destLoc)
drawEdge
in interface EdgeRenderer
g
- the Graphics context to display the edgeedge
- the edge to displayorigLoc
- location of the origin nodedestLoc
- location of the destination nodepublic java.awt.Color getColor()
getColor
in interface EdgeRenderer
protected java.awt.Color getEdgeColor(java.lang.Object edge)
edge
- the edge to query for the colorpublic java.util.List<java.awt.Point> getEdgePoints(java.lang.Object edge, java.awt.Point origLoc, java.awt.Point destLoc)
getEdgePoints
in interface EdgeRenderer
edge
- the GraphEdge to figure the points fororigLoc
- location of the origin nodedestLoc
- location of the destination nodepublic java.awt.Color getHighlight()
public void highlightEdge(java.awt.Graphics g, java.lang.Object edge, java.awt.Point origLoc, java.awt.Point destLoc)
drawEdge()
.highlightEdge
in interface EdgeRenderer
g
- the Graphics context to display the edgeedge
- the edge to displayorigLoc
- location of the origin nodedestLoc
- location of the destination nodepublic boolean pickEdge(java.lang.Object edge, java.awt.Point pickPoint, java.awt.Point origLoc, java.awt.Point destLoc)
pickEdge
in interface EdgeRenderer
edge
- the node to check for pickingpickPoint
- the coordinate of the point to checkorigLoc
- location of the origin nodedestLoc
- location of the destination nodepublic void setColor(java.awt.Color edgeColor)
setColor
in interface EdgeRenderer
edgeColor
- the color for this rendererpublic void setHighlight(java.awt.Color highlight)
highlight
- the color for this renderer