* @param cell Cell for which the points in the state should be updated.
* @return Returns the bounding box for the given cell.
*/
public mxRectangle validatePoints(mxCellState parentState, Object cell)
{
mxIGraphModel model = graph.getModel();
mxCellState state = getState(cell);
mxRectangle bbox = null;
if (state != null)
{
if (state.isInvalid())
{
mxGeometry geo = graph.getCellGeometry(cell);
if (geo != null && model.isEdge(cell))
{
// Updates the points on the source terminal if its an edge
mxCellState source = getState(getVisibleTerminal(cell, true));
if (source != null && model.isEdge(source.getCell())
&& !model.isAncestor(source, cell))
{
mxCellState tmp = getState(model.getParent(source
.getCell()));
validatePoints(tmp, source);
}
// Updates the points on the source terminal if its an edge
mxCellState target = getState(getVisibleTerminal(cell,
false));
if (target != null && model.isEdge(target.getCell())
&& !model.isAncestor(target, cell))
{
mxCellState tmp = getState(model.getParent(target
.getCell()));
validatePoints(tmp, target);
}
updateFixedTerminalPoints(state, source, target);
updatePoints(state, geo.getPoints(), source, target);
updateFloatingTerminalPoints(state, source, target);
updateEdgeBounds(state);
state.setAbsoluteOffset(getPoint(state, geo));
}
else if (geo != null && geo.isRelative() && parentState != null
&& model.isEdge(parentState.getCell()))
{
mxPoint origin = getPoint(parentState, geo);
if (origin != null)
{
state.setX(origin.getX());
state.setY(origin.getY());
origin.setX((origin.getX() / scale) - translate.getX());
origin.setY((origin.getY() / scale) - translate.getY());
state.setOrigin(origin);
childMoved(parentState, state);
}
}
state.setInvalid(false);
}
if (model.isEdge(cell) || model.isVertex(cell))
{
updateLabelBounds(state);
bbox = new mxRectangle(updateBoundingBox(state));
}
}
if (state != null
&& (!graph.isCellCollapsed(cell) || cell == currentRoot))
{
int childCount = model.getChildCount(cell);
for (int i = 0; i < childCount; i++)
{
Object child = model.getChildAt(cell, i);
mxRectangle bounds = validatePoints(state, child);
if (bounds != null)
{
if (bbox == null)