protected Collection<Object> getCellsForChange(mxUndoableChange change)
	{
		mxIGraphModel model = getGraph().getModel();
		Set<Object> result = new HashSet<Object>();

		if (change instanceof mxChildChange)
		{
			mxChildChange cc = (mxChildChange) change;
			Object parent = model.getParent(cc.getChild());

			if (cc.getChild() != null)
			{
				result.add(cc.getChild());
			}

			if (parent != null)
			{
				result.add(parent);
			}

			if (cc.getPrevious() != null)
			{
				result.add(cc.getPrevious());
			}
		}
		else if (change instanceof mxTerminalChange
				|| change instanceof mxGeometryChange)
		{
			Object cell = (change instanceof mxTerminalChange) ? ((mxTerminalChange) change)
					.getCell()
					: ((mxGeometryChange) change).getCell();

			if (cell != null)
			{
				result.add(cell);
				Object parent = model.getParent(cell);

				if (parent != null)
				{
					result.add(parent);
				}
			}
		}

		return result;
	}