Logo Search packages:      
Sourcecode: pauker version File versions  Download package

void pauker::program::gui::swing::PaukerFrame::addCard ( Card  newCard  )  [inline]

inserts a newCard into the current lesson

Parameters:
newCard the new card

Definition at line 648 of file PaukerFrame.java.

References pauker::program::Lesson::addCard(), pauker::program::Batch::getNumberOfCards(), pauker::program::Lesson::getSummaryBatch(), pauker::program::Lesson::getUnlearnedBatch(), pauker::program::SearchEngine::index(), and somethingHasChanged().

Referenced by pauker::program::gui::swing::ShuffleTest::testSorting().

                                      {
        currentLesson.addCard(newCard);

        // update statistics
        statisticPanel.setLesson(currentLesson);

        // update batch list
        if (batchList.isShowing() &&
                ((loadedBatch == currentLesson.getSummaryBatch()) ||
                (loadedBatch == currentLesson.getUnlearnedBatch()))) {
            batchListModel.cardAdded();
            updateBatchListButtons();
            batchList.ensureIndexIsVisible(batchListModel.getSize() - 1);
        }

        // update searchEngine
        searchEngine.index(newCard);

        learnNewCardsButton.setEnabled(true);
        searchButton.setEnabled(true);
        boolean hasSeveralCards = loadedBatch.getNumberOfCards() > 0;
        sortButton.setEnabled(hasSeveralCards);
        randomizeButton.setEnabled(hasSeveralCards);

        somethingHasChanged();
    }


Generated by  Doxygen 1.6.0   Back to index