You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
2.6 KiB
55 lines
2.6 KiB
package data.Enums.solar;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.HashSet;
|
|
import java.util.Map;
|
|
|
|
import javafx.collections.FXCollections;
|
|
import javafx.collections.ObservableList;
|
|
|
|
public class SolarFilters {
|
|
private static HashMap<String, ObservableList<String>> SOLAR_FILTERS;
|
|
public static final String SOLA = "filter.solarSola";
|
|
public static final String PREDMET = "filter.solarPredmet";
|
|
public static final String RAZRED = "filter.solarRazred";
|
|
public static final String REGIJA = "filter.solarRegija";
|
|
public static final String TIP = "filter.solarVrstaBesedila";
|
|
public static final String LETO = "filter.solarLeto";
|
|
|
|
static {
|
|
SOLAR_FILTERS = new HashMap<>();
|
|
|
|
SOLAR_FILTERS.put(REGIJA, FXCollections.observableArrayList("Celje", "Gorica", "Koper", "Kranj", "Krško", "Ljubljana", "Maribor", "Murska Sobota", "Novo mesto", "Postojna", "Slovenj Gradec"));
|
|
SOLAR_FILTERS.put(PREDMET, FXCollections.observableArrayList("državljanska vzgoja in etika", "ekonomija", "filozofija", "geografija", "kemija", "podjetništvo", "psihologija", "slovenščina", "sociologija", "umetnostna vzgoja", "zgodovina"));
|
|
SOLAR_FILTERS.put(RAZRED, FXCollections.observableArrayList("6. razred", "7. razred", "8. razred", "9. razred", "1. letnik", "2. letnik", "3. letnik", "4. letnik", "5. letnik", "maturitetni tečaj"));
|
|
SOLAR_FILTERS.put(LETO, FXCollections.observableArrayList("2007", "2008", "2009", "2009/2010", "2010"));
|
|
SOLAR_FILTERS.put(SOLA, FXCollections.observableArrayList("gimnazija", "osnovna šola", "poklicna šola", "strokovna šola"));
|
|
SOLAR_FILTERS.put(TIP, FXCollections.observableArrayList("esej/spis", "pisni izdelek (učna ura)", "test (daljše besedilo)", "test (odgovori na vprašanja)"));
|
|
}
|
|
|
|
/**
|
|
* Returns filters with all possible values
|
|
*/
|
|
public static HashMap<String, ObservableList<String>> getFiltersForComboBoxes() {
|
|
return SOLAR_FILTERS;
|
|
}
|
|
|
|
/**
|
|
* Returns filters with all possible values
|
|
*/
|
|
public static HashMap<String, ObservableList<String>> getFiltersForComboBoxes(HashMap<String, HashSet<String>> foundFilters) {
|
|
HashMap<String, ObservableList<String>> filtersForComboBoxes = new HashMap<>();
|
|
|
|
for (Map.Entry<String, ObservableList<String>> e : SOLAR_FILTERS.entrySet()) {
|
|
if (!foundFilters.containsKey(e.getKey())) {
|
|
// if, by some reason a specific filter wasn't in the corpus, return a blank list for that filter
|
|
filtersForComboBoxes.put(e.getKey(), FXCollections.observableArrayList());
|
|
} else {
|
|
filtersForComboBoxes.put(e.getKey(), FXCollections.observableArrayList(foundFilters.get(e.getKey())).sorted());
|
|
}
|
|
}
|
|
|
|
return filtersForComboBoxes;
|
|
}
|
|
}
|