本文整理了Java中com.mxgraph.view.mxGraph.cloneCells()
方法的一些代码示例,展示了mxGraph.cloneCells()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.cloneCells()
方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:cloneCells
[英]Clones all cells in the given array. To clone all children in a cell and add them to another graph: graph2.addCells(graph.cloneCells(new Object[] { parent }));
To clone all children in a graph layer if graph g1 and put them into the default parent (typically default layer) of another graph g2, the following code is used: g2.addCells(g1.cloneCells(g1.cloneCells(g1.getChildCells(g1.getDefaultParent()));
[中]克隆给定数组中的所有单元格。要克隆一个单元格中的所有子图形并将其添加到另一个图形中:graph2.addCells(graph.cloneCells(new Object[] { parent }));
要克隆图形g1中图形层中的所有子图形并将其放入另一个图形g2的默认父图形(通常为默认层),请使用以下代码:g2.addCells(g1.cloneCells(g1.cloneCells(g1.getChildCells(g1.getDefaultParent()));
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Clones all cells in the given array. To clone all children in a cell and
* add them to another graph:
*
* <code>
* graph2.addCells(graph.cloneCells(new Object[] { parent }));
* </code>
*
* To clone all children in a graph layer if graph g1 and put them into the
* default parent (typically default layer) of another graph g2, the
* following code is used:
*
* <code>
* g2.addCells(g1.cloneCells(g1.cloneCells(g1.getChildCells(g1.getDefaultParent()));
* </code>
*/
public Object[] cloneCells(Object[] cells)
{
return cloneCells(cells, true);
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Clones all cells in the given array. To clone all children in a cell and
* add them to another graph:
*
* <code>
* graph2.addCells(graph.cloneCells(new Object[] { parent }));
* </code>
*
* To clone all children in a graph layer if graph g1 and put them into the
* default parent (typically default layer) of another graph g2, the
* following code is used:
*
* <code>
* g2.addCells(g1.cloneCells(g1.cloneCells(g1.getChildCells(g1.getDefaultParent()));
* </code>
*/
public Object[] cloneCells(Object[] cells)
{
return cloneCells(cells, true);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
*
*/
public mxGraphTransferable createGraphTransferable(
mxGraphComponent graphComponent, Object[] cells,
mxRectangle bounds, ImageIcon icon)
{
return new mxGraphTransferable(graphComponent.getGraph().cloneCells(
cells), bounds, icon);
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
*
*/
public mxGraphTransferable createGraphTransferable(
mxGraphComponent graphComponent, Object[] cells,
mxRectangle bounds, ImageIcon icon)
{
return new mxGraphTransferable(graphComponent.getGraph().cloneCells(
cells), bounds, icon);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
*
*/
public Object createTargetVertex(MouseEvent e, Object source)
{
mxGraph graph = graphComponent.getGraph();
Object clone = graph.cloneCells(new Object[] { source })[0];
mxIGraphModel model = graph.getModel();
mxGeometry geo = model.getGeometry(clone);
if (geo != null)
{
mxPoint point = graphComponent.getPointForEvent(e);
geo.setX(graph.snap(point.getX() - geo.getWidth() / 2));
geo.setY(graph.snap(point.getY() - geo.getHeight() / 2));
}
return clone;
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
*
*/
public Object createTargetVertex(MouseEvent e, Object source)
{
mxGraph graph = graphComponent.getGraph();
Object clone = graph.cloneCells(new Object[] { source })[0];
mxIGraphModel model = graph.getModel();
mxGeometry geo = model.getGeometry(clone);
if (geo != null)
{
mxPoint point = graphComponent.getPointForEvent(e);
geo.setX(graph.snap(point.getX() - geo.getWidth() / 2));
geo.setY(graph.snap(point.getY() - geo.getHeight() / 2));
}
return clone;
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
Object clone = graph.cloneCells(new Object[] { edge })[0];
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
Object clone = graph.cloneCells(new Object[] { edge })[0];
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
newEdge = cloneCells(new Object[] { edge })[0];
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
newEdge = cloneCells(new Object[] { edge })[0];
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
cells = cloneCells(cells, isCloneInvalidEdges());
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
cells = cloneCells(cells, isCloneInvalidEdges());
内容来源于网络,如有侵权,请联系作者删除!