public void loadFromFile(File file) {
		  BufferedReader reader;
		  int count;
		  try
		  {
			   reader = new BufferedReader(new FileReader(file));
			   StringTokenizer tokens = new StringTokenizer(reader.readLine());
			   mWidth = Integer.decode(tokens.nextToken());
			   mHeight = Integer.decode(tokens.nextToken());
			   mImageFilename = reader.readLine();
			   count = Integer.decode(reader.readLine());
		  }
		  catch (IOException ex)
		  {
			   mWidth = mHeight = 0;
			   mImageFilename = null;
			   mSegments = new Segment[0];
			   return;
		  }
		  
		  mSegments = new Segment[count];
		  int idx = 0;
		  while (true) {
			   String line;
			   try
			   {
					line = reader.readLine();
			   }
			   catch (IOException ex)
			   {
					break;
			   }

			   if (line == null) break;

			   StringTokenizer tokens = new StringTokenizer(line);
			   float sX = Float.valueOf(tokens.nextToken());
			   float sY = Float.valueOf(tokens.nextToken());
			   float eX = Float.valueOf(tokens.nextToken());
			   float eY = Float.valueOf(tokens.nextToken());

			   mSegments[idx ++] = new Segment(sX, sY, eX, eY);
		  }
	 }