Updating graph

* Implemented MatrixGraph
* Changed save/load logics (test not passing)
This commit is contained in:
2021-01-06 16:28:01 +01:00
parent ddc81330ab
commit 7f16252890
27 changed files with 1678 additions and 1771 deletions

View File

@@ -1,9 +1,9 @@
package berack96.lib.graph.view.vertex;
import java.awt.*;
import berack96.lib.graph.view.GraphicalView;
import java.awt.*;
public class VertexView<V> implements GraphicalView<VertexComponent<V>> {
private static final Font FONT = new Font("Comic Sans MS", Font.BOLD, 17);
@@ -23,7 +23,7 @@ public class VertexView<V> implements GraphicalView<VertexComponent<V>> {
boolean discovered = obj.vertex.getMarks().contains("discovered");
boolean visited = obj.vertex.getMarks().contains("visited");
boolean selected = obj.vertex.getMarks().contains("selected");
FontMetrics metrics = obj.getFontMetrics(FONT);
int stringPixels = metrics.stringWidth(obj.vertex.getValue().toString());
int size = Math.max(stringPixels, metrics.getHeight()) + 2 * PADDING;