Class GraphPack.DirEdge
All Packages This Package Previous Next
Class GraphPack.DirEdge
java.lang.Object
|
+----GraphPack.QNode
|
+----GraphPack.Edge
|
+----GraphPack.DirEdge
-
public class
DirEdge
-
extends Edge
-
implements EdgeList
DirEdge extends Edge, but semantically the edge is only from v1 to
v2. Each DirEdge object has its own instantiation of a
EdgeDrawingInterface which stores information on how to draw the
edge. Drawing methods are accessed through drawing(). If an edge
(v2,v1) is added or v1 or v2 is moved, update() is called, so that
the information on drawing the edge stays consist with the graph.
-
DirEdge(Vertex, Vertex, UndoMan)
-
-
DirEdge(Vertex, Vertex, boolean, UndoMan)
-
initializes DirEdge from _v1 to _v2, and onlyEdge = B
-
copy()
-
return new copy of this Edge
-
drawing()
-
return this Edge\'s EdgeDrawingInterface object
-
equals(Edge)
-
two edges in a directed graph are equal if the vertices are equal
-
midx()
-
return x value of midpoint of edge: on a straight line if onlyEdge,
otherwise is the midpoint of an arc from v1 to v2
-
midy()
-
return y value of midpoint of edge: on a straight line if onlyEdge,
otherwise is the midpoint of an arc from v1 to v2
-
onlyEdge(boolean)
-
set onlyEdge to B
-
onlyEdge()
-
return true if this is the only edge between v1 and v2
-
setDrawing(EdgeDrawingInterface)
-
set drawing value to given EdgeDrawingInterface
-
update()
-
update the drawing information
-
writeE(boolean)
-
write out this edge\'s attributes:
E ( , )
where s are the tempnums of it\'s vertices
DirEdge
public DirEdge(Vertex _v1,
Vertex _v2,
UndoMan um)
DirEdge
public DirEdge(Vertex _v1,
Vertex _v2,
boolean B,
UndoMan um)
-
initializes DirEdge from _v1 to _v2, and onlyEdge = B
copy
public Edge copy()
-
return new copy of this Edge
-
Overrides:
-
copy in class Edge
onlyEdge
public void onlyEdge(boolean B)
-
set onlyEdge to B
onlyEdge
public boolean onlyEdge()
-
return true if this is the only edge between v1 and v2
update
public void update()
-
update the drawing information
-
Overrides:
-
update in class Edge
drawing
public EdgeDrawingInterface drawing()
-
return this Edge\'s EdgeDrawingInterface object
-
Overrides:
-
drawing in class Edge
setDrawing
public void setDrawing(EdgeDrawingInterface edi)
-
set drawing value to given EdgeDrawingInterface
midx
public double midx()
-
return x value of midpoint of edge: on a straight line if onlyEdge,
otherwise is the midpoint of an arc from v1 to v2
-
Overrides:
-
midx in class Edge
midy
public double midy()
-
return y value of midpoint of edge: on a straight line if onlyEdge,
otherwise is the midpoint of an arc from v1 to v2
-
Overrides:
-
midy in class Edge
equals
public boolean equals(Edge e)
-
two edges in a directed graph are equal if the vertices are equal
-
Overrides:
-
equals in class Edge
writeE
public String writeE(boolean highlight)
-
write out this edge\'s attributes:
E ( , )
where s are the tempnums of it\'s vertices
-
Overrides:
-
writeE in class Edge
All Packages This Package Previous Next