public float[] getBoundsOfObjects() {
		if (numberOfAtoms <= 0 && (obstacles == null || obstacles.isEmpty()))
			return null;
		if (numberOfAtoms > 0) {
			range_xmin = (float) atom[0].getMinX();
			range_ymin = (float) atom[0].getMinY();
			range_xmax = (float) atom[0].getMaxX();
			range_ymax = (float) atom[0].getMaxY();
			id_xmax = id_xmin = id_ymax = id_ymin = 0;
		}
		switch (boundary.getType()) {
		case RectangularBoundary.DBC_ID:
		case RectangularBoundary.RBC_ID:
			for (short i = 1; i < numberOfAtoms; i++) {
				Atom a = atom[i];
				if (a.getMaxX() > range_xmax) {
					range_xmax = (float) (a.getMaxX());
					id_xmax = i;
				} else if (a.getMinX() < range_xmin) {
					range_xmin = (float) (a.getMinX());
					id_xmin = i;
				}
				if (a.getMaxY() > range_ymax) {
					range_ymax = (float) (a.getMaxY());
					id_ymax = i;
				} else if (a.getMinY() < range_ymin) {
					range_ymin = (float) (a.getMinY());
					id_ymin = i;
				}
			}
			break;
		case RectangularBoundary.PBC_ID:
			for (short i = 1; i < numberOfAtoms; i++) {
				Atom a = atom[i];
				if (a.getMaxX() > range_xmax) {
					range_xmax = (float) (a.getRx());
					id_xmax = i;
				} else if (a.getMinX() < range_xmin) {
					range_xmin = (float) (a.getRx());
					id_xmin = i;
				}
				if (a.getMaxY() > range_ymax) {
					range_ymax = (float) (a.getRy());
					id_ymax = i;
				} else if (a.getMinY() < range_ymin) {
					range_ymin = (float) (a.getRy());
					id_ymin = i;
				}
			}
			break;
		case RectangularBoundary.XPYRBC_ID:
			for (short i = 1; i < numberOfAtoms; i++) {
				Atom a = atom[i];
				if (a.getMaxX() > range_xmax) {
					range_xmax = (float) (a.getRx());
					id_xmax = i;
				} else if (a.getMinX() < range_xmin) {
					range_xmin = (float) (a.getRx());
					id_xmin = i;
				}
				if (a.getMaxY() > range_ymax) {
					range_ymax = (float) (a.getMaxY());
					id_ymax = i;
				} else if (a.getMinY() < range_ymin) {
					range_ymin = (float) (a.getMinY());
					id_ymin = i;
				}
			}
			break;
		case RectangularBoundary.XRYPBC_ID:
			for (short i = 1; i < numberOfAtoms; i++) {
				Atom a = atom[i];
				if (a.getMaxX() > range_xmax) {
					range_xmax = (float) (a.getMaxX());
					id_xmax = i;
				} else if (a.getMinX() < range_xmin) {
					range_xmin = (float) (a.getMinX());
					id_xmin = i;
				}
				if (a.getMaxY() > range_ymax) {
					range_ymax = (float) (a.getRy());
					id_ymax = i;
				} else if (a.getMinY() < range_ymin) {
					range_ymin = (float) (a.getRy());
					id_ymin = i;
				}
			}
			break;
		}
		if (obstacles != null && !obstacles.isEmpty()) {
			if (numberOfAtoms <= 0)
				range_xmax = range_ymax = 1;
			Obstacle o;
			synchronized (obstacles.getSynchronizationLock()) {
				for (Iterator it = obstacles.iterator(); it.hasNext();) {
					o = (Obstacle) it.next();
					if (o.getMaxX() > range_xmax)
						range_xmax = (float) o.getMaxX();
					if (o.getMaxY() > range_ymax)
						range_ymax = (float) o.getMaxY();
					if (o.getMinX() < range_xmin)
						range_xmin = (float) o.getMinX();
					if (o.getMinY() < range_ymin)
						range_ymin = (float) o.getMinY();
				}
			}
		}
		return new float[] { range_xmin, range_ymin, range_xmax, range_ymax };
	}