import java.util.*; import java.util.zip.*; import java.util.List; import java.util.regex.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import java.util.concurrent.locks.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.table.*; import java.io.*; import java.net.*; import java.lang.reflect.*; import java.lang.ref.*; import java.lang.management.*; import java.security.*; import java.security.spec.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.imageio.*; import java.math.*; import org.graphstream.graph.*; import org.graphstream.graph.implementations.*; import org.graphstream.ui.spriteManager.*; // SpriteManager public class main { // graphstream core 1.3 public static void main(final String[] args) throws Exception { Graph graph = new SingleGraph("Graph with sprites"); graph.addNode("A"); graph.addNode("B"); graph.addNode("C"); graph.addEdge("AB", "A", "B"); graph.addEdge("BC", "B", "C"); graph.addEdge("CA", "C", "A"); SpriteManager sm = new SpriteManager(graph); /* This shows another node labelled "(0,0)" floating around. Sprite C = sm.addSprite("C"); C.setPosition(0, 0, 0); C.setAttribute("ui.label", "(0,0)"); */ Sprite s = sm.addSprite("Label for A"); s.setPosition(0, 0, 0); s.setAttribute("ui.label", "Node A"); s.attachToNode("A"); s = sm.addSprite("Label for Edge AB"); s.setAttribute("ui.label", "Edge AB"); s.setPosition(0.5); s.attachToEdge("AB"); graph.display(); } }