public class Edge extends Object implements Comparable<Object>
Resource
corresponds to a
Node
in the visualization and
every property to an Edge.Modifier and Type | Field and Description |
---|---|
boolean |
visited
True, if the child node has been visited before.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object o)
Compares this object with the specified object for order.
|
static void |
drawArrow(Graphics2D g,
int x,
int y,
int xx,
int yy)
Draws an arrow on the given Graphics2D context.
|
Point |
drawEdge(Graphics2D g,
Node parent,
int x,
int y,
int currentWidth)
Draw this edge (draw an arrow from the parent node to the child node).
|
Node |
getChild()
Get the child node of this object.
|
public Node getChild()
public Point drawEdge(Graphics2D g, Node parent, int x, int y, int currentWidth)
g
- The graphics to draw to.parent
- The parent node.x
- The x-coordinate of the starting point.y
- The y-coordinate of the starting point.currentWidth
- The current width (i.e. the right edge) of all node drawn
before. This is used for links to already visited nodes to
prevent drawing over an existing node.public static void drawArrow(Graphics2D g, int x, int y, int xx, int yy)
g
- The Graphics2D context to draw on.x
- The x location of the "tail" of the arrow.y
- The y location of the "tail" of the arrow.xx
- The x location of the "head" of the arrow.yy
- The y location of the "head" of the arrow.public int compareTo(Object o)
compareTo
in interface Comparable<Object>
o
- The Object to be compared.Copyright © 2018 universAAL Consortium. All rights reserved.