public static Rectangle parseLoadRect(String data){
		Rectangle rect = new Rectangle();
		Point pt;
		boolean ptSet = false;
		boolean dimSet = false;
		for (String l : data.split("\n")){
			if (l.matches("pt +\\([0-9]+, ?[0-9]+\\)")){
				pt = parsePoint(l.substring(l.indexOf("("), l.indexOf(")")+1));
				rect.setLocation(pt);
				ptSet = true;
				if (ptSet && dimSet) break;
			} else if (l.matches("dim +\\([0-9]+, ?[0-9]+\\)")){
				pt = parsePoint(l.substring(l.indexOf("("), l.indexOf(")")+1));
				rect.setSize(pt.x, pt.y);
				dimSet = true;
				if (ptSet && dimSet) break;
			}
		}
		return rect;
	}