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)