我试图仅在JGraphX中禁用边缘选择。如果我打电话
mxgraph.setCellsSelectable(false);这将禁用所有单元格上的选择,而不仅仅是边缘。有类似于setEdgesSelectable()的东西吗?
发布于 2013-12-04 15:59:17
覆盖:
public boolean isCellsSelectable()在mxGraph子类中使用该子类。默认情况下返回mxgraph.cellsSelectable。您需要这样的东西(完全没有测试):
public boolean isCellsSelectable()
{
if (model.isEdge())
{
return false;
}
return cellsSelectable;
}发布于 2016-09-27 22:38:30
到今天为止,当前的JGraphX版本(3.6)并没有大卫的答案中提到的isCellsSelectable()方法,但基本上解决方案保持不变。
您只需使用isCellSelectable(Object cell)方法,如下所示:
public boolean isCellSelectable(Object cell)
{
if (model.isEdge(cell))
{
return false;
}
return super.isCellSelectable(cell);
}https://stackoverflow.com/questions/20375151
复制相似问题