public class BasicGraphComponentDrawer extends java.lang.Object implements GraphComponentDrawer
Constructor and Description |
---|
BasicGraphComponentDrawer() |
Modifier and Type | Method and Description |
---|---|
protected int |
arrowDistanceFromEnd() |
void |
drawEdge(Edge edge,
java.util.List<Position> intermediatePositions,
java.awt.Graphics g)
Draw the given edge through the given intermediate positions, with the given Graphics object.
|
java.awt.Shape |
drawNode(Node node,
Position position,
java.awt.Graphics g,
java.awt.Color background,
Shape shape)
Draw the given node at the given position, with the given Graphics object.
|
double |
horizontalBorder()
The horizontal border needed by the drawn nodes.
|
double |
verticalBorder()
The vertical border needed by the drawn nodes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getGraphComponentDrawer
public java.awt.Shape drawNode(Node node, Position position, java.awt.Graphics g, java.awt.Color background, Shape shape)
GraphComponentDrawer
drawNode
in interface GraphComponentDrawer
node
- The node to draw.position
- The screen position at which to draw the node.g
- The Graphics object to draw the node with.background
- The background color to draw the node with.shape
- The shape to draw the node as.public void drawEdge(Edge edge, java.util.List<Position> intermediatePositions, java.awt.Graphics g)
GraphComponentDrawer
drawEdge
in interface GraphComponentDrawer
edge
- The edge to draw.intermediatePositions
- The positions to draw the edge through. The edge should be drawn in segments of
intermediatePositions[0] -> intermediatePositions[1] -> intermediatePositions[2] ...g
- The Graphics object to draw the edge with.protected int arrowDistanceFromEnd()
public double verticalBorder()
GraphComponentDrawer
verticalBorder
in interface GraphComponentDrawer
public double horizontalBorder()
GraphComponentDrawer
horizontalBorder
in interface GraphComponentDrawer