我的问题是用jgraph绘图后,拖动cell后edge显示有问题,edge折断了一样。
我用的是netBeans开发平台,如果将cells insert到GraphLayoutCache视图里面,之后再将graph加到frame里面显示出来是没有以上所说问题的。但是如果先将jgraph作为组件添加到frame上面,然后试图通过按键事件去动态地生成拓扑图,虽然生成是成功的,但是拖动cell后edge显示就有问题,edge折断了一样。
我用的是netBeans开发平台,如果将cells insert到GraphLayoutCache视图里面,之后再将graph加到frame里面显示出来是没有以上所说问题的。但是如果先将jgraph作为组件添加到frame上面,然后试图通过按键事件去动态地生成拓扑图,虽然生成是成功的,但是拖动cell后edge显示就有问题,edge折断了一样。
解决方案 »
- SSH整合注入多个DAO的问题
- servlet无法加载,求高手解决
- java反编译jar为Java文件
- 请问javac编译后的class文件就算是字节码吗,谢谢
- hibernate总说映射不上怎么回事呢
- 请教 iReport 问题
- 救命啊 JBOSS报错,帮帮忙啊
- import com.microsoft.*出现错误了
- 问一下String 初始化问题;;;;;;
- 最近想研究hibernate,问一下,这个现在用的多吗??好象比较流行???
- java-->struts-->jsp的form中输入冷僻中文简体汉字,进入action后从Actionform中取出的中文为乱玛问题,搜不到可行的解决方案,只能弱弱地再问一遍...
- 导入excel文件 内存溢出
I make some investigation:
- I tried older version of jgraph (5.10.2.0) and it worked fine there, it doesn't work in version 5.11
- I realised, that graph is repainted well everytime after I call (I made button action with only this line):
graph.getSelectionModel().clearSelection(); I finally found "not nice" solution
I overrided applyMap method in AttributeMap (this method is called everytime object is dropped, label is changed, edge is moved, ..) and repainted the graph before If somebody knows of better (nicer) solution or have some idea, let me know, for now it works well
public AttributeMap applyMap(Map change) {
// these 3 lines solve repaint graph problems
WD.INSTANCE.getCurrentGraph().clearSelection();
WD.INSTANCE.getCurrentGraph().getGraphLayoutCache().reload();
WD.INSTANCE.getCurrentGraph().repaint(); if (!change.containsKey(GraphConstants.VALUE)) {
...
...
}
解决方法参考自http://www.jgraph.com/forum/viewtopic.php?t=3985&highlight=drag+cell