Initial commit

This commit is contained in:
2025-08-28 22:38:53 +02:00
commit f15208fe6d
232 changed files with 16821 additions and 0 deletions

21
gui/api/pom.xml Normal file
View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>ch.gtache.fro.gui</groupId>
<artifactId>gui</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>gui-api</artifactId>
<dependencies>
<dependency>
<groupId>ch.gtache.fro</groupId>
<artifactId>fro-api</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,14 @@
package ch.gtache.fro.gui;
/**
* Represents a GUI controller
*/
public interface Controller {
/**
* Returns the model for this controller
*
* @return The model
*/
Model model();
}

View File

@@ -0,0 +1,21 @@
package ch.gtache.fro.gui;
/**
* Controller for the fetch view
*/
public interface FetchController extends Controller {
/**
* Fetches the data for the currently selected bird
*
*/
void fetch();
/**
* Fetches all the data
*/
void fetchAll();
@Override
FetchModel model();
}

View File

@@ -0,0 +1,7 @@
package ch.gtache.fro.gui;
/**
* Model for the fetch view
*/
public interface FetchModel extends Model {
}

View File

@@ -0,0 +1,10 @@
package ch.gtache.fro.gui;
/**
* Controller for the main view
*/
public interface MainController extends Controller {
@Override
MainModel model();
}

View File

@@ -0,0 +1,7 @@
package ch.gtache.fro.gui;
/**
* Model for the main view
*/
public interface MainModel extends Model {
}

View File

@@ -0,0 +1,7 @@
package ch.gtache.fro.gui;
/**
* Represents a GUI model
*/
public interface Model {
}

View File

@@ -0,0 +1,10 @@
package ch.gtache.fro.gui;
/**
* Controller for the settings view
*/
public interface SettingsController extends Controller {
@Override
SettingsModel model();
}

View File

@@ -0,0 +1,7 @@
package ch.gtache.fro.gui;
/**
* Model for the settings view
*/
public interface SettingsModel extends Model {
}

View File

@@ -0,0 +1,12 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.gui.Controller;
/**
* Controller for the practice view
*/
public interface PracticeController extends Controller {
@Override
PracticeModel model();
}

View File

@@ -0,0 +1,23 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.gui.Model;
/**
* Model for the practice view - exact guess
*/
public interface PracticeExactModel extends Model {
/**
* Returns the user's current guess
*
* @return The user's current guess
*/
String guess();
/**
* Sets the guess
*
* @param guess The guess
*/
void guess(String guess);
}

View File

@@ -0,0 +1,14 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.gui.Controller;
/**
* Controller for a guess practice view
*/
public interface PracticeGuessController extends Controller {
/**
* Confirms the current guess
*/
void confirm();
}

View File

@@ -0,0 +1,11 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.gui.Model;
/**
* Model for the practice view
*/
public interface PracticeModel extends Model {
}

View File

@@ -0,0 +1,33 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.Bird;
import ch.gtache.fro.gui.Model;
import java.util.List;
/**
* Model for the practice view - multichoice guess
*/
public interface PracticeMultichoiceModel extends Model {
/**
* Returns the suggestions
*
* @return The suggestions
*/
List<Bird> suggestions();
/**
* Returns the selected suggestion
*
* @return The selected bird
*/
Bird selected();
/**
* Sets the selected suggestion
*
* @param selected The selected bird
*/
void selected(Bird selected);
}

View File

@@ -0,0 +1,11 @@
package ch.gtache.fro.practice.gui;
/**
* Controller for the practice view - exact picture
*/
public interface PracticePictureExactController extends PracticeGuessController {
@Override
PracticePictureExactModel model();
}

View File

@@ -0,0 +1,8 @@
package ch.gtache.fro.practice.gui;
/**
* Model for the practice view - exact picture
*/
public interface PracticePictureExactModel extends PracticePictureModel, PracticeExactModel {
}

View File

@@ -0,0 +1,24 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.Picture;
import ch.gtache.fro.gui.Model;
/**
* Represents a model for a practice view with a picture
*/
public interface PracticePictureModel extends Model {
/**
* Returns the picture to guess
*
* @return The picture
*/
Picture picture();
/**
* Sets the picture
*
* @param picture The picture
*/
void picture(Picture picture);
}

View File

@@ -0,0 +1,11 @@
package ch.gtache.fro.practice.gui;
/**
* Controller for the practice view - multichoice picture
*/
public interface PracticePictureMultichoiceController extends PracticeGuessController {
@Override
PracticePictureMultichoiceModel model();
}

