@Override
    public void mouseClicked(MouseEvent me)
    {
        if ( this.window.isLocked() )
            return;
        Coords coords = this.getCoords(me.getPoint());
        if ( coords == null )
            return;
        Color color = com.github.abalone.elements.Board.getInstance().elementAt(coords);
        if ( !color.isPlayer() )
            return;
        else if(this.selectedBalls.contains(coords))
            this.selectedBalls.remove(coords);
        else if ( this.selectedBalls.size() < 3 )
            this.selectedBalls.add(coords);
        else
            return;
        this.repaint();
        Set<Direction> directions;
        Set<Direction> validDirections = GameController.getInstance().validDirections(this.selectedBalls);
        if ( this.reversed )
        {
            directions = new HashSet<Direction>();
            for ( Direction d : validDirections )
                directions.add(d.reversed());
        }
        else
            directions = new HashSet<Direction>(validDirections);
        this.selector.updateButtons(directions);
    }