0
我已經編碼了下面的代碼(代碼的一些摘錄)來顯示一個節點爲矩形,但它沒有工作。它只是顯示一個簡單的節點。如何通過PREFUSE可視化工具包爲JAVA顯示節點的矩形形狀?
代碼摘錄:
...
ShapeAction nodeShape = new NodeShapeAction(treeNodes); // treeNodes is a datagroup representing the tree nodes
m_vis.putAction("nodeShape", nodeShape); // m_vis is referring the visualization object
m_vis.run(nodeShape);
....
/**
* Set node shapes
*/
public static class NodeShapeAction extends ShapeAction {
public NodeShapeAction(String group) {
super(group);
add("type == 'APPLICATION'", Constants.SHAPE_RECTANGLE);
add("type == 'DATABASE'", Constants.SHAPE_STAR);
add("type == 'INTERFACE'", Constants.SHAPE_ELLIPSE);
}
} // end of inner class NodeShapeAction