I wish I'd found Graphstream last week, it does everything I need from a display standpoint. For example:
I have a parser that returns a List<String> of addNode and addEdge lines. Which is way cool, I can now skip the copy-paste I was doing. Except, now that I have the string "graph.addNode("A");", what do I do with it?
It occurs to me my parser can just return the list of nodes and edges, instead of strings. Which I will do tomorrow.
But now I wanna know, in Java (or Kotlin), how do I treat a string like a line of code?
Code:
public class DemoGraphstream {
void main() {
System.setProperty("org.graphstream.ui", "swing");
Graph graph = new SingleGraph("Tutorial 1");
graph.addNode("A");
graph.addNode("B");
graph.addNode("C");
graph.addEdge("AB", "A", "B");
graph.addEdge("BC", "B", "C");
graph.addEdge("CA", "C", "A");
graph.display();
}
It occurs to me my parser can just return the list of nodes and edges, instead of strings. Which I will do tomorrow.
But now I wanna know, in Java (or Kotlin), how do I treat a string like a line of code?