diff --git a/src/main/java/es/kauron/estraba/App.java b/src/main/java/es/kauron/estraba/App.java index d8d4243..9892d83 100644 --- a/src/main/java/es/kauron/estraba/App.java +++ b/src/main/java/es/kauron/estraba/App.java @@ -33,6 +33,7 @@ import javafx.scene.image.Image; import javafx.stage.Stage; import java.util.ResourceBundle; + import static java.util.ResourceBundle.getBundle; /** @@ -52,10 +53,12 @@ public class App extends Application { FXMLLoader loader = new FXMLLoader( App.class.getResource("fxml/Dashboard.fxml"), GENERAL_BUNDLE); Parent root = loader.load(); + stage.getIcons().add(new Image(App.class.getResource("img/icon.png").toString())); - stage.setTitle("ESTRABA"); + stage.setTitle(GENERAL_BUNDLE.getString("app.title")); + stage.setResizable(false); stage.setScene(new Scene(root)); - stage.setResizable(true); + stage.show(); loader.getController().postinit(); } diff --git a/src/main/java/es/kauron/estraba/controller/DashboardController.java b/src/main/java/es/kauron/estraba/controller/DashboardController.java index c2cfef2..be98703 100644 --- a/src/main/java/es/kauron/estraba/controller/DashboardController.java +++ b/src/main/java/es/kauron/estraba/controller/DashboardController.java @@ -178,6 +178,8 @@ public class DashboardController implements Initializable { imgDate.setImage(new Image(App.class.getResourceAsStream("img/date.png"))); imgDistance.setImage(new Image(App.class.getResourceAsStream("img/distance.png"))); imgElevation.setImage(new Image(App.class.getResourceAsStream("img/elevation.png"))); + + snackbar = new JFXSnackbar(); } @FXML @@ -199,7 +201,6 @@ public class DashboardController implements Initializable { } public void postinit() { - snackbar = new JFXSnackbar(); snackbar.registerSnackbarContainer(root); try {load();} catch (JAXBException e) {e.printStackTrace();} } @@ -225,10 +226,10 @@ public class DashboardController implements Initializable { valueDate.setText(track.getStartTime().format(DateTimeFormatter.ofLocalizedDate(FormatStyle.FULL))); valueTime.setText(track.getStartTime().format(DateTimeFormatter.ofLocalizedTime(FormatStyle.MEDIUM))); valueActiveTime.setText(LocalTime.MIDNIGHT.plus(track.getMovingTime()) - .format(DateTimeFormatter.ofLocalizedTime(FormatStyle.MEDIUM))); + .format(DateTimeFormatter.ofPattern("HH:mm:ss"))); valueTotalTime.setText(App.GENERAL_BUNDLE.getString("time.of") + LocalTime.MIDNIGHT.plus(track.getTotalDuration()) - .format(DateTimeFormatter.ofLocalizedTime(FormatStyle.MEDIUM))); + .format(DateTimeFormatter.ofPattern("HH:mm:ss"))); if (track.getTotalDistance() > KILOMETER_CUTOFF) { valueDistance.setText(String.format("%.2f", track.getTotalDistance() / 1000) @@ -256,7 +257,7 @@ public class DashboardController implements Initializable { // traverse the chunks ObservableList chunks = track.getChunks(); double currentDistance = 0.0; - double currentHeight = 0.0; + double currentHeight = chunks.get(0).getFirstPoint().getElevation(); for (Chunk chunk : chunks) { currentDistance += chunk.getDistance(); if (chunk.getDistance() < DISTANCE_EPSILON) continue; diff --git a/src/main/java/es/kauron/estraba/controller/SplashController.java b/src/main/java/es/kauron/estraba/controller/SplashController.java new file mode 100644 index 0000000..8e875f4 --- /dev/null +++ b/src/main/java/es/kauron/estraba/controller/SplashController.java @@ -0,0 +1,47 @@ +package es.kauron.estraba.controller; + +import com.jfoenix.controls.JFXButton; +import com.jfoenix.controls.JFXSpinner; +import es.kauron.estraba.App; +import javafx.event.ActionEvent; +import javafx.fxml.FXML; +import javafx.fxml.Initializable; +import javafx.scene.control.Label; +import javafx.scene.image.Image; +import javafx.scene.image.ImageView; + +import java.net.URL; +import java.util.ResourceBundle; + +/** + * es.kauron.estraba.controller (estraba) + * Created by baudlord on 5/19/16. + */ + +public class SplashController implements Initializable{ + + @FXML + private ImageView imgLogo; + + @FXML + private JFXSpinner spinner; + + @FXML + private Label labelWelcome; + + @FXML + private JFXButton buttonLoad; + + @FXML + void loadGPXFile(ActionEvent event) { + buttonLoad.setVisible(false); + labelWelcome.setVisible(false); + spinner.setVisible(true); + } + + @Override + public void initialize(URL location, ResourceBundle resources) { + imgLogo.setImage(new Image(App.class.getResourceAsStream("img/splash.png"))); + } +} + diff --git a/src/main/resources/es/kauron/estraba/css/palette.css b/src/main/resources/es/kauron/estraba/css/palette.css new file mode 100644 index 0000000..0747de4 --- /dev/null +++ b/src/main/resources/es/kauron/estraba/css/palette.css @@ -0,0 +1,11 @@ +/* Palette generated by Material Palette - materialpalette.com/deep-orange/indigo */ + +.background { -fx-background-color: #FFFFFF; } +.dark-primary-color { -fx-background-color: #E64A19; } +.default-primary-color { -fx-background-color: #FF5722; } +.light-primary-color { -fx-background-color: #FFCCBC; } +.text-primary-color { -fx-text-fill: #FFFFFF; } +.accent-color { -fx-background-color: #536DFE; } +.primary-text-color { -fx-text-fill: #212121; } +.secondary-text-color { -fx-text-fill: #727272; } +.divider-color { -fx-background-color: #B6B6B6; } diff --git a/src/main/resources/es/kauron/estraba/fxml/Splash.fxml b/src/main/resources/es/kauron/estraba/fxml/Splash.fxml new file mode 100644 index 0000000..6d6cd6b --- /dev/null +++ b/src/main/resources/es/kauron/estraba/fxml/Splash.fxml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + diff --git a/src/main/resources/es/kauron/estraba/ttf/DAGGERSQUARE OBLIQUE.otf b/src/main/resources/es/kauron/estraba/ttf/DAGGERSQUARE OBLIQUE.otf new file mode 100644 index 0000000..3242a67 Binary files /dev/null and b/src/main/resources/es/kauron/estraba/ttf/DAGGERSQUARE OBLIQUE.otf differ diff --git a/src/main/resources/es/kauron/estraba/ttf/DAGGERSQUARE.otf b/src/main/resources/es/kauron/estraba/ttf/DAGGERSQUARE.otf new file mode 100644 index 0000000..a0326fa Binary files /dev/null and b/src/main/resources/es/kauron/estraba/ttf/DAGGERSQUARE.otf differ diff --git a/src/main/resources/general.properties b/src/main/resources/general.properties index ef2ae8f..968701a 100644 --- a/src/main/resources/general.properties +++ b/src/main/resources/general.properties @@ -1,3 +1,4 @@ +app.title=ESTRABA label.cadence=Cadence label.distance=Distance label.elevation=Elevation @@ -8,10 +9,10 @@ tab.dashboard=Dashboard tab.graph=Stats tab.map=Your Route tab.settings=Settings -time.of=of +time.of=of\ unit.bpm=\ bpm unit.hz=\ Hz -unit.km=km +unit.km=\ km unit.kmph=\ kmph unit.m=\ m zone.anaerobic=Anaerobic diff --git a/src/main/resources/general_ca.properties b/src/main/resources/general_ca.properties index e78fb1d..7a0ec79 100644 --- a/src/main/resources/general_ca.properties +++ b/src/main/resources/general_ca.properties @@ -1,3 +1,4 @@ +app.title=ESTRABA label.cadence=Cadencia label.distance=Distancia label.elevation=Elevacion @@ -8,10 +9,10 @@ tab.dashboard=Sumari tab.graph=Estad\u00edstiques tab.map=La teva ruta tab.settings=Ajustos -time.of=de +time.of=de\ unit.bpm=\ ppm unit.hz=\ Hz -unit.km=km +unit.km=\ km unit.kmph=\ km/h unit.m=\ m zone.anaerobic=Anaer\u00f2bic diff --git a/src/main/resources/general_es.properties b/src/main/resources/general_es.properties index db7a4fa..bbff4ca 100644 --- a/src/main/resources/general_es.properties +++ b/src/main/resources/general_es.properties @@ -1,3 +1,4 @@ +app.title=ESTRABA label.cadence=Cadencia label.distance=Distancia label.elevation=Elevacion @@ -11,7 +12,7 @@ tab.settings=Ajustes time.of=de unit.bpm=\ ppm unit.hz=\ Hz -unit.km=km +unit.km=\ km unit.kmph=\ km/h unit.m=\ m zone.anaerobic=Anaer\u00f3bico