Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/467.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何在mxGraph中使用曲线边样式_Javascript_Mxgraph - Fatal编程技术网

Javascript 如何在mxGraph中使用曲线边样式

Javascript 如何在mxGraph中使用曲线边样式,javascript,mxgraph,Javascript,Mxgraph,mxGraph的最新版本添加了曲线作为边的样式。我希望这是一种边缘布线风格,但似乎不是。有人能给我举一个曲线边图形的小例子吗?它实际上是边的形状样式: style = graph.getStylesheet().getDefaultEdgeStyle(); style[mxConstants.STYLE_CURVED] = '1'; 将其设置为所有边的默认值 边缘样式实际上是源和目标之间边缘控制点的定位。曲线不是布线(此点定位),它只是通过这些点的样式,因此它不是边样式。在当前版本中,您可以使

mxGraph的最新版本添加了曲线作为边的样式。我希望这是一种边缘布线风格,但似乎不是。有人能给我举一个曲线边图形的小例子吗?

它实际上是边的形状样式:

style = graph.getStylesheet().getDefaultEdgeStyle();
style[mxConstants.STYLE_CURVED] = '1';
将其设置为所有边的默认值


边缘样式实际上是源和目标之间边缘控制点的定位。曲线不是布线(此点定位),它只是通过这些点的样式,因此它不是边样式。

在当前版本中,您可以使用以下内容:

    mxGraph graph = new mxGraph();
    Map<String, Object> style = graph.getStylesheet().getDefaultEdgeStyle();
    style.put(mxConstants.STYLE_ROUNDED, true);
    style.put(mxConstants.STYLE_EDGE, mxConstants.EDGESTYLE_ENTITY_RELATION);
mxGraph-graph=新的mxGraph();
映射样式=graph.getStylesheet().getDefaultEdgeStyle();
style.put(mxConstants.style_四舍五入,true);
style.put(mxConstants.style_EDGE,mxConstants.EDGESTYLE_ENTITY_RELATION);

这个问题与JavaScript有关,与Java无关。