GraphStream Users

Archives de la liste Aide

Re: Request about Graphstream project

Chronologique Discussions 
  • From: Antoine Dutot <antoine.dutot AT>
  • To: Bastien Michel <bastien.michel AT>, graphstream-users AT
  • Cc: julien.baudry AT, antoine.dutot AT, yoann.pigne AT, guilhelm.savin AT
  • Subject: Re: Request about Graphstream project
  • Date: Tue, 15 Nov 2011 11:35:42 +0100

Hello Bastien,

There are two viewers in GraphStream, the basic one does not allows edge shapes other than lines. You have to download the advanced viewer (gs-ui module on the download page), put it in the class path, and enable it globally like this is described here.

Hope this helps,

Best regards,


2011/11/15 Bastien Michel <bastien.michel AT>

I send you this mail to enquire some information about using style to customize "Graph", "Nodes" and "Edges".

In fact, we create a stylesheet and basically apply this by the method "addAttribute()". Unfortunately, all the specifications of the style are applied except for the shape property for the edges.

Please, find the following code :

===================================== CODE ==============================================

import javax.swing.JFrame;
import org.graphstream.ui.graphicGraph.GraphicGraph;
import org.graphstream.ui.swingViewer.Viewer;

        String stylesheet = "graph { fill-color: white;}"
        stylesheet += "node { shape: box; size: 20px; fill-color: red;}";
        stylesheet += "edge { fill-color: blue; shape: cubic-curve;}";
        GraphicGraph graph = new GraphicGraph("GraphicGraph");

        Viewer viewer = new Viewer(graph, Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);

        graph.addAttribute("ui.stylesheet", stylesheet);
        graph.addEdge("AB", "A", "B", false);
        graph.addEdge("BC", "B", "C", true);
        graph.addEdge("CA", "C", "A", false);
        JFrame frame = new JFrame("GraphicGraph");

================================== END OF CODE =========================================

The result is visible on the following screenshot :

As you can see, the shape style doesn't work with this method. I hope there is a mistake in the proposed code and you have a way to do that.

You will be most helpful,

Best regards,

MICHEL Bastien
CARTON Antoine

Engineer Students at INSA Rouen.

  • Re: Request about Graphstream project, Antoine Dutot, 15/11/2011

Archives gérées par MHonArc 2.6.16.

Top of page