Class GraphPack.Vertex
All Packages This Package Previous Next
Class GraphPack.Vertex
java.lang.Object
|
+----GraphPack.QNode
|
+----GraphPack.Vertex
-
public class
Vertex
-
extends QNode
Class Vertex stores the attributes of a vertex and contains a list
of attached edges.
Atrributes come in two flavors: x and y are special attributes and
are only accessed through Graph's methods moveAllHV() and
transv(Vertex). All other attributes are considered properties and
are accessed through the methods listed below.
All methods to draw the vertex are in VertexDrawingInterface and
accessed through drawing().
-
Vertex(UndoMan)
-
-
Vertex(double, double, UndoMan)
-
create vertex with given x and y values
-
Vertex(Vertex)
-
create a vertex which is a "copy" of v (note v may be directed
however the copy won't be)
-
addProp(Prop)
-
add property p to this vertex
-
copy()
-
return copy of this vertex: copies all attributes
-
deleteProp(String)
-
delete property s from this vertex
-
drawing()
-
return the class with this vertex's drawing methods
-
equals(Vertex)
-
return true if v has same coordinates as this
-
getLabel()
-
-
getPropString()
-
get the property string
-
getProps()
-
return this vertex\'s properties
-
getx()
-
return x-value
-
gety()
-
return y-value
-
hasNextHVertex()
-
return whether there is another highlighted vertex in list
-
hasNextVertex()
-
return whether there is another vertex in list
-
isH()
-
return true if this vertex is highlighted
-
nextHVertex()
-
return next highlighted vertex in graph\'s list of highlighted vertices
-
nextVertex()
-
return next vertex is graph\'s list of vertices
-
selectProp(String)
-
choose property s to be displayed
-
setProp(String, String)
-
set property n to contain value v
-
setPropString(String)
-
sets the property with string s
-
showProps()
-
show this vertex\'s properties
-
toString()
-
returns a string representation of the node
-
writeAdjlist()
-
print out this vertex's adjacency list:
:(,) {,,...,}
-
writeAdjlist(boolean)
-
print out this vertex\'s adjacency list :
:(,){,,...,}
where is temporary numbering system assigned to all vertices
and represents highlight information: " " or N means no highlight
and H means highlighted
-
writeV()
-
write out this vertex's attributes
-
writeV(boolean)
-
write out this vertex's attributes and whether its highlighted
Vertex
public Vertex(UndoMan um)
Vertex
public Vertex(double _x,
double _y,
UndoMan um)
-
create vertex with given x and y values
Vertex
public Vertex(Vertex v)
-
create a vertex which is a "copy" of v (note v may be directed
however the copy won't be)
copy
public Vertex copy()
-
return copy of this vertex: copies all attributes
drawing
public VertexDrawingInterface drawing()
-
return the class with this vertex's drawing methods
toString
public String toString()
-
returns a string representation of the node
-
Overrides:
-
toString in class Object
writeV
public String writeV()
-
write out this vertex's attributes
writeV
public String writeV(boolean highlight)
-
write out this vertex's attributes and whether its highlighted
writeAdjlist
public String writeAdjlist()
-
print out this vertex's adjacency list:
:(,) {,,...,}
writeAdjlist
public String writeAdjlist(boolean highlight)
-
print out this vertex\'s adjacency list :
:(,){,,...,}
where is temporary numbering system assigned to all vertices
and represents highlight information: " " or N means no highlight
and H means highlighted
nextVertex
public Vertex nextVertex()
-
return next vertex is graph\'s list of vertices
nextHVertex
public Vertex nextHVertex()
-
return next highlighted vertex in graph\'s list of highlighted vertices
hasNextVertex
public boolean hasNextVertex()
-
return whether there is another vertex in list
hasNextHVertex
public boolean hasNextHVertex()
-
return whether there is another highlighted vertex in list
isH
public boolean isH()
-
return true if this vertex is highlighted
getx
public double getx()
-
return x-value
gety
public double gety()
-
return y-value
equals
public boolean equals(Vertex v)
-
return true if v has same coordinates as this
getLabel
public String getLabel()
getProps
public PropVector getProps()
-
return this vertex\'s properties
addProp
public void addProp(Prop p)
-
add property p to this vertex
selectProp
public void selectProp(String s)
-
choose property s to be displayed
deleteProp
public void deleteProp(String s)
-
delete property s from this vertex
setProp
public void setProp(String n,
String v)
-
set property n to contain value v
showProps
public void showProps()
-
show this vertex\'s properties
getPropString
public String getPropString()
-
get the property string
setPropString
public void setPropString(String s)
-
sets the property with string s
All Packages This Package Previous Next