* model.
*/
public mxRectangle processChange(mxUndoableChange change,
boolean invalidate, boolean ignoreDirty)
{
mxRectangle result = null;
if (change instanceof mxRootChange)
{
result = (ignoreDirty) ? null : getGraphBounds();
if (invalidate)
{
clearSelection();
removeStateForCell(((mxRootChange) change).getPrevious());
if (isResetViewOnRootChange())
{
view.setEventsEnabled(false);
try
{
view.scaleAndTranslate(1, 0, 0);
}
finally
{
view.setEventsEnabled(true);
}
}
}
fireEvent(new mxEventObject(mxEvent.ROOT));
}
else if (change instanceof mxChildChange)
{
mxChildChange cc = (mxChildChange) change;
// Repaints the parent area if it is a rendered cell (vertex or
// edge) otherwise only the child area is repainted, same holds
// if the parent and previous are the same object, in which case
// only the child area needs to be repainted (change of order)
if (!ignoreDirty)
{
if (cc.getParent() != cc.getPrevious())
{
if (model.isVertex(cc.getParent())
|| model.isEdge(cc.getParent()))
{
result = getBoundingBox(cc.getParent(), true, true);
}
if (model.isVertex(cc.getPrevious())
|| model.isEdge(cc.getPrevious()))
{
if (result != null)
{
result.add(getBoundingBox(cc.getPrevious(), true,
true));
}
else
{
result = getBoundingBox(cc.getPrevious(), true,