protected Point measureLayout(GraphicalRepresentationElement repr)
	{
		int height = 0;
		int width = 0;
		switch(repr.type)
		{
		case ELEMENT_CONTAINER:
			for(GraphicalRepresentationElement sub : repr.connected)
			{
				Point result = measureLayout(sub);
				if(result.y > height)
					height = result.y;
				width += result.x;
			}
			return repr.setSize(new Point(width, height)).subSize;
		case EDGE:
			return repr.setSize(measureLayout(repr.connected.get(1))).subSize;
		case NODE:
			for(GraphicalRepresentationElement sub : repr.connected)
			{
				if(sub.edgeType != EdgeType.CHILDLINK)
					continue;
				Point result = measureLayout(sub);
				if(result.y > height)
					height = result.y;
				// add 1 so that forelinks don't have a chance to pass through the node itself
				width += result.x;
			}
			return repr.setSize(new Point((width == 0) ? 1 : width + 1, height + 1)).subSize;
		default:
			return new Point(width, height);
		}
	}