@Override
    public void actionPerformed(ActionEvent e) {
        Container container = simulationStarter.getContainer();
        List<Card> cardsToAdd = simulationStarter.getSelectedCards();

        int cardsBeforeAddition = collection.getNumberOfCards();

        if (cardsToAdd.size() <= collection.getMaximumAmountOfCardsInCollection()
                - cardsBeforeAddition) {
            try {
                collection.addCards(cardsToAdd);
            } catch (IllegalArgumentException ex) {
                openSeriousCardAddingErrorDialog();
                return;
            }
        } else {
            if (simulationStarter.isShowMinorErrorDialogs()) {
                openCardCantFitThatManyCardsDialog();
            }
            return;
        }
        CardDrawer cardDrawer = simulationStarter.getCardDrawer();

        int howMany = cardsBeforeAddition;

        Map<Card, Component> drawnCards = simulationStarter.getDrawnCards();
        
        drawCardsToCollection(cardsToAdd, cardDrawer, howMany, container, drawnCards);
        
        List<Component> selectedCardLabels = simulationStarter.getSelectedCardLabels();

        // Removes the grey cards under Available cards.
        for (Component c : selectedCardLabels) {
            container.remove(c);
        }

        container.repaint();

        selectedCardLabels.clear();
        cardsToAdd.clear();
    }