Package com.algo.structure
Class Vertex
- java.lang.Object
-
- com.algo.plugins.XmlMarshallable
-
- com.algo.structure.Vertex
-
- All Implemented Interfaces:
java.io.Serializable
public class Vertex extends XmlMarshallable implements java.io.Serializable
A vertex with a circle shape.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
distanceFromSource
GralogColor
fillColor
int
id
java.lang.String
label
java.lang.Double
loopAnchor
double
loopAngle
java.lang.Boolean
printLabel
double
radius
RenderingShape
shape
GralogColor
strokeColor
java.lang.Double
strokeWidth
GralogTikStyles
style
java.lang.Double
textHeight
-
Constructor Summary
Constructors Constructor Description Vertex()
Vertex(Configuration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
containsCoordinate(double x, double y)
<V extends Vertex>
voidcopy(V v)
Copies a vertex information from a given vertex object.void
disconnectEdge(Edge e)
java.lang.String
fromXml(org.w3c.dom.Element vnode)
java.util.Set<Vertex>
getAdjacentVertices()
Deprecated.Vector2D
getCoordinates()
int
getDegree()
int
getId()
java.util.Set<Edge>
getIncidentEdges()
java.util.Set<Edge>
getIncomingEdges()
java.util.Set<Vertex>
getIncomingNeighbours()
int
getInDegree()
java.util.Set<Vertex>
getNeighbours()
int
getOutDegree()
java.util.Set<Edge>
getOutgoingEdges()
java.util.Set<Vertex>
getOutgoingNeighbours()
double
getRadius()
java.lang.String
gralogPipify()
Vector2D
intersection(Vector2D p1, Vector2D p2)
Vector2D
intersectionAdjusted(Vector2D p1, Vector2D p2, double adjust)
double
maximumCoordinate(int dimension)
void
setCoordinates(double x, double y)
void
setCoordinates(Vector2D v)
void
setId(int id)
void
setLabel(java.lang.String label)
void
snapToGrid(double gridSize)
org.w3c.dom.Element
toSimpleXml(org.w3c.dom.Document doc, java.lang.String id)
java.lang.String
toString()
org.w3c.dom.Element
toXml(org.w3c.dom.Document doc, java.lang.String id)
-
Methods inherited from class com.algo.plugins.XmlMarshallable
toXml, xmlName
-
-
-
-
Field Detail
-
id
public int id
-
label
public java.lang.String label
-
radius
public double radius
-
loopAnchor
public java.lang.Double loopAnchor
-
loopAngle
public double loopAngle
-
strokeWidth
public java.lang.Double strokeWidth
-
textHeight
public java.lang.Double textHeight
-
fillColor
public GralogColor fillColor
-
strokeColor
public GralogColor strokeColor
-
shape
public RenderingShape shape
-
style
public GralogTikStyles style
-
distanceFromSource
public java.lang.String distanceFromSource
-
printLabel
public java.lang.Boolean printLabel
-
-
Constructor Detail
-
Vertex
public Vertex()
-
Vertex
public Vertex(Configuration config)
-
-
Method Detail
-
copy
public <V extends Vertex> void copy(V v)
Copies a vertex information from a given vertex object. Not the ID.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
gralogPipify
public java.lang.String gralogPipify()
-
setLabel
public void setLabel(java.lang.String label)
-
disconnectEdge
public void disconnectEdge(Edge e)
-
getIncidentEdges
public java.util.Set<Edge> getIncidentEdges()
-
getDegree
public int getDegree()
-
getRadius
public double getRadius()
-
getId
public int getId()
-
setId
public void setId(int id)
-
getOutgoingEdges
public java.util.Set<Edge> getOutgoingEdges()
-
getOutDegree
public int getOutDegree()
-
getIncomingEdges
public java.util.Set<Edge> getIncomingEdges()
-
getInDegree
public int getInDegree()
-
getAdjacentVertices
@Deprecated public java.util.Set<Vertex> getAdjacentVertices()
Deprecated.- Returns:
- The set of adjacent vertices.
-
maximumCoordinate
public double maximumCoordinate(int dimension)
-
setCoordinates
public void setCoordinates(double x, double y)
-
getCoordinates
public Vector2D getCoordinates()
-
setCoordinates
public void setCoordinates(Vector2D v)
-
getNeighbours
public java.util.Set<Vertex> getNeighbours()
-
getOutgoingNeighbours
public java.util.Set<Vertex> getOutgoingNeighbours()
-
getIncomingNeighbours
public java.util.Set<Vertex> getIncomingNeighbours()
-
snapToGrid
public void snapToGrid(double gridSize)
-
containsCoordinate
public boolean containsCoordinate(double x, double y)
- Parameters:
x
- The x coordinate.y
- The y coordinate.- Returns:
- True if the given coordinates are inside the circular shape of this vertex.
-
toXml
public org.w3c.dom.Element toXml(org.w3c.dom.Document doc, java.lang.String id) throws java.lang.Exception
- Throws:
java.lang.Exception
-
toSimpleXml
public org.w3c.dom.Element toSimpleXml(org.w3c.dom.Document doc, java.lang.String id) throws java.lang.Exception
- Throws:
java.lang.Exception
-
fromXml
public java.lang.String fromXml(org.w3c.dom.Element vnode)
-
-