Class 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 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
      • distanceFromSource

        public java.lang.String distanceFromSource
      • printLabel

        public java.lang.Boolean printLabel
    • Constructor Detail

      • Vertex

        public Vertex()
    • 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 class java.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)