本文整理了Java中com.mxgraph.view.mxGraph.isCellSelectable()
方法的一些代码示例,展示了mxGraph.isCellSelectable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.isCellSelectable()
方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:isCellSelectable
[英]Returns true if the given cell is selectable. This implementation returns .
[中]如果给定单元格是可选的,则返回true。这个实现返回。
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Returns the first selectable cell in the given array of cells.
*
* @param cells Array of cells to return the first selectable cell for.
* @return Returns the first cell that may be selected.
*/
protected Object getFirstSelectableCell(Object[] cells)
{
if (cells != null)
{
for (int i = 0; i < cells.length; i++)
{
if (graph.isCellSelectable(cells[i]))
{
return cells[i];
}
}
}
return null;
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Returns the first selectable cell in the given array of cells.
*
* @param cells Array of cells to return the first selectable cell for.
* @return Returns the first cell that may be selected.
*/
protected Object getFirstSelectableCell(Object[] cells)
{
if (cells != null)
{
for (int i = 0; i < cells.length; i++)
{
if (graph.isCellSelectable(cells[i]))
{
return cells[i];
}
}
}
return null;
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
*
*/
public void addCells(Object[] cells)
{
if (cells != null)
{
Collection<Object> remove = null;
if (singleSelection)
{
remove = this.cells;
cells = new Object[] { getFirstSelectableCell(cells) };
}
List<Object> tmp = new ArrayList<Object>(cells.length);
for (int i = 0; i < cells.length; i++)
{
if (!isSelected(cells[i]) && graph.isCellSelectable(cells[i]))
{
tmp.add(cells[i]);
}
}
changeSelection(tmp, remove);
}
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Clears the selection and adds the given cells.
*/
public void setCells(Object[] cells)
{
if (cells != null)
{
if (singleSelection)
{
cells = new Object[] { getFirstSelectableCell(cells) };
}
List<Object> tmp = new ArrayList<Object>(cells.length);
for (int i = 0; i < cells.length; i++)
{
if (graph.isCellSelectable(cells[i]))
{
tmp.add(cells[i]);
}
}
changeSelection(tmp, this.cells);
}
else
{
clear();
}
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
*
*/
public void addCells(Object[] cells)
{
if (cells != null)
{
Collection<Object> remove = null;
if (singleSelection)
{
remove = this.cells;
cells = new Object[] { getFirstSelectableCell(cells) };
}
List<Object> tmp = new ArrayList<Object>(cells.length);
for (int i = 0; i < cells.length; i++)
{
if (!isSelected(cells[i]) && graph.isCellSelectable(cells[i]))
{
tmp.add(cells[i]);
}
}
changeSelection(tmp, remove);
}
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Clears the selection and adds the given cells.
*/
public void setCells(Object[] cells)
{
if (cells != null)
{
if (singleSelection)
{
cells = new Object[] { getFirstSelectableCell(cells) };
}
List<Object> tmp = new ArrayList<Object>(cells.length);
for (int i = 0; i < cells.length; i++)
{
if (graph.isCellSelectable(cells[i]))
{
tmp.add(cells[i]);
}
}
changeSelection(tmp, this.cells);
}
else
{
clear();
}
}
内容来源于网络,如有侵权,请联系作者删除!