我是一个新的mxgraph用户,所以我对mxgraph的了解很差。我将尽可能清楚地解释我的问题:我想用mxgraph替换一个新的图像。有没有办法用mxgraph做到这一点?我尝试过graph.setCellStyles函数,或者这样做:
mxGraph.prototype.getImage = function(state)
{
if (state != null && state.style != null)
{
return state.style[mxConstants.STYLE_IMAGE];
}
return null;
}但它不起作用。提前谢谢你。
发布于 2020-09-22 15:58:47
Java解决方案:
graph.getView().getState(cell).getStyle().replace(mxConstants.STYLE_IMAGE, new ImageIcon( GraphViewer.class.getResource("/com/mxgraph/examples/swing/images/cube_green.png")));https://stackoverflow.com/questions/55004298
复制相似问题