protected boolean loop = true;
public DemoViewerColorInterpolation() {
Graph graph = new MultiGraph("main graph");
ViewerPipe pipe = graph.display(false).newViewerPipe();
// graph.addAttribute( "ui.quality" );
graph.addAttribute("ui.antialias");
pipe.addViewerListener(this);
Node A = graph.addNode("A");
Node B = graph.addNode("B");
Node C = graph.addNode("C");
graph.addEdge("AB", "A", "B", true);
graph.addEdge("BC", "B", "C", true);
graph.addEdge("CA", "C", "A", true);
A.addAttribute("xyz", 0, 1, 0);
B.addAttribute("xyz", 1, 0, 0);
C.addAttribute("xyz", -1, 0, 0);
graph.addAttribute("ui.stylesheet", styleSheet);
float color = 0;
float dir = 0.01f;
while (loop) {
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
pipe.pump();
color += dir;
if (color > 1) {
color = 1;