为什么下面的这个graphml文件不能在PREFUSE中正确地渲染节点颜色?
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
<graph edgedefault="undirected">
<key id ="color" for="node" attr.name="color" attr.type="String">
<default>pink</default>
</key>
<key id="name" for="node" attr.name="name" attr.type="string">
<default>hey</default>
</key>
<node id="7534">
<data key="color">green</data>
<data key="name">hey!</data>
</node>
</graph>
</graphml>谢谢
发布于 2012-03-29 20:47:48
AFAIK prefuse不会自动设置节点颜色。它像对待任何其他字段一样对待color。
尝试使用DataColorAction
ColorAction color = new DataColorAction(
PrefuseLib.getGroupName("data", Graph.NODES),
"color", Constants.NOMINAL, VisualItem.FILLCOLOR, palette);请注意,您仍然需要根据您的颜色设置int[] palette。
https://stackoverflow.com/questions/9909004
复制相似问题