|
16 | 16 | public class Config {
|
17 | 17 | private String filename;
|
18 | 18 | private List<TeamType> teamTypes;
|
| 19 | + private String redLabel; |
| 20 | + private String greenLabel; |
19 | 21 |
|
20 | 22 | /**
|
21 | 23 | * Constructor setting a default filename.
|
22 | 24 | */
|
23 | 25 | public Config() {
|
24 | 26 | this.filename = "%LAGTYPE%%LAGNUMMER%_TEIG%TEIGNUMMER%_SPOR%SPORNUMMER%_%DATO%.gpx";
|
25 | 27 | this.teamTypes = new ArrayList<>();
|
| 28 | + this.redLabel = "Etterretning"; |
| 29 | + this.greenLabel = "Info"; |
26 | 30 | }
|
27 | 31 |
|
28 | 32 | /**
|
@@ -53,6 +57,10 @@ public String[] getConfigTemplate() {
|
53 | 57 | "team=Mannskap,color=Green",
|
54 | 58 | "team=Hund,color=Magenta",
|
55 | 59 | "team=Helikopter,color=DarkRed",
|
| 60 | + "#", |
| 61 | + "# Velg beskrivelse av flaggfarge på veipunkt:", |
| 62 | + "red-label=Etterretning", |
| 63 | + "green-label=Info" |
56 | 64 | };
|
57 | 65 | }
|
58 | 66 |
|
@@ -111,6 +119,24 @@ public List<String> getTeamNames() {
|
111 | 119 | return teamNames;
|
112 | 120 | }
|
113 | 121 |
|
| 122 | + /** |
| 123 | + * Get the label for the red color on waypoint flag color selector. |
| 124 | + * |
| 125 | + * @return the label for the red color. |
| 126 | + */ |
| 127 | + public String getRedLabel() { |
| 128 | + return redLabel; |
| 129 | + } |
| 130 | + |
| 131 | + /** |
| 132 | + * Gets the label for the green color on waypoint flag color selector. |
| 133 | + * |
| 134 | + * @return the label for the green color. |
| 135 | + */ |
| 136 | + public String getGreenLabel() { |
| 137 | + return greenLabel; |
| 138 | + } |
| 139 | + |
114 | 140 | /**
|
115 | 141 | * Parses the config file and extracts the needed information.
|
116 | 142 | *
|
@@ -144,6 +170,22 @@ public void parseConfigFile(File file) {
|
144 | 170 | System.err.println("[Config] Parsed team type " + teamType + " with color " + teamColor);
|
145 | 171 | }
|
146 | 172 | }
|
| 173 | + } else if (line.startsWith("red-label")) { |
| 174 | + if (line.contains("=")) { |
| 175 | + String[] parts = line.split("="); |
| 176 | + if (parts.length == 2) { |
| 177 | + redLabel = parts[1]; |
| 178 | + System.err.println("[Config] Parsed label for red waypoint flag color " + redLabel); |
| 179 | + } |
| 180 | + } |
| 181 | + } else if (line.startsWith("green-label")) { |
| 182 | + if (line.contains("=")) { |
| 183 | + String[] parts = line.split("="); |
| 184 | + if (parts.length == 2) { |
| 185 | + greenLabel = parts[1]; |
| 186 | + System.err.println("[Config] Parsed label for green waypoint flag color " + greenLabel); |
| 187 | + } |
| 188 | + } |
147 | 189 | }
|
148 | 190 | }
|
149 | 191 | line = reader.readLine();
|
|
0 commit comments