• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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

 
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?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!