public boolean loadMap(File mapFile) {
		// removes all the obstacles already loaded
		obstacles.clear();

		// loads the new obstacles
		try {
			FileInputStream inStream = new FileInputStream(mapFile);
			BufferedReader lineReader = new BufferedReader(new InputStreamReader(inStream));
			String docLine;

			// Check the first line if this is a map-file
			docLine = lineReader.readLine();
			if ((docLine == null) || (!docLine.contains("<MAP>"))) {
				inStream.close();
				return false;
			}

			// reads the file line by line
			while ((docLine = lineReader.readLine()) != null) {
				if (docLine.contains("<OBSTACLE")) {
					Obstacle obstacle = new Obstacle();
					if (obstacle.parseXML(docLine, lineReader))
						obstacles.add(obstacle);
					else {
						inStream.close();
						return false;
					}
				} else {
				}
			}
			inStream.close();
		} catch (IOException ioe) {
			ioe.printStackTrace();
		}
		processEvent(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null));
		return true;
	} // end loadMap()