@Override
	public void mouseReleased(MouseEvent event) {
		//Handle tile clicks.
		if (event.getSource() instanceof Tile) {
			Tile sourceTile = (Tile)event.getSource();
	        if(match.isInProgress() &&
	        		//Make sure the mouse was released while still on the tile,
	        		//by checking the event's position relative to the tile.
	        		event.getX() >= 0 && 
	        		event.getX() < sourceTile.getWidth() &&
	        		event.getY() >= 0 &&
	        		event.getY() < sourceTile.getHeight()) {
	        	//This way, pressing, dragging out of the tile, and releasing has no effect.
	        	match.handleTileClick((Tile)event.getSource());
	        }
		}
	}