- From: <mahmoudmubarak AT gmail.com>
- To: graphstream-users AT litislab.fr
- Subject: view.getCamera().isVisible(GraphicElement)
- Date: Tue, 23 Feb 2016 15:18:56 +0100 (CET)
I've defined my objects like that:
Graph graph = new SingleGraph("CLA");
Viewer CLAgraphViewer = new Viewer(graph,
Viewer.ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
View view = CLAgraphViewer.addDefaultView(true);
CLAgraphViewer.enableAutoLayout();
.
.
Node a = graph.addNode("a");
Node b = graph.addNode("b");
.
.
and so on.
After doing lots of zooming and setting new center with
view.getCamera().setViewPercent, and view.getCamera().setViewCenter
respectively, I've tried to check if a specific node is in the view so I want
to do something like that:
view.getCamera().isVisible(a);
But, it seems that I should pass GraphicElement variable to isVisible() to
work. I've tried to cast Node to GraphicELement, but error appeared in
runtime:
"org.graphstream.graph.implementations.SingleNode cannot be cast to
org.graphstream.ui.graphicGraph.GraphicElement"
So, how should I get a GraphicElement from Node?
Thank you in advance.
- view.getCamera().isVisible(GraphicElement), mahmoudmubarak, 23/02/2016
Archives gérées par MHonArc 2.6.16.