- From: <Nuno.Carvalho AT uk.fujitsu.com>
- To: <graphstream-users AT litislab.fr>
- Subject: RE: Questions about RMI
- Date: Tue, 25 Oct 2011 13:58:55 +0100
- Accept-language: en-US, en-GB
- Acceptlanguage: en-US, en-GB
Hi Yoann, all,
Yes, that worked very well, thanks!
Now I have another issue. I'm doing some tests on a small example, without
using RMI.
I'm creating nodes and letting the toolkit position them freely. But then, I
want to retrieve their position to (for instance) change the view center to a
specific node and zoom on it. But I can't retrieve their x,y position.
I tried the Toolkit.nodePosition(node) and node.getNumber("x"), etc,
everything gives me a null, or NaN or 0.0.
I read somewhere that I need to enable the feedback on these variables, so I
tried calling Viewer.enableXYZfeedback(true) on the viewer returned by
graph.display() and still nothing.
Can someone help me?
Thanks and kind regards,
Nuno
-----Original Message-----
From: Yoann Pigné
[mailto:yoann.pigne AT gmail.com]
Sent: 20 October 2011 15:28
To:
graphstream-users AT litislab.fr
Subject: Re: Questions about RMI
Hi Numo,
In the documentation, the "Generator" part is just an example. Actually the
RMISink only waits for a source to register on it. A Graph is a source too,
so you can replace the "generator" part with your graph.
From the example on the documentation :
Generator gen = new XXXGenerator();
gen.addSink(sink);
can become:
Graph g = new DefaultGraph("My graph");
g.addSink(sink);
and then you can use the addNode/Edge methods you are used to :
g.addNode("node1");
g.addNode("node2");
g.addEdge("edge1", "node1","node2");
Hope It will help you,
Let us know,
Yoann
On Oct 20, 2011, at 3:55 PM,
<Nuno.Carvalho AT uk.fujitsu.com>
wrote:
>
Dear all,
>
>
I'm just started using GraphStream and I must say that this is a very
>
powerful tool.
>
Now I want to use it with the RMI functionality. I want to implement the
>
following scenario:
>
>
- Process A is generating Nodes and Edges for the Graph
>
- Process B is just getting the new nodes and edges and displaying
>
it on the screen.
>
>
For that, I've been trying to follow this tutorial:
>
http://graphstream-project.org/doc/Tutorials/Using-remote-source_1.0/
>
>
So, before I had something like this:
>
>
Graph graph = new SingleGraph("g");
>
graph.display();
>
graph.addNode(...);
>
graph.addEdge(...);
>
// and so on...
>
>
Now I have this code split in two parts:
>
>
On one side, I have the part that displays the graph on the screen, which
>
is very simple:
>
RMISource source = new RMISource();
>
Graph graph = new DefaultGraph("g");
>
source.addSink(graph);
>
graph.display();
>
>
>
On the other process, I must have an RMISink where I push the new nodes and
>
edges, right?
>
So, I must have the following:
>
RMISink sink = new RMISink();
>
Sink.register(...);
>
>
Then, according to the Tutorial, I have to create a Generator, connect it
>
to the Sink and start loop on the generator.nextEvents();
>
>
The questions that I have are the following:
>
- The generator must be implemented by myself, based on my graph
>
data source, or I can use some already implemented Generator with a
>
interface similar to what I have for graphs(addNode, addEdge, etc)?
>
- If I need to implement my own generator, how should I do it? Is
>
there any tutorial to do this? I'm missing this part: how to add nodes and
>
edges, and push it to the RMISink...
>
>
All help will be much appreciated!
>
>
Thanks and kind regards,
>
Nuno
>
>
>
>
______________________________________________________________________
>
>
Fujitsu Laboratories of Europe Limited
>
Hayes Park Central, Hayes End Road, Hayes, Middlesex, UB4 8FE
>
Registered No. 4153469
>
>
This e-mail and any attachments are for the sole use of addressee(s) and
>
may contain information which is privileged and confidential. Unauthorised
>
use or copying for disclosure is strictly prohibited. The fact that this
>
e-mail has been scanned by Trendmicro Interscan does not guarantee that
>
it has not been intercepted or amended nor that it is virus-free.
>
______________________________________________________________________
Fujitsu Laboratories of Europe Limited
Hayes Park Central, Hayes End Road, Hayes, Middlesex, UB4 8FE
Registered No. 4153469
This e-mail and any attachments are for the sole use of addressee(s) and
may contain information which is privileged and confidential. Unauthorised
use or copying for disclosure is strictly prohibited. The fact that this
e-mail has been scanned by Trendmicro Interscan does not guarantee that
it has not been intercepted or amended nor that it is virus-free.
Archives gérées par MHonArc 2.6.16.