package edu.agh.tunev.ui;

import java.lang.reflect.InvocationTargetException;
import java.util.Random;
import java.util.Vector;

import edu.agh.tunev.model.AbstractPerson;

final class PeopleFactory {

	static Random rng = new Random();

	static Vector<AbstractPerson> random(Class<?> type, int num, double maxX,
			double maxY) {
		Vector<AbstractPerson> r = new Vector<AbstractPerson>();

		for (int i = 0; i < num; i++)
			r.add(newAbstractPerson(type, rng.nextDouble() * maxX,
					rng.nextDouble() * maxY));

		return r;
	}

	static AbstractPerson newAbstractPerson(Class<?> type, double x, double y) {
		try {
			return (AbstractPerson) type
					.getDeclaredConstructor(double.class, double.class)
					.newInstance(x, y);
		} catch (InstantiationException | IllegalAccessException
				| IllegalArgumentException | InvocationTargetException
				| NoSuchMethodException | SecurityException e) {
			e.printStackTrace();
			throw new IllegalArgumentException("Error during instantiation of "
					+ type.getName() + ".");
		}
	}

}

@@ -20,16 +20,46 @@
 ev.ui;%0A%0A
+import java.awt.geom.Point2D;%0A
 import j
@@ -705,23 +705,17 @@
 tor(
-double.class, d
+Point2D.D
 oubl
@@ -745,13 +745,33 @@
 nce(
+new Point2D.Double(
 x, y)
+)
 ;%0A%09%09

Fix PeopleFactory (will work now)