1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Graph grid = new SingleGraph("Grid");
Node aa =grid.addNode("a");
Node bb=grid.addNode("b");
Node cc=grid.addNode("c");
grid.addEdge("ab", "a", "b");
grid.addEdge("bc", "b", "c");
grid.addAttribute("ui.class", "graph ,node");
String styleSheet =
" graph {"+
"fill-color: white;"+
"}"+
"node {"+
"size: 20px, 20px;"+
" shape: box; "+
"fill-color: aquamarine,#254;"+
"fill-mode: gradient-diagonal1;"+
"stroke-mode: plain;"+
"stroke-color: bleu;"+
"stroke-width: 6;"+
"shadow-mode:plain ;"+
"shadow-color: bleu ;"+
"}"+
"node#a {"+
"fill-color: blue;"+
"}"+
"node:clicked {"+
"fill-color: red;" +
"}"
;
grid.addAttribute("ui.stylesheet", styleSheet); |
Partager