public void setBipartiteGraphSpacing(mxAnalysisGraph aGraph, int numVerticesGroup1, int numVerticesGroup2, double vertexSpacing,
			double groupSpacing)
	{
		if (numVerticesGroup1 < 0 || numVerticesGroup2 < 0)
		{
			throw new IllegalArgumentException();
		}

		mxGraph graph = aGraph.getGraph();
		double group1StartY = 0;
		double group2StartY = 0;
		Object parent = graph.getDefaultParent();
		mxIGraphModel model = graph.getModel();

		if (numVerticesGroup1 < numVerticesGroup2)
		{
			double centerYtimes2 = (numVerticesGroup2 * vertexSpacing);
			group1StartY = (centerYtimes2 - (numVerticesGroup1 * vertexSpacing)) / 2;
		}
		else
		{
			double centerYtimes2 = (numVerticesGroup1 * vertexSpacing);
			group2StartY = (centerYtimes2 - (numVerticesGroup2 * vertexSpacing)) / 2;
		}

		Object[] vertices = aGraph.getChildVertices(parent);

		// position vertexes for group 1
		for (int i = 0; i < numVerticesGroup1; i++)
		{
			Object currVertex = vertices[i];
			mxGeometry geometry = model.getGeometry(currVertex);
			geometry.setX(0);
			geometry.setY(group1StartY + i * vertexSpacing);
		}

		// position vertexes for group 2
		for (int i = numVerticesGroup1; i < numVerticesGroup1 + numVerticesGroup2; i++)
		{
			Object currVertex = vertices[i];
			mxGeometry geometry = model.getGeometry(currVertex);
			geometry.setX(groupSpacing);
			geometry.setY(group2StartY + (i - numVerticesGroup1) * vertexSpacing);
		}
	};