Graph View

* added simple Window for graph play
* added new function to interface
* all tests passes
* end graph
This commit is contained in:
2019-02-26 21:58:53 +01:00
parent b441871de0
commit cdc183754f
23 changed files with 2203 additions and 1053 deletions

View File

@@ -0,0 +1,22 @@
package berack96.sim.util.graph.view.edge;
import berack96.sim.util.graph.Edge;
import berack96.sim.util.graph.view.vertex.VertexComponent;
import java.awt.*;
public class EdgeComponent<V, W extends Number> extends Component {
private static final long serialVersionUID = 1L;
public final VertexComponent<V> source;
public final VertexComponent<V> destination;
public final W weight;
public final Edge<V, W> edge;
public EdgeComponent(VertexComponent<V> source, VertexComponent<V> destination, W weight) {
this.source = source;
this.destination = destination;
this.weight = weight;
this.edge = new Edge<>(source.vertex.getValue(), destination.vertex.getValue(), weight);
}
}