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.StringdistanceFromSourceGralogColorfillColorintidjava.lang.Stringlabeljava.lang.DoubleloopAnchordoubleloopAnglejava.lang.BooleanprintLabeldoubleradiusRenderingShapeshapeGralogColorstrokeColorjava.lang.DoublestrokeWidthGralogTikStylesstylejava.lang.DoubletextHeight
-
Constructor Summary
Constructors Constructor Description Vertex()Vertex(Configuration config)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancontainsCoordinate(double x, double y)<V extends Vertex>
voidcopy(V v)Copies a vertex information from a given vertex object.voiddisconnectEdge(Edge e)java.lang.StringfromXml(org.w3c.dom.Element vnode)java.util.Set<Vertex>getAdjacentVertices()Deprecated.Vector2DgetCoordinates()intgetDegree()intgetId()java.util.Set<Edge>getIncidentEdges()java.util.Set<Edge>getIncomingEdges()java.util.Set<Vertex>getIncomingNeighbours()intgetInDegree()java.util.Set<Vertex>getNeighbours()intgetOutDegree()java.util.Set<Edge>getOutgoingEdges()java.util.Set<Vertex>getOutgoingNeighbours()doublegetRadius()java.lang.StringgralogPipify()Vector2Dintersection(Vector2D p1, Vector2D p2)Vector2DintersectionAdjusted(Vector2D p1, Vector2D p2, double adjust)doublemaximumCoordinate(int dimension)voidsetCoordinates(double x, double y)voidsetCoordinates(Vector2D v)voidsetId(int id)voidsetLabel(java.lang.String label)voidsnapToGrid(double gridSize)org.w3c.dom.ElementtoSimpleXml(org.w3c.dom.Document doc, java.lang.String id)java.lang.StringtoString()org.w3c.dom.ElementtoXml(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:
toStringin 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)
-
-