• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to label inside a graph using GraphStream in java  RSS feed

 
Raj Aditya
Greenhorn
Posts: 21
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

package p1;
import org.graphstream.graph.*;
import org.graphstream.graph.implementations.*;
import org.graphstream.ui.spriteManager.Sprite;
import org.graphstream.ui.spriteManager.SpriteManager;

public class Use
{
public static void main(String args[])
{
SingleGraph graph = new SingleGraph("Use");
graph.addNode("A");
graph.addNode("B");
graph.addNode("C");
graph.addNode("D");
graph.addNode("E");
graph.addNode("F");
graph.addNode(1+"");
graph.addNode(2+"");
graph.addEdge("AB", "A", "B",true);
graph.addEdge(1+""+2+"", 1+"", 2+"",true);
graph.addEdge("BC", "B", "C",true);
graph.addEdge("CA", "C", "A",true);
graph.addEdge("CD", "C", "D",true);
graph.addEdge("DF", "D", "F",true);
graph.addEdge("EF", "E", "F",true);
graph.addEdge("DE", "D", "E",true);
Node e1=graph.getNode("A");
e1.addAttribute("ui.style", "shape:circle;fill-color: grey;size: 90px;");
e1.addAttribute("ui.label", "node A");
graph.display();
}
}

This code labels a  node outside it but I want it to be inside. I tried using sprite manager but did not help. Could someone please help?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!