diff --git a/src/main/java/ee/ut/dendroloj/Dendrologist.java b/src/main/java/ee/ut/dendroloj/Dendrologist.java index 0ebcde3..99d2104 100644 --- a/src/main/java/ee/ut/dendroloj/Dendrologist.java +++ b/src/main/java/ee/ut/dendroloj/Dendrologist.java @@ -141,119 +141,6 @@ public static void drawGraph(GraphCanvas> graphCanvas) { GraphGUI.initGenericGUI(uiScale, graph, GenericGraphLayout.autoLayout()); } - /** - * EXPERIMENTAL API - *
- * Draws a graph based on the provided adjacency matrix. - * Negative values in the adjacency matrix are treated as missing edges. - * - * @param adjacencyMatrix graph adjacency matrix; value at [i][j] is treated as the weight of the edge from vertex i to vertex j - * @param labels string labels for vertices; pass null to use vertex indices as labels - * @deprecated THIS API IS EXPERIMENTAL AND MAY EVENTUALLY BE REMOVED - */ - @Deprecated - public static void drawGraph(int[][] adjacencyMatrix, String[] labels) { - if (isHeadless()) { - System.err.println("Dendrologist: Running in headless environment. Ignoring call to drawGraph."); - return; - } - for (var row : adjacencyMatrix) { - if (row.length != adjacencyMatrix.length) { - throw new IllegalArgumentException("Adjacency matrix is not square"); - } - } - - drawAdjacencyMatrixGraph(adjacencyMatrix.length, (from, to) -> { - int value = adjacencyMatrix[from][to]; - return value >= 0 ? value : null; - }, labels); - } - - /** - * EXPERIMENTAL API - *
- * Draws a graph based on the provided adjacency matrix. - * Infinite and NaN values in the adjacency matrix are treated as missing edges. - * - * @param adjacencyMatrix graph adjacency matrix; value at [i][j] is treated as the weight of the edge from vertex i to vertex j - * @param labels string labels for vertices; pass null to use vertex indices as labels - * @deprecated THIS API IS EXPERIMENTAL AND MAY EVENTUALLY BE REMOVED - */ - @Deprecated - public static void drawGraph(double[][] adjacencyMatrix, String[] labels) { - if (isHeadless()) { - System.err.println("Dendrologist: Running in headless environment. Ignoring call to drawGraph."); - return; - } - for (var row : adjacencyMatrix) { - if (row.length != adjacencyMatrix.length) { - throw new IllegalArgumentException("Adjacency matrix is not square"); - } - } - - drawAdjacencyMatrixGraph(adjacencyMatrix.length, (from, to) -> { - double value = adjacencyMatrix[from][to]; - return Double.isFinite(value) ? value : null; - }, labels); - } - - /** - * EXPERIMENTAL API - *
- * Draws a graph based on the provided adjacency matrix.
- * Infinite and NaN values in the adjacency matrix are treated as missing edges.
- *
- * @param adjacencyMatrix graph adjacency matrix; value at [i][j] is treated as the weight of the edge from vertex i to vertex j
- * @param labels string labels for vertices; pass null to use vertex indices as labels
- * @deprecated THIS API IS EXPERIMENTAL AND MAY EVENTUALLY BE REMOVED
- */
- @Deprecated
- public static void drawGraph(float[][] adjacencyMatrix, String[] labels) {
- if (isHeadless()) {
- System.err.println("Dendrologist: Running in headless environment. Ignoring call to drawGraph.");
- return;
- }
- for (var row : adjacencyMatrix) {
- if (row.length != adjacencyMatrix.length) {
- throw new IllegalArgumentException("Adjacency matrix is not square");
- }
- }
-
- drawAdjacencyMatrixGraph(adjacencyMatrix.length, (from, to) -> {
- float value = adjacencyMatrix[from][to];
- return Float.isFinite(value) ? value : null;
- }, labels);
- }
-
- private static void drawAdjacencyMatrixGraph(int vertexCount, WeightProvider weights, String[] labels) {
- GraphCanvas