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

void pauker::program::gui::swing::PaukerFrame::loadBatch ( Batch  batch  )  [inline]

loads a batch

Parameters:
batch the batch to load

Definition at line 788 of file PaukerFrame.java.

References pauker::program::LongTermBatch::getBatchNumber(), pauker::program::Batch::getSearchPattern(), pauker::program::Batch::getSearchSide(), pauker::program::Lesson::getSummaryBatch(), pauker::program::Lesson::getUnlearnedBatch(), pauker::program::Batch::isMatchCase(), pauker::program::Batch::search(), pauker::program::Batch::stopSearching(), and STRINGS.

Referenced by pauker::program::gui::swing::UnLearnTest::testUnlearn().

                                       {

        showPanel(lessonPanel, "batchPanel");

        // set batch list border title
        if (batch == currentLesson.getSummaryBatch()) {
            batchPanelBorder.setTitle(STRINGS.getString("Summary"));
        } else if (batch == currentLesson.getUnlearnedBatch()) {
            batchPanelBorder.setTitle(STRINGS.getString("Not_learned"));
        } else if (batch instanceof LongTermBatch) {
            LongTermBatch longTermBatch = (LongTermBatch) batch;
            int batchNumber = longTermBatch.getBatchNumber();
            String title = STRINGS.getString("Batch") + ' ' + (batchNumber + 1);
            batchPanelBorder.setTitle(title);
        } else {
            throw new RuntimeException("unknown batch type: " + batch);
        }
        batchPanel.repaint();

        // apply current search setting to new batch
        if (loadedBatch != null) {
            String searchPattern = loadedBatch.getSearchPattern();
            if ((searchPattern == null) || (searchPattern.length() == 0)) {
                batch.stopSearching();
            } else {
                boolean batchMatchCase = loadedBatch.isMatchCase();
                Card.Element searchSide = loadedBatch.getSearchSide();
                batch.search(searchPattern, batchMatchCase, searchSide);
            }
        }

        loadedBatch = batch;

        // refill list
        batchListModel.setBatch(batch);
        batchList.clearSelection();

        updateBatchListButtons();
    }


Generated by  Doxygen 1.6.0   Back to index