recuperate node's id
-
- Posts:9
- Joined:10 Apr 2013 20:18 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
hi everybody,
I need to know how to recuperate the id of a node selected in the graphe in aim to send this value to a server which send me back a new graph.
Please is there any body can help me
I need to know how to recuperate the id of a node selected in the graphe in aim to send this value to a server which send me back a new graph.
Please is there any body can help me
-
- Posts:9
- Joined:10 Apr 2013 20:18 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: recuperate node's id
Any help please ..
Re: recuperate node's id
Sorry but the question is not very clear. From the UI just select the node by choosing the icon with the arrow ans question mark on it then clicking on the node. You can then read the info for this node in the "Edit" window.
Best,
Clement
Best,
Clement
-
- Posts:9
- Joined:10 Apr 2013 20:18 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: recuperate node's id
hi Clement, thanks for your reply,
my task consists in creating a new panel in wich i added a text area , what i want to do is when selecting a node from a graph i can recuperate its ID in that text area. I need to know which class or method should i use and where should i implement it, i tried to use the Edit.java class but i'm lost
Can you please help me
my task consists in creating a new panel in wich i added a text area , what i want to do is when selecting a node from a graph i can recuperate its ID in that text area. I need to know which class or method should i use and where should i implement it, i tried to use the Edit.java class but i'm lost
Can you please help me
-
- Posts:9
- Joined:10 Apr 2013 20:18 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: recuperate node's id
please any idea, i need a code java which helps me to recuperate the node's id in my class TopComponent.. please help
- eduramiba
- Gephi Code Manager
- Posts:1064
- Joined:22 Mar 2010 15:30
- Location:Madrid, Spain [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: recuperate node's id
Hi,
If you want to write an on-right-click menu action, check this page http://wiki.gephi.org/index.php/HowTo_e ... y_features (pay special attention to the GraphContextMenuItem comment). Also, you can see real examples in Gephi here
In the implementation you receive the nodes, so you can easily retrieve their ids.
Or, if you want to create your own tool for selection, implement this https://github.com/gephi/gephi/blob/mas ... /Tool.java in a similar way. Real example of the Edit Tool.
If you want to get/listen to node selection in the Graph window in general from any tool, I think there is no way to do this at the moment because the Visualization module is not modular enough.
Eduardo
If you want to write an on-right-click menu action, check this page http://wiki.gephi.org/index.php/HowTo_e ... y_features (pay special attention to the GraphContextMenuItem comment). Also, you can see real examples in Gephi here
In the implementation you receive the nodes, so you can easily retrieve their ids.
Or, if you want to create your own tool for selection, implement this https://github.com/gephi/gephi/blob/mas ... /Tool.java in a similar way. Real example of the Edit Tool.
If you want to get/listen to node selection in the Graph window in general from any tool, I think there is no way to do this at the moment because the Visualization module is not modular enough.
Eduardo
-
- Posts:9
- Joined:10 Apr 2013 20:18 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: recuperate node's id
Hi Eduardo, thanks a lot for your reply,
I tried to make my own tool for selection and i tried to implement it in the same way like the edit tool but instead of using the EditWindowControlle i used my own class" propriety_nodeTopComponent" of my new plugin but nothing worked. Here is the code of my tool Selection:
package org.myname.node;
import javax.swing.Icon;
import javax.swing.JPanel;
import org.gephi.graph.api.Node;
import org.gephi.tools.spi.NodeClickEventListener;
import org.gephi.tools.spi.Tool;
import org.gephi.tools.spi.ToolEventListener;
import org.gephi.tools.spi.ToolSelectionType;
import org.gephi.tools.spi.ToolUI;
import org.openide.util.Lookup;
import org.openide.util.lookup.ServiceProvider;
/**
*
* @author basma
*/
@ServiceProvider(service = Tool.class)
public class Selection implements Tool{
private propriety_nodeTopComponent edc;
@Override
public void select() {
edc=Lookup.getDefault().lookup(propriety_nodeTopComponent.class);
edc.componentOpened();
}
@Override
public void unselect() {
}
@Override
public ToolEventListener[] getListeners() {
return new ToolEventListener[]{new NodeClickEventListener() {
@Override
public void clickNodes(Node[] nodes) {
System.out.println("node clicked");
}
}};
}
@Override
public ToolUI getUI() {
return new ToolUI() {
@Override
public JPanel getPropertiesBar(Tool tool) {
return new JPanel();
}
@Override
public Icon getIcon() {
return null;//new ImageIcon(getClass().getResource("/org/gephi/ui/tools/plugin/edit/edit.png"));
}
@Override
public String getName() {
return null;
}
@Override
public String getDescription() {
return null;//NbBundle.getMessage(Selection.class, "Selection.description");
}
@Override
public int getPosition() {
return 200;
}
};
}
@Override
public ToolSelectionType getSelectionType() {
return ToolSelectionType.SELECTION;
}
}
would you please give me some advice
I tried to make my own tool for selection and i tried to implement it in the same way like the edit tool but instead of using the EditWindowControlle i used my own class" propriety_nodeTopComponent" of my new plugin but nothing worked. Here is the code of my tool Selection:
package org.myname.node;
import javax.swing.Icon;
import javax.swing.JPanel;
import org.gephi.graph.api.Node;
import org.gephi.tools.spi.NodeClickEventListener;
import org.gephi.tools.spi.Tool;
import org.gephi.tools.spi.ToolEventListener;
import org.gephi.tools.spi.ToolSelectionType;
import org.gephi.tools.spi.ToolUI;
import org.openide.util.Lookup;
import org.openide.util.lookup.ServiceProvider;
/**
*
* @author basma
*/
@ServiceProvider(service = Tool.class)
public class Selection implements Tool{
private propriety_nodeTopComponent edc;
@Override
public void select() {
edc=Lookup.getDefault().lookup(propriety_nodeTopComponent.class);
edc.componentOpened();
}
@Override
public void unselect() {
}
@Override
public ToolEventListener[] getListeners() {
return new ToolEventListener[]{new NodeClickEventListener() {
@Override
public void clickNodes(Node[] nodes) {
System.out.println("node clicked");
}
}};
}
@Override
public ToolUI getUI() {
return new ToolUI() {
@Override
public JPanel getPropertiesBar(Tool tool) {
return new JPanel();
}
@Override
public Icon getIcon() {
return null;//new ImageIcon(getClass().getResource("/org/gephi/ui/tools/plugin/edit/edit.png"));
}
@Override
public String getName() {
return null;
}
@Override
public String getDescription() {
return null;//NbBundle.getMessage(Selection.class, "Selection.description");
}
@Override
public int getPosition() {
return 200;
}
};
}
@Override
public ToolSelectionType getSelectionType() {
return ToolSelectionType.SELECTION;
}
}
would you please give me some advice
-
- Posts:9
- Joined:10 Apr 2013 20:18 [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: recuperate node's id
thanks a lot Eduardo , i'll see it, i want to ask if there any possibility of acess to the data table and parsing it with a code java
Basma
Basma
- eduramiba
- Gephi Code Manager
- Posts:1064
- Joined:22 Mar 2010 15:30
- Location:Madrid, Spain [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Re: recuperate node's id
Use Attributes API for accessing graph attributes.
An example: http://wiki.gephi.org/index.php/Toolkit ... attributes
You can also take a look at other kinds of examples http://wiki.gephi.org/index.php/Toolkit_portal
Eduardo
An example: http://wiki.gephi.org/index.php/Toolkit ... attributes
You can also take a look at other kinds of examples http://wiki.gephi.org/index.php/Toolkit_portal
Eduardo