本文整理了Java中com.mxgraph.view.mxGraph.getCellGeometry()
方法的一些代码示例,展示了mxGraph.getCellGeometry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.getCellGeometry()
方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:getCellGeometry
[英]Returns the geometry for the given cell.
[中]返回给定单元格的几何图形。
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Returns the bounding box for the geometries of the vertices in the
* given array of cells.
*/
public mxRectangle getBoundingBoxFromGeometry(Object[] cells)
{
mxRectangle result = null;
if (cells != null)
{
for (int i = 0; i < cells.length; i++)
{
if (getModel().isVertex(cells[i]))
{
mxGeometry geo = getCellGeometry(cells[i]);
if (result == null)
{
result = new mxRectangle(geo);
}
else
{
result.add(geo);
}
}
}
}
return result;
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Returns the bounding box for the geometries of the vertices in the
* given array of cells.
*/
public mxRectangle getBoundingBoxFromGeometry(Object[] cells)
{
mxRectangle result = null;
if (cells != null)
{
for (int i = 0; i < cells.length; i++)
{
if (getModel().isVertex(cells[i]))
{
mxGeometry geo = getCellGeometry(cells[i]);
if (result == null)
{
result = new mxRectangle(geo);
}
else
{
result.add(geo);
}
}
}
}
return result;
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Returns the top, left corner of the given cell.
*/
protected mxPoint getOriginForCell(Object cell)
{
mxPoint result = origins.get(cell);
if (result == null)
{
mxGraph graph = graphComponent.getGraph();
if (cell != null)
{
result = new mxPoint(getOriginForCell(graph.getModel()
.getParent(cell)));
mxGeometry geo = graph.getCellGeometry(cell);
// TODO: Handle offset, relative geometries etc
if (geo != null)
{
result.setX(result.getX() + geo.getX());
result.setY(result.getY() + geo.getY());
}
}
if (result == null)
{
mxPoint t = graph.getView().getTranslate();
result = new mxPoint(-t.getX(), -t.getY());
}
origins.put(cell, result);
}
return result;
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Returns the top, left corner of the given cell.
*/
protected mxPoint getOriginForCell(Object cell)
{
mxPoint result = origins.get(cell);
if (result == null)
{
mxGraph graph = graphComponent.getGraph();
if (cell != null)
{
result = new mxPoint(getOriginForCell(graph.getModel()
.getParent(cell)));
mxGeometry geo = graph.getCellGeometry(cell);
// TODO: Handle offset, relative geometries etc
if (geo != null)
{
result.setX(result.getX() + geo.getX());
result.setY(result.getY() + geo.getY());
}
}
if (result == null)
{
mxPoint t = graph.getView().getTranslate();
result = new mxPoint(-t.getX(), -t.getY());
}
origins.put(cell, result);
}
return result;
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
mxGeometry geo = graph.getCellGeometry(cell);
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
mxGeometry geo = graph.getCellGeometry(cell);
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Sets the fixed source or target terminal point on the given edge.
*
* @param edge
* Cell state whose initial terminal points should be updated.
*/
public void updateFixedTerminalPoint(mxCellState edge,
mxCellState terminal, boolean source,
mxConnectionConstraint constraint)
{
mxPoint pt = null;
if (constraint != null)
{
pt = graph.getConnectionPoint(terminal, constraint);
}
if (pt == null && terminal == null)
{
mxPoint orig = edge.getOrigin();
mxGeometry geo = graph.getCellGeometry(edge.getCell());
pt = geo.getTerminalPoint(source);
if (pt != null)
{
pt = new mxPoint(scale
* (translate.getX() + pt.getX() + orig.getX()), scale
* (translate.getY() + pt.getY() + orig.getY()));
}
}
edge.setAbsoluteTerminalPoint(pt, source);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Sets the fixed source or target terminal point on the given edge.
*
* @param edge
* Cell state whose initial terminal points should be updated.
*/
public void updateFixedTerminalPoint(mxCellState edge,
mxCellState terminal, boolean source,
mxConnectionConstraint constraint)
{
mxPoint pt = null;
if (constraint != null)
{
pt = graph.getConnectionPoint(terminal, constraint);
}
if (pt == null && terminal == null)
{
mxPoint orig = edge.getOrigin();
mxGeometry geo = graph.getCellGeometry(edge.getCell());
pt = geo.getTerminalPoint(source);
if (pt != null)
{
pt = new mxPoint(scale
* (translate.getX() + pt.getX() + orig.getX()), scale
* (translate.getY() + pt.getY() + orig.getY()));
}
}
edge.setAbsoluteTerminalPoint(pt, source);
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
mxGeometry geo = graph.getCellGeometry(cell);
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
mxGeometry geo = graph.getCellGeometry(cell);
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
mxGeometry geo = graph.getCellGeometry(previewState.getCell());
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
mxGeometry geo = graph.getCellGeometry(cell);
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
mxGeometry geo = graph.getCellGeometry(cell);
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
mxGeometry geo = graph.getCellGeometry(previewState.getCell());
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
if (getCellGeometry(group) == null)
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
if (getCellGeometry(group) == null)
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
mxRectangle bounds = graph.getBoundingBoxFromGeometry(children);
mxGeometry geometry = graph.getCellGeometry(group);
double left = 0;
double top = 0;
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
mxRectangle bounds = graph.getBoundingBoxFromGeometry(children);
mxGeometry geometry = graph.getCellGeometry(group);
double left = 0;
double top = 0;
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
mxGeometry geo = getCellGeometry(cells[i]);
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
mxGeometry geo = getCellGeometry(cells[i]);
内容来源于网络,如有侵权,请联系作者删除!