public SelectionOverlay(final WordFrame wordFrame)
	{
		selections = new ArrayList<>();
		solutions = new ArrayList<>();

		addKeyListener(new KeyAdapter()
		{
			@Override
			public void keyPressed(KeyEvent e)
			{
				super.keyPressed(e);
				if (e.getKeyCode() == KeyEvent.VK_ESCAPE)
					System.exit(0);
				if (e.getKeyCode() == KeyEvent.VK_C)
				{
					showingSolutions = !showingSolutions;
					repaint();
				}
				if (e.getKeyCode() == KeyEvent.VK_V)
				{
					gameOver();
				}

			}


		});


		MouseAdapter clickListener = new MouseAdapter()
		{
			@Override
			public void mouseDragged(MouseEvent e)
			{
//				if (++count < 1)
//					return;
//				count = 0;

				if (currentSelection != null)
				{
					currentSelection.dragTo(e.getX(), e.getY(), wordSearch);
					repaint();
				}
			}

			@Override
			public void mousePressed(MouseEvent e)
			{
				if (currentSelection == null)
					currentSelection = new Selection(e.getX(), e.getY(), cellSize);
			}

			@Override
			public void mouseReleased(MouseEvent e)
			{
				if (currentSelection != null)
				{
					String word = currentSelection.getWord(wordSearch);
					WordLabel label = wordFrame.getWord(word);

					boolean correctWord = label != null;

					if (correctWord && !label.isFound())
					{
						selections.add(currentSelection);
						label.setFound(true);
					}


					if (wordFrame.isComplete())
					{
						gameOver();
					}


					currentSelection = null;
					repaint();

				}
			}
		};

		addMouseListener(clickListener);
		addMouseMotionListener(clickListener);

		setFocusable(true);
		requestFocus();

		setOpaque(false);

	}