protected mxPoint getOriginForCell(Object cell)
	{
		mxPoint result = origins.get(cell);

		if (result == null)
		{
			mxGraph graph = graphComponent.getGraph();

			if (cell != null)
			{
				result = new mxPoint(getOriginForCell(graph.getModel()
						.getParent(cell)));
				mxGeometry geo = graph.getCellGeometry(cell);

				// TODO: Handle offset, relative geometries etc
				if (geo != null)
				{
					result.setX(result.getX() + geo.getX());
					result.setY(result.getY() + geo.getY());
				}
			}

			if (result == null)
			{
				mxPoint t = graph.getView().getTranslate();
				result = new mxPoint(-t.getX(), -t.getY());
			}

			origins.put(cell, result);
		}

		return result;
	}