|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gicentre.utils.network.Edge
public class Edge
Represents an edge between two nodes in a network graph structure. This class has a default drawing behaviour, but by inheriting it and overriding its draw() method, visual appearance of the edge can be customised.
Constructor Summary | |
---|---|
Edge(Node n1,
Node n2)
Creates an undirected edge between the given nodes. |
|
Edge(Node n1,
Node n2,
boolean isDirected)
Creates a possibly directed edge between the given nodes. |
Method Summary | |
---|---|
void |
draw(processing.core.PApplet applet,
float p1x,
float p1y,
float p2x,
float p2y)
Allows the edge to be drawn in the given Processing applet. |
Node |
getNode1()
Reports the first node connected to this edge |
Node |
getNode2()
Reports the second node connected to this edge |
boolean |
isDirected()
Reports whether or not this edge is directed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Edge(Node n1, Node n2)
n1
- First node in the edge.n2
- Second node in the edge.public Edge(Node n1, Node n2, boolean isDirected)
n1
- First node in the edge.n2
- Second node in the edge.isDirected
- If true the edge runs from n1 to n2 but not the other way. If false,
the edge represents an undirected connection between the two nodes.Method Detail |
---|
public void draw(processing.core.PApplet applet, float p1x, float p1y, float p2x, float p2y)
applet
- Processing sketch in which to draw this edge.p1x
- x-coordinate of the first node in the edge.p1y
- y-coordinate of the first node in the edge.p2x
- x-coordinate of the second node in the edge.p2y
- y-coordinate of the second node in the edge.public Node getNode1()
public Node getNode2()
public boolean isDirected()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |