|
20 | 20 | import java.io.PrintWriter; |
21 | 21 | import java.io.StringWriter; |
22 | 22 | import java.time.LocalDate; |
23 | | -import java.util.Arrays; |
24 | 23 | import java.util.List; |
25 | 24 | import java.util.Optional; |
26 | 25 | import java.util.stream.Collectors; |
|
31 | 30 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
32 | 31 | import org.springframework.context.ConfigurableApplicationContext; |
33 | 32 |
|
| 33 | +import de.doubleslash.keeptime.common.FontProvider; |
34 | 34 | import de.doubleslash.keeptime.common.Resources; |
35 | 35 | import de.doubleslash.keeptime.common.Resources.RESOURCE; |
36 | 36 | import de.doubleslash.keeptime.controller.Controller; |
|
54 | 54 | import javafx.scene.layout.Pane; |
55 | 55 | import javafx.scene.layout.Priority; |
56 | 56 | import javafx.scene.paint.Color; |
57 | | -import javafx.scene.text.Font; |
58 | 57 | import javafx.stage.Stage; |
59 | 58 | import javafx.stage.StageStyle; |
60 | 59 | import javafx.stage.WindowEvent; |
@@ -130,20 +129,8 @@ public void start(final Stage primaryStage) { |
130 | 129 | } |
131 | 130 | } |
132 | 131 |
|
133 | | - private void loadFonts() { |
134 | | - final List<RESOURCE> fontResources = Arrays.asList(RESOURCE.FONT_BOLD, RESOURCE.FONT_SEMI_BOLD, |
135 | | - RESOURCE.FONT_REGULAR); |
136 | | - LOG.info("Loading fonts '{}'", fontResources); |
137 | | - |
138 | | - for (final RESOURCE fontResource : fontResources) { |
139 | | - LOG.info("Loading font '{}'", fontResource); |
140 | | - final Font font = Font.loadFont(Resources.getResource(fontResource).toExternalForm(), 12); |
141 | | - LOG.info("Font with name '{}' loaded.", font.getName()); |
142 | | - } |
143 | | - } |
144 | | - |
145 | 132 | private void initialiseApplication(final Stage primaryStage) throws Exception { |
146 | | - loadFonts(); |
| 133 | + FontProvider.loadFonts(); |
147 | 134 | readSettings(); |
148 | 135 |
|
149 | 136 | final List<Work> todaysWorkItems = model.getWorkRepository().findByCreationDate(LocalDate.now()); |
|
0 commit comments