Updated documentation for Flashcard and SharedCodeController.
This commit is contained in:
parent
05fb74f9e8
commit
706ff1085d
2 changed files with 26 additions and 21 deletions
|
@ -71,17 +71,17 @@ public class FlashcardController extends SharedCodeController {
|
|||
flashcardIcon.setImage(new Image("file:src/main/resources/assets/icons/black_icons/50px/flashcard-50.png"));
|
||||
flashcardsText.setFill(Color.BLACK);
|
||||
|
||||
if(isSortedByEnglish){
|
||||
if(isSortedByEnglish){ // If the current language ordering is by english, display the english word first.
|
||||
testWord.setText(Application.practiceList.getFirst().getEnglish());
|
||||
wordType.setText("English");
|
||||
} else{
|
||||
} else{ // Else display the word definition first.
|
||||
testWord.setText(Application.practiceList.getFirst().getWelsh());
|
||||
wordType.setText("Welsh");
|
||||
}
|
||||
|
||||
updateCounter();
|
||||
card = flashcard;
|
||||
flashcard.setImage(new Image("file:src/main/resources/assets/flashcard/Flashcard.png"));
|
||||
flashcard.setImage(new Image("file:src/main/resources/assets/flashcard/FlashCard.png"));
|
||||
leftArrow.setImage(new Image("file:src/main/resources/assets/icons/black_icons/50px/left-50.png"));
|
||||
rightArrow.setImage(new Image("file:src/main/resources/assets/icons/black_icons/50px/right-50.png"));
|
||||
}
|
||||
|
@ -106,17 +106,17 @@ public class FlashcardController extends SharedCodeController {
|
|||
// If statement to check the start of the practiceList hasn't been reached before moving to the previous card.
|
||||
if (index > 0) {
|
||||
index--;
|
||||
}
|
||||
updateCounter();
|
||||
|
||||
if(isSortedByEnglish){
|
||||
if (isSortedByEnglish) { // If the current language ordering is by english, display the english word first.
|
||||
testWord.setText(Application.practiceList.get(index).getEnglish());
|
||||
wordType.setText("English");
|
||||
} else{
|
||||
} else { // Else display the word definition first.
|
||||
testWord.setText(Application.practiceList.get(index).getWelsh());
|
||||
wordType.setText("Welsh");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Event that switches to the next flashcard whenever the user clicks the 'right-arrow' icon.
|
||||
|
@ -126,20 +126,20 @@ public class FlashcardController extends SharedCodeController {
|
|||
@FXML
|
||||
private void handleNextCard() {
|
||||
// If statement to check the end of the practiceList hasn't been reached before moving to the next card.
|
||||
if (index < Application.practiceList.size()-1) {
|
||||
if (index < Application.practiceList.size() - 1) {
|
||||
index++;
|
||||
}
|
||||
updateCounter();
|
||||
|
||||
if(isSortedByEnglish){
|
||||
if (isSortedByEnglish) { // If the current language ordering is by english, display the english word first.
|
||||
testWord.setText(Application.practiceList.get(index).getEnglish());
|
||||
wordType.setText("English");
|
||||
} else{
|
||||
} else { // Else display the word definition first.
|
||||
testWord.setText(Application.practiceList.get(index).getWelsh());
|
||||
wordType.setText("Welsh");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method that updates the onscreen counter of the current flashcard.
|
||||
|
|
|
@ -20,6 +20,11 @@ import uk.ac.aber.cs22120.group20.json.DictionaryEntry;
|
|||
* @see AssessmentGenerator
|
||||
*/
|
||||
abstract public class SharedCodeController {
|
||||
|
||||
// //////////////// //
|
||||
// Class variables. //
|
||||
// //////////////// //
|
||||
|
||||
static boolean isSortedByEnglish = true;
|
||||
static int sideBarWidth = 50;
|
||||
|
||||
|
|
Reference in a new issue