Skip to content

Commit

Permalink
Extended one test to become wiki example;
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasSchaub committed Oct 25, 2023
1 parent d1dfde1 commit a59d179
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,22 @@ public void graphStreamTreeMergeTest() throws Exception {
tmpMoleculeList.add(tmpMolecule2);
tmpMoleculeList.add(tmpMolecule3);
List<ScaffoldTree> tmpScaffoldTreeList = tmpScaffoldGenerator.generateSchuffenhauerForest(tmpMoleculeList);
/*Display the Tree*/
GraphStreamUtility.displayWithGraphStream(tmpScaffoldTreeList.get(0), true);
GraphStreamUtility.screenshotGraphHighQuality(GraphStreamUtility.generateGraphFromScaffoldNodeCollection(tmpScaffoldTreeList.get(0)),
GraphStreamUtility.getGraphStreamDisplayFolder().getAbsolutePath() + File.separatorChar + "Pyrimidine_ScaffoldTree.png");
//shortcut would be:
//GraphStreamUtility.displayWithGraphStream(tmpScaffoldTreeList.get(0));
//alternative with more options:
Graph tmpGraph = new SingleGraph("Pyrimidine-Scaffold-Tree");
GraphStreamUtility.generateGraphFromScaffoldNodeCollection(tmpScaffoldTreeList.get(0),
GraphStreamUtility.DEFAULT_ARE_NODES_LABELLED,
GraphStreamUtility.DEFAULT_CDK_DEPICTION_GENERATOR,
GraphStreamUtility.DEFAULT_GRAPH_STYLE_SHEET,
tmpGraph);
System.setProperty("org.graphstream.ui", GraphStreamUtility.DEFAULT_GRAPHSTREAM_UI);
tmpGraph.display();
//screenshot the graph in both ways available
GraphStreamUtility.screenshotGraph(tmpGraph, GraphStreamUtility.getGraphStreamDisplayFolder().getAbsolutePath() + File.separatorChar +
"Pyrimidine_ScaffoldTree_low.png");
GraphStreamUtility.screenshotGraphHighQuality(tmpGraph, GraphStreamUtility.getGraphStreamDisplayFolder().getAbsolutePath() + File.separatorChar +
"Pyrimidine_ScaffoldTree.png");
TimeUnit.SECONDS.sleep(10);
}
//
Expand Down

0 comments on commit a59d179

Please sign in to comment.