View File

@@ -0,0 +1,8 @@
package ch.gtache.fro.practice.gui;
/**
* Model for the practice view - multichoice picture
*/
public interface PracticePictureMultichoiceModel extends PracticePictureModel, PracticeMultichoiceModel {
}

View File

@@ -0,0 +1,12 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.gui.Controller;
/**
* Controller for the practice result view
*/
public interface PracticeResultController extends Controller {
@Override
PracticeResultModel model();
}

View File

@@ -0,0 +1,9 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.gui.Model;
/**
* Model for the practice result view
*/
public interface PracticeResultModel extends Model {
}

View File

@@ -0,0 +1,17 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.gui.Controller;
/**
* Controller for the practice settings view
*/
public interface PracticeSettingsController extends Controller {
/**
* Starts a practice
*/
void startPractice();
@Override
PracticeSettingsModel model();
}

View File

@@ -0,0 +1,54 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.gui.Model;
import ch.gtache.fro.practice.PracticeType;
import java.util.List;
/**
* Model for the practice settings view
*/
public interface PracticeSettingsModel extends Model {
/**
* Returns the list of practice types
*
* @return The list of practice types
*/
List<PracticeType> practiceTypes();
/**
* Returns the currently selected practice type
*
* @return The practice type
*/
PracticeType practiceType();
/**
* Sets the practice type
*
* @param practiceType The practice type
*/
void practiceType(PracticeType practiceType);
/**
* Returns true if the practice type has suggestions
*
* @return True if the practice type has suggestions
*/
boolean hasSuggestions();
/**
* Returns the currently selected number of suggestions
*
* @return The number of suggestions
*/
int suggestionsNumber();
/**
* Sets the number of suggestions
*
* @param suggestionsNumber The number of suggestions
*/
void suggestionsNumber(int suggestionsNumber);
}

View File

@@ -0,0 +1,11 @@
package ch.gtache.fro.practice.gui;
/**
* Controller for the practice view - exact sound
*/
public interface PracticeSoundExactController extends PracticeGuessController {
@Override
PracticeSoundExactModel model();
}

View File

@@ -0,0 +1,8 @@
package ch.gtache.fro.practice.gui;
/**
* Model for the practice view - exact sound
*/
public interface PracticeSoundExactModel extends PracticeSoundModel, PracticeExactModel {
}

View File

@@ -0,0 +1,24 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.Sound;
import ch.gtache.fro.gui.Model;
/**
* Represents a model for a practice view with a sound
*/
public interface PracticeSoundModel extends Model {
/**
* Returns the sound to guess
*
* @return The sound
*/
Sound sound();
/**
* Sets the sound
*
* @param sound The sound
*/
void sound(Sound sound);
}

View File

@@ -0,0 +1,11 @@
package ch.gtache.fro.practice.gui;
/**
* Controller for the practice view - multichoice sound
*/
public interface PracticeSoundMultichoiceController extends PracticeGuessController {
@Override
PracticeSoundMultichoiceModel model();
}

View File

@@ -0,0 +1,8 @@
package ch.gtache.fro.practice.gui;
/**
* Model for the practice view - multichoice sound
*/
public interface PracticeSoundMultichoiceModel extends PracticeSoundModel, PracticeMultichoiceModel {
}

View File

@@ -0,0 +1,10 @@
package ch.gtache.fro.practice.gui;
/**
* Controller for the practice view - multipicture choice sound
*/
public interface PracticeSoundMultichoicePictureController extends PracticeGuessController {
@Override
PracticeSoundMultichoicePictureModel model();
}

View File

@@ -0,0 +1,32 @@
package ch.gtache.fro.practice.gui;
import ch.gtache.fro.Picture;
import java.util.List;
/**
* Model for the practice view - multipicture choice sound
*/
public interface PracticeSoundMultichoicePictureModel extends PracticeSoundModel {
/**
* Returns the suggestions
*
* @return The suggestions
*/
List<Picture> suggestions();
/**
* Returns the selected suggestion
*
* @return The selected picture
*/
Picture selected();
/**
* Sets the selected suggestion
*
* @param selected The selected picture
*/
void selected(Picture selected);
}

View File

@@ -0,0 +1,9 @@
/**
* GUI API module for the FRO project
*/
module ch.gtache.fro.gui.api {
requires transitive ch.gtache.fro.api;
exports ch.gtache.fro.gui;
exports ch.gtache.fro.practice.gui;
}