public Drawable findNearestClass(int x, int y) {

		//Set the local variables required for the comparison
		Drawable d = null;
		double minDist = Double.MAX_VALUE;
		int minDistIndex = -1;

		//Loop through the vector
		for(int i=0; i < getDrawable().size(); i++) {

			//Set 'd' as the next 'Drawable' object
			d = (Drawable)(getDrawable().get(i));

			//Compare the distance between the object's X/Y and mouse X/Y 
			//against the current minDist
			if(d.distanceTo(x,y) < minDist) {

				//If it's less, set the minDist to that value
				minDist = d.distanceTo(x,y);

				//Set the index of the item with the smallest distance to 'i'
				minDistIndex = i;
			}
		}
		d = getDrawable().get(minDistIndex);
		if(d instanceof ClassDiag) {
		   ClassDiag cd = (ClassDiag) d;
		    //Set the distance away from the mouse click before a class is registered
		    if(cd.getX() < x && cd.getX() + cd.getWidth()  > x && cd.getY() < y && cd.getY() + cd.getWidth() > y) {

			    //If the mouse position is with the threshold, return the 'Drawable' object with the smallest distance
			    return cd;

		    }
		}
		//Otherwise return nothing..
		return null;
	}