@Override
    public void mouseClicked(MouseEvent e) {
        if (_move != null) {
            return;
        }
        Component c = _gameboard.findComponentAt(e.getX(), e.getY());
        if (c instanceof PieceGUI) {
            PieceGUI p = ((PieceGUI) c);
            if (p.isSelected()) {
                p.setSelected(false);
                _selectedPiece = null;
            } else {
                if (_selectedPiece == null) {
                    if (_turn == p.getSide()) {
                        p.setSelected(true);
                        _selectedPiece = p;
                    }
                } else {
                    int index = _selectedPiece.getIndex();
                    int index1 = p.getIndex();
                    _move = textPosition(index) + "-" + textPosition(index1);
                }
            }
        } else {
            if (_selectedPiece != null) {
                int index = _selectedPiece.getIndex();
                int index1;
                Component[] cArray = _gameboard.getComponents();
                for (index1 = 0; index1 < cArray.length; index1++) {
                    if (cArray[index1].equals(c)) {
                        break;
                    }
                }
                _move = textPosition(index) + "-" + textPosition(index1);
            }
        }
        c.repaint();
    }