Klasse Edge

java.lang.Object
visualizationElements.Edge

public class Edge extends Object
Represents an edge of a graph.
  • Felddetails

    • source

      private Vertex source
    • destination

      private Vertex destination
    • color

      private Color color
    • marking

      private String marking
    • xPoints

      int[] xPoints
    • yPoints

      int[] yPoints
    • baseX

      float baseX
    • baseY

      float baseY
  • Konstruktordetails

    • Edge

      public Edge(Vertex source, Vertex destination, String marking, Color color)
      Creates a new Edge.
      Parameter:
      source - The vertex the edge starts at.
      destination - The vertex the edge ends at.
      marking - Marking of the edge.
      color - Coloring the edge is drawn.
    • Edge

      public Edge(Vertex source, Vertex destination, Color color)
      Creates a new Edge.
      Parameter:
      source - The vertex the edge starts at.
      destination - The vertex the edge ends at.
      color - Coloring the edge is drawn.
    • Edge

      public Edge(Vertex source, Vertex destination, String marking)
      Creates a new Edge.
      Parameter:
      source - The vertex the edge starts at.
      destination - The vertex the edge ends at.
      marking - Marking of the edge.
    • Edge

      public Edge(Vertex source, Vertex destination)
      Creates a new Edge.
      Parameter:
      source - The vertex the edge starts at.
      destination - The vertex the edge ends at.
  • Methodendetails

    • setSource

      public void setSource(Vertex source)
      Parameter:
      source - the source to set
    • getSource

      public Vertex getSource()
      Gibt zurück:
      the source
    • setDestination

      public void setDestination(Vertex destination)
      Parameter:
      destination - the destination to set
    • getDestination

      public Vertex getDestination()
      Gibt zurück:
      the destination
    • setColor

      public void setColor(Color color)
      Parameter:
      color - the color to set
    • getColor

      public Color getColor()
      Gibt zurück:
      the color
    • setMarking

      public void setMarking(String marking)
      Parameter:
      marking - the marking to set
    • getMarking

      public String getMarking()
      Gibt zurück:
      the marking
    • drawUndirectedDirectDoubleEdge

      public void drawUndirectedDirectDoubleEdge(Graphics g)
      Draws an undirected double edge directly from one vertex to another.
      Parameter:
      g - Graphics object to draw to DrawArea.
    • drawUndirectedLoop

      public void drawUndirectedLoop(Graphics g)
      Draws an undirected loop.
      Parameter:
      g - Graphics object to draw to DrawArea.
    • drawUndirectedDirectEdge

      public void drawUndirectedDirectEdge(Graphics g)
      Draws an undirected edge directly from one vertex to another.
      Parameter:
      g - Graphics object to draw to DrawArea.
    • drawUndirectedAngeledLoop

      public void drawUndirectedAngeledLoop(Graphics g)
      Draws an undirected angled loop.
      Parameter:
      g - Graphics object to draw to DrawArea.
    • drawUndirectedAngledEdge

      public void drawUndirectedAngledEdge(Graphics g)
      Draws an undirected angled edge from source vertex to destination vertex.
      Parameter:
      g - Graphics object to draw to DrawArea.
    • drawDirectedAngeledEdge

      public void drawDirectedAngeledEdge(Graphics g)
      Draws a directed edge directly from source vertex to destination vertex.
      Parameter:
      g - Graphics object to draw to DrawArea.
    • drawDirectedLoop

      public void drawDirectedLoop(Graphics g)
      Draws a directed loop.
      Parameter:
      g - Graphics object to draw to DrawArea.
    • drawDirectedDirectEdge

      public void drawDirectedDirectEdge(Graphics g)
      Draws a directed edge directly from source vertex to destination vertex.
      Parameter:
      g - Graphics object to draw to DrawArea.
    • createArrowDataForDirectEdges

      private void createArrowDataForDirectEdges(EdgeStyle edgeStyle)
      Creates an arrow for directed edges.
    • createArrowDataForLoops

      private void createArrowDataForLoops()
      Creates an arrow for directed loops.
    • createArrow

      private void createArrow(int sourceX, int sourceY, int destinationX, int destinationY)
      Creates data to draw an arrow for directed edges.
      Parameter:
      sourceX - x position of the source vertex.
      sourceY - y position of the source vertex.
      destinationX - x position of the destination vertex.
      destinationY - y position of the destination vertex.