[Gephi-plugins] Proper way of using customized attribute columns

Shaun Roach sroach at alchemyapi.com
Wed Nov 3 20:25:46 CET 2010


Hello,

I am trying to fix my plugin.  On the newest release of Gephi, it crashes
when I attempt to use new attribute columns.
Here is how I am trying to set these columns:

AttributeTable nodeTable = attributeModel.getNodeTable();
AttributeColumn inCol = nodeTable.addColumn("alchemyrelevance", "AlchemyAPI
Relevance", AttributeType.DOUBLE, AttributeOrigin.DATA, 0.0);

NodeDraft firstNode = container.factory().newNodeDraft();
firstNode.addAttributeValue(inCol,  0.75);

When I do this I get an exception :

java.lang.IllegalArgumentException: The value column doesn't exist
        at
org.gephi.data.attributes.AttributeRowImpl.setValue(AttributeRowImpl.java:109)
        at
org.gephi.data.attributes.AttributeRowImpl.setValue(AttributeRowImpl.java:101)
        at
org.gephi.io.importer.impl.NodeDraftImpl.addAttributeValue(NodeDraftImpl.java:215)
        at
com.alchemyapi.gephi.plugin.AlchemyAction.generate(AlchemyAction.java:151)


What's the proper way to put an attribute value into a new NodeDraft for my
generator?

Thanks for your help!

Shaun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gephi.org/pipermail/gephi-plugins/attachments/20101103/fd480cb8/attachment.html>


More information about the gephi-plugins mailing list