diff options
author | Jonas Smedegaard <dr@jones.dk> | 2025-04-28 22:49:33 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2025-04-28 22:49:33 +0200 |
commit | a701fe0f29f82cdcf445cc24f79877116ca62ca4 (patch) | |
tree | dd965ec66db85d310e832a21be59c597c34ae042 /src/com.example.portfolio2/com/example/portfolio2/Controller.java | |
parent | 862fb85d541af579657cfdaa8db770e4c3916eaf (diff) |
rename class Model -> Database; rename variable model -> store
Diffstat (limited to 'src/com.example.portfolio2/com/example/portfolio2/Controller.java')
-rw-r--r-- | src/com.example.portfolio2/com/example/portfolio2/Controller.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/com.example.portfolio2/com/example/portfolio2/Controller.java b/src/com.example.portfolio2/com/example/portfolio2/Controller.java index 2212396..2457e25 100644 --- a/src/com.example.portfolio2/com/example/portfolio2/Controller.java +++ b/src/com.example.portfolio2/com/example/portfolio2/Controller.java @@ -14,23 +14,23 @@ import java.util.List; /// Bachelorizer - Controller class Controller{ - /// Application model - private Model model; + /// Storage model + private Database store; /// Application view private Window view; /// clear the participation database at program launch void initialize() { - model.initialize(); + store.initialize(); } /// default constructor /// - /// @param model Application model + /// @param store Storage model /// @param view Application view - Controller(Model model, Window view){ - this.model=model; this.view=view; + Controller(Database store, Window view){ + this.store = store; this.view = view; } /// callback when category box is selected @@ -46,8 +46,8 @@ class Controller{ // clear text area area.clear(); - // fill activity box using model method - select.getItems().addAll(model.selectProgram(combo.getValue())); + // fill activity box from data in store + select.getItems().addAll(store.selectProgram(combo.getValue())); } /// callback when activity box is selected @@ -87,7 +87,7 @@ class Controller{ /// @param s activity identifier /// @param textArea whole text area void addActivity(String s, TextArea textArea) { - model.addParticipation(model.getActivityIndeks(s)); + store.addParticipation(store.getActivityIndeks(s)); } /// update text area for an activity box @@ -99,7 +99,7 @@ class Controller{ /// @param textArea whole text area void updateArea(ComboBox<String> combo, TextArea textArea) { textArea.clear(); - for(String s : model.getParticipation(combo.getValue())) { + for(String s : store.getParticipation(combo.getValue())) { textArea.appendText(s + "\n"); } } @@ -108,10 +108,10 @@ class Controller{ /// @param ectslabel text display area for ECTS points /// @param comboBox involved activity box void updateEcts(Label ectslabel, ComboBox<String> comboBox) { - ectslabel.setText("ECTS: "+model.getSumEcts(comboBox.getValue())); + ectslabel.setText("ECTS: "+store.getSumEcts(comboBox.getValue())); } void fillElective(ComboBox<String> electiveBox) { - electiveBox.getItems().addAll(model.getAllActivities()); + electiveBox.getItems().addAll(store.getAllActivities()); } } |