gpt4 book ai didi

java - Gephi:如何向节点添加新属性?

转载 作者:行者123 更新时间:2023-11-30 07:08:46 29 4
gpt4 key购买 nike

我想关注this guide将现在的 Int 属性“val”添加到我的节点。本教程建议使用

AttributeController ac = Lookup.getDefault().lookup(AttributeController.class);
AttributeModel model = ac.getModel();

但是AttributeController不存在/找不到。

我正在使用最新的工具包 .jar 版本 0.9.1,从 the download page 下载。在这里您可以找到the JavaDoc .

问题:如何向图表的节点添加 val 属性,以便 node.setAttribute("val", 1) 正常工作? (当前抛出java.lang.IllegalArgumentException:找不到列“val”)

最佳答案

我刚刚通过 JavaDoc 中的变更日志通知发现了这一点:

(April 07 2013) Complete rewrite of the GraphAPI and add GraphStore as dependency. The new API is entirely defined in the GraphStore project and Gephi makes it available through the GraphAPI. The AttributesAPI functionalities have been consolidated into the new graph API and therefore has been removed. There is too many API changes to be listed all but notable ones are the following.

  • All attribute features (e.g. add column) are now directly accessible from the GraphModel, and there's no more AttributeModel.

工作方式如下:

GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getGraphModel();
graphModel.getNodeTable().addColumn("val", Integer.class);

关于java - Gephi:如何向节点添加新属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39577117/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com