GraphStream Users

Archives de la liste Aide


Re: How to make a png or a jpg with a Graph?


Chronologique Discussions 
  • From: Rodrigo Lins <lins.oliveira AT gmail.com>
  • To: graphstream-users AT litislab.fr
  • Subject: Re: How to make a png or a jpg with a Graph?
  • Date: Tue, 7 Jun 2011 13:13:43 -0300
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=rtl4+4zgLDrtaw06ogkWutoO4/wdF5MuojgV8Jkjm6ItnRig/HNhHIdbTb+AH9modU ihyiOrlEuhhk7cEBo16ma4tc8vW1TJfWv1HjriaC3yZ8kPSMtKTOjc/2XE/rDl4TX5wz S1zgWAHNzkFMTF+az04CPM/0UcmgjqF3hLxME=

Thank you Guilhelm for your help.
But i'm facing a lot of problems to finish my application.
I'm making some test to find a better Graph API and I realy like GraphStream but I can't print a simple image.

I have this test class:
package sandboxie.graphstream;

import java.io.IOException;

import org.graphstream.graph.Graph;
import org.graphstream.graph.implementations.SingleGraph;
import org.graphstream.stream.file.FileSinkImages;
import org.graphstream.stream.file.FileSinkImages.LayoutPolicy;
import org.graphstream.stream.file.FileSinkImages.OutputPolicy;
import org.graphstream.stream.file.FileSinkImages.OutputType;
import org.graphstream.stream.file.FileSinkImages.Resolutions;


public class GsCoreTeste
{
    public static void main(String[] args)
    {
        Graph graph = new SingleGraph("Tutorial 1");
        FileSinkImages fsi = new FileSinkImages("simples", OutputType.JPG, Resolutions.VGA, OutputPolicy.ByStepOutput);
        fsi.setLayoutPolicy(LayoutPolicy.ComputedAtNewImage);
        graph.addSink(fsi);
       
        graph.addNode("A");
        graph.getNode("A").setAttribute("ui.label", "A");
        graph.addNode("B");
        graph.getNode("B").setAttribute("ui.label", "B");
        graph.addNode("C" );
        graph.getNode("C").setAttribute("ui.label", "C");
        graph.addEdge("AB", "A", "B");
        graph.addEdge("BC", "B", "C");
        graph.addEdge("CA", "C", "A");
       
        graph.display();
       
       
        try
        {
            fsi.writeAll(graph, "123");
        } catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}

and I want to export a image form the graph to exibit on a web page or i need to be able to do a Applet to show the graph drawing.
I don't find in the documentation how to do it.
I realy appreciate if you or someone help me.

Thanks for all!

Rodrigo Lins.

On Mon, May 30, 2011 at 5:16 PM, guilhelm savin <guilhelm.savin AT gmail.com> wrote:

Dear Rodrigo Lins,

Thanks for the interest you have to graphstream.
You can find a tutorial about images here : http://graphstream-project.org/doc/Tutorials/Creating-a-movie-with-FileSinkImages_1.0/

If something is missing according to what you want to do, please tell me what, I will be really happy to help you.

Best regards.
Guilhelm

Le 30 mai 2011 19:41, "Rodrigo Lins" <lins.oliveira AT gmail.com> a écrit :

> I'm using the Graph Stream and it is awsome!
> But i need to generate an image with my graph and i don't know how to do it
> and I don't find any example to do this.
>
> Thanks for your help.
>
> Rodrigo Lins




Archives gérées par MHonArc 2.6.16.

Top of page