*
*/
protected mxRectangle revalidateState(mxCellState parentState,
mxCellState state, double dx, double dy)
{
mxRectangle dirty = null;
if (state != null)
{
mxGraph graph = graphComponent.getGraph();
mxIGraphModel model = graph.getModel();
Object cell = state.getCell();
// Updates the edge terminal points and restores the
// (relative) positions of any (relative) children
if (model.isEdge(cell))
{
state.getView().updateCellState(state);
}
dirty = state.getView().getBoundingBox(state, false);
// Moves selection vertices which are relative
mxGeometry geo = graph.getCellGeometry(cell);
if ((dx != 0 || dy != 0)
&& geo != null
&& geo.isRelative()
&& model.isVertex(cell)
&& (parentState == null
|| model.isVertex(parentState.getCell()) || deltas
.get(state) != null))
{
state.setX(state.getX() + dx);
state.setY(state.getY() + dy);
// TODO: Check this change
dirty.setX(dirty.getX() + dx);
dirty.setY(dirty.getY() + dy);
graph.getView().updateLabelBounds(state);
}
int childCount = model.getChildCount(cell);
for (int i = 0; i < childCount; i++)
{
mxRectangle tmp = revalidateState(state, graph.getView()
.getState(model.getChildAt(cell, i)), dx, dy);
if (dirty != null)
{
dirty.add(tmp);