package graph; import java.awt.*; public class MarkedEdge extends Edge{ // ATTRIBUTE private U marking; // Für Aufgabe 2 private int weighting; private visualizationElements.Edge screenEdge; // KONSTRUKTOREN public MarkedEdge() { super(); this.screenEdge = new visualizationElements.Edge(null, null); } public MarkedEdge(String s, Vertex n1, Vertex n2, U u) { super(s, n1, n2); this.marking = u; this.screenEdge = new visualizationElements.Edge(n1.getScreenVertex(), n2.getScreenVertex()); } // TODO ACHTUNG DEBUG!!!! public MarkedEdge(String s, Vertex n1, Vertex n2, U u, int weighting) { super(s, n1, n2); this.marking = u; this.weighting = weighting; this.screenEdge = new visualizationElements.Edge(n1.getScreenVertex(), n2.getScreenVertex(), Integer.toString(weighting), Color.BLACK); } // GET-ER public U getMarking() { return this.marking; } // Für Aufgabe 2 public int getWeighting() { return this.weighting; } public visualizationElements.Edge getScreenEdge() { return this.screenEdge; } // SET-ER public void setMarking(U u) { this.marking = u; } // Für Aufgabe 2 public void setWeighting(int w) { this.weighting = w; } // Ausgabe public String toString() { return "MarkedEdge " + this.getName() + " from " + this.getSource().getName() + " to " + this.getDestination().getName(); } }