public void test(TestEntry entry) throws IOException {
System.out.printf("> \"%s\"\n", entry.ressourceName);
Graph graph = new MultiGraph("foo");
FileSourcePajek in = new FileSourcePajek();
graph.addAttribute("ui.quality");
if (!entry.veryLarge)
graph.addAttribute("ui.antialias");
if (entry.addLabels)
graph.addAttribute(
"ui.stylesheet",
String.format(
"node { text-alignment: center; size: %dpx; fill-color: grey; %s } edge { fill-color: #333; }",
entry.veryLarge ? 6 : 16, entry.veryLarge ? ""
: "stroke-mode: plain; stroke-color: #333;"));
else
graph.addAttribute(
"ui.stylesheet",
String.format(
"node { text-alignment: at-right; size: %dpx; fill-color: grey; %s text-background-mode: plain; text-offset: 2px, 0px; text-padding: 2px; text-background-color: #FFFFFFAA; } edge { fill-color: #333; }",
entry.veryLarge ? 6 : 16, entry.veryLarge ? ""
: "stroke-mode: plain; stroke-color: #333;"));
Viewer v = graph.display(entry.autoLayout);
v.setCloseFramePolicy(CloseFramePolicy.CLOSE_VIEWER);
in.addSink(graph);
in.readAll(TestPajekParser.class
.getResourceAsStream(entry.ressourceName));
if (entry.addLabels) {
for (Node node : graph) {
node.addAttribute("ui.label", node.getId());