public void setGridGraphSpacing(mxAnalysisGraph aGraph, double xSpacing, double ySpacing, int numColumns, int numRows)
	{
		mxGraph graph = aGraph.getGraph();

		if (xSpacing < 0 || ySpacing < 0 || numColumns < 1 || numRows < 1)
		{
			throw new IllegalArgumentException();
		}

		Object parent = graph.getDefaultParent();
		Object[] vertices = aGraph.getChildVertices(parent);
		mxIGraphModel model = graph.getModel();

		for (int i = 0; i < numRows; i++)
		{
			for (int j = 0; j < numColumns; j++)
			{
				Object currVertex = vertices[i * numColumns + j];
				mxGeometry geometry = model.getGeometry(currVertex);
				geometry.setX(j * xSpacing);
				geometry.setY(i * ySpacing);
			}
		}
	};