本文整理了Java中com.mxgraph.view.mxGraph.updateAlternateBounds()
方法的一些代码示例,展示了mxGraph.updateAlternateBounds()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.updateAlternateBounds()
方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:updateAlternateBounds
[英]Updates or sets the alternate bounds in the given geometry for the given cell depending on whether the cell is going to be collapsed. If no alternate bounds are defined in the geometry and collapseToPreferredSize is true, then the preferred size is used for the alternate bounds. The top, left corner is always kept at the same location.
[中]根据单元是否要折叠,更新或设置给定单元的给定几何图形中的备用边界。如果几何图形中未定义备用边界,且collapseToPreferredSize为true,则首选大小将用于备用边界。左上角始终保持在同一位置。
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Swaps the alternate and the actual bounds in the geometry of the given
* cell invoking updateAlternateBounds before carrying out the swap.
*
* @param cell Cell for which the bounds should be swapped.
* @param willCollapse Boolean indicating if the cell is going to be collapsed.
*/
public void swapBounds(Object cell, boolean willCollapse)
{
if (cell != null)
{
mxGeometry geo = model.getGeometry(cell);
if (geo != null)
{
geo = (mxGeometry) geo.clone();
updateAlternateBounds(cell, geo, willCollapse);
geo.swap();
model.setGeometry(cell, geo);
}
}
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Swaps the alternate and the actual bounds in the geometry of the given
* cell invoking updateAlternateBounds before carrying out the swap.
*
* @param cell Cell for which the bounds should be swapped.
* @param willCollapse Boolean indicating if the cell is going to be collapsed.
*/
public void swapBounds(Object cell, boolean willCollapse)
{
if (cell != null)
{
mxGeometry geo = model.getGeometry(cell);
if (geo != null)
{
geo = (mxGeometry) geo.clone();
updateAlternateBounds(cell, geo, willCollapse);
geo.swap();
model.setGeometry(cell, geo);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!