kauron/estraba
Archived
1
0
Fork 0

initial Dashboard distance -> time commit

This commit is contained in:
Jesús Vélez Palacios 2016-05-25 11:20:25 +02:00
parent cd465af904
commit 47030ad497
7 changed files with 97 additions and 82 deletions

View file

@ -31,6 +31,7 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import java.io.File;
@ -43,6 +44,7 @@ import static java.util.ResourceBundle.getBundle;
*/
public class App extends Application {
public final static ResourceBundle GENERAL_BUNDLE = getBundle("general");
public final static Font DAGGERSQUARE = Font.loadFont(App.class.getResourceAsStream("fonts/DAGGERSQUARE.otf"), 0);
/**
* @param args the command line arguments
*/
@ -60,6 +62,7 @@ public class App extends Application {
stage.setTitle(GENERAL_BUNDLE.getString("app.title"));
stage.setResizable(false);
stage.setScene(new Scene(root));
stage.getScene().getStylesheets().add(App.class.getResource("css/estraba.css").toExternalForm());
if (getParameters().getUnnamed().size() == 1) {

View file

@ -116,8 +116,6 @@ public class DashboardController implements Initializable, MapComponentInitializ
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")));
}
@FXML

View file

@ -30,6 +30,7 @@ import com.jfoenix.controls.JFXSnackbar;
import com.jfoenix.controls.JFXSpinner;
import es.kauron.estraba.App;
import es.kauron.estraba.model.DataBundle;
import javafx.application.Platform;
import javafx.concurrent.Task;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
@ -148,6 +149,7 @@ public class SplashController implements Initializable{
@Override
public void initialize(URL location, ResourceBundle resources) {
imgLogo.setImage(new Image(App.class.getResourceAsStream("img/header.png")));
labelWelcome.setFont(App.DAGGERSQUARE);
snackbar = new JFXSnackbar();
imgLogo.setOnMouseClicked(e -> {

View file

@ -23,3 +23,18 @@
*
*/
.text {
-fx-font-smoothing-type: lcd;
}
value-minhr {
-fx-text-fill: #2aa;
}
value-maxhr {
-fx-text-fill: #a22;
}
value-avghr {
-fx-text-fill: #2a2
}

View file

@ -25,26 +25,17 @@
~
-->
<?import com.jfoenix.controls.JFXButton?>
<?import com.jfoenix.controls.JFXSpinner?>
<?import com.jfoenix.controls.JFXTabPane?>
<?import com.jfoenix.controls.*?>
<?import com.lynden.gmapsfx.GoogleMapView?>
<?import java.lang.String?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.chart.AreaChart?>
<?import javafx.scene.chart.LineChart?>
<?import javafx.scene.chart.NumberAxis?>
<?import javafx.scene.chart.PieChart?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?>
<AnchorPane fx:id="root" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="es.kauron.estraba.controller.DashboardController">
<?import javafx.geometry.*?>
<?import javafx.scene.chart.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.image.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import java.lang.*?>
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" fx:id="root" xmlns="http://javafx.com/javafx/8.0.76-ea"
fx:controller="es.kauron.estraba.controller.DashboardController">
<JFXTabPane minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="1000.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<Tab fx:id="tabDashboard" styleClass=".estraba.dashboard" text="%tab.dashboard">
<VBox prefHeight="200.0" prefWidth="100.0">
@ -59,8 +50,8 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</VBox.margin>
<styleClass>
<String fx:value=".estraba.dashboard.motivation" />
<String fx:value=".estraba.dashboard.motivation.upper" />
<String fx:value="motivation"/>
<String fx:value="motivation.upper"/>
</styleClass>
</Label>
<HBox prefHeight="360.0" prefWidth="800.0" VBox.vgrow="ALWAYS">
@ -72,7 +63,8 @@
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</HBox.margin>
<HBox alignment="CENTER" minHeight="-Infinity" minWidth="-Infinity" prefHeight="90.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
<ImageView fx:id="imgHR" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true" styleClass=".estraba.dashboard.icon">
<ImageView fx:id="imgHR" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true"
preserveRatio="true" styleClass="icon">
</ImageView>
<VBox alignment="CENTER" HBox.hgrow="ALWAYS">
<Label alignment="CENTER_RIGHT" maxWidth="1.7976931348623157E308" text="%label.hr">
@ -83,8 +75,8 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.label" />
<String fx:value=".estraba.dashboard.label.hr" />
<String fx:value="label"/>
<String fx:value="label-hr"/>
</styleClass>
</Label>
<Label fx:id="valueHRAvg" alignment="CENTER" maxWidth="1.7976931348623157E308" textAlignment="CENTER">
@ -92,9 +84,9 @@
<Font size="30.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.main" />
<String fx:value=".estraba.dashboard.value.avghr" />
<String fx:value="value"/>
<String fx:value="value-main"/>
<String fx:value="value-avghr"/>
</styleClass>
</Label>
<HBox>
@ -106,9 +98,9 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.sub" />
<String fx:value=".estraba.dashboard.value.minhr" />
<String fx:value="value"/>
<String fx:value="value-sub"/>
<String fx:value="value-minhr"/>
</styleClass>
</Label>
<Label fx:id="valueHRMax" layoutX="10.0" layoutY="10.0" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS">
@ -119,16 +111,17 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.sub" />
<String fx:value=".estraba.dashboard.value.maxhr" />
<String fx:value="value"/>
<String fx:value="value-sub"/>
<String fx:value="value-maxhr"/>
</styleClass>
</Label>
</HBox>
</VBox>
</HBox>
<HBox alignment="CENTER" minHeight="-Infinity" minWidth="-Infinity" prefHeight="90.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
<ImageView fx:id="imgSpeed" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true" styleClass=".estraba.dashboard.icon">
<ImageView fx:id="imgSpeed" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true"
preserveRatio="true" styleClass="icon">
</ImageView>
<VBox alignment="CENTER" HBox.hgrow="ALWAYS">
<Label alignment="CENTER_RIGHT" maxWidth="1.7976931348623157E308" text="%label.speed">
@ -139,8 +132,8 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.label" />
<String fx:value=".estraba.dashboard.label.speed" />
<String fx:value="label"/>
<String fx:value="label-speed"/>
</styleClass>
</Label>
<Label fx:id="valueSpeedAvg" alignment="CENTER" maxWidth="1.7976931348623157E308" textAlignment="CENTER">
@ -148,9 +141,9 @@
<Font size="30.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.main" />
<String fx:value=".estraba.dashboard.value.avgspeed" />
<String fx:value="value"/>
<String fx:value="value-main"/>
<String fx:value="value-avgspeed"/>
</styleClass>
</Label>
<Label fx:id="valueSpeedMax" alignment="CENTER" maxWidth="1.7976931348623157E308">
@ -161,15 +154,16 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.sub" />
<String fx:value=".estraba.dashboard.value.maxspeed" />
<String fx:value="value"/>
<String fx:value="value-sub"/>
<String fx:value="value-maxspeed"/>
</styleClass>
</Label>
</VBox>
</HBox>
<HBox alignment="CENTER" minHeight="-Infinity" minWidth="-Infinity" prefHeight="90.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
<ImageView fx:id="imgCadence" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true" styleClass=".estraba.dashboard.icon">
<ImageView fx:id="imgCadence" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true"
preserveRatio="true" styleClass="icon">
</ImageView>
<VBox alignment="CENTER" HBox.hgrow="ALWAYS">
<Label alignment="CENTER_RIGHT" maxWidth="1.7976931348623157E308" text="%label.cadence">
@ -180,8 +174,8 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.label" />
<String fx:value=".estraba.dashboard.label.cadence" />
<String fx:value="label"/>
<String fx:value="label-cadence"/>
</styleClass>
</Label>
<Label fx:id="valueCadenceAvg" alignment="CENTER" maxWidth="1.7976931348623157E308" textAlignment="CENTER">
@ -189,9 +183,9 @@
<Font size="30.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.main" />
<String fx:value=".estraba.dashboard.value.avgcadence" />
<String fx:value="value"/>
<String fx:value="value-main"/>
<String fx:value="value-avgcadence"/>
</styleClass>
</Label>
<Label fx:id="valueCadenceMax" alignment="CENTER" maxWidth="1.7976931348623157E308">
@ -202,9 +196,9 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.sub" />
<String fx:value=".estraba.dashboard.value.maxcadence" />
<String fx:value="value"/>
<String fx:value="value-sub"/>
<String fx:value="value-maxcadence"/>
</styleClass>
</Label>
</VBox>
@ -223,8 +217,8 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.sub" />
<String fx:value="value"/>
<String fx:value="value-sub"/>
</styleClass>
<VBox.margin>
<Insets />
@ -238,8 +232,8 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.sub" />
<String fx:value="value"/>
<String fx:value="value-sub"/>
</styleClass>
</Label>
<Label fx:id="valueActiveTime" alignment="CENTER" maxWidth="1.7976931348623157E308" textAlignment="CENTER">
@ -247,9 +241,9 @@
<Font size="30.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.main" />
<String fx:value=".estraba.dashboard.value.activetime" />
<String fx:value="value"/>
<String fx:value="value-main"/>
<String fx:value="value-activetime"/>
</styleClass>
</Label>
<Label fx:id="valueTotalTime" alignment="CENTER" maxWidth="1.7976931348623157E308">
@ -260,13 +254,14 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.sub" />
<String fx:value=".estraba.dashboard.value.totaltime" />
<String fx:value="value"/>
<String fx:value="value-sub"/>
<String fx:value="value-totaltime"/>
</styleClass>
</Label>
</VBox>
<ImageView fx:id="imgDate" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true" styleClass=".estraba.dashboard.icon">
<ImageView fx:id="imgDate" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true"
preserveRatio="true" styleClass="icon">
</ImageView>
</HBox>
<HBox alignment="CENTER" minHeight="-Infinity" minWidth="-Infinity" prefHeight="90.0" prefWidth="200.0" HBox.hgrow="ALWAYS" VBox.vgrow="ALWAYS">
@ -279,8 +274,8 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.label" />
<String fx:value=".estraba.dashboard.label.distance" />
<String fx:value="label"/>
<String fx:value="label-distance"/>
</styleClass>
</Label>
<Label fx:id="valueDistance" alignment="CENTER" maxWidth="1.7976931348623157E308" textAlignment="CENTER">
@ -288,13 +283,14 @@
<Font size="30.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.main" />
<String fx:value=".estraba.dashboard.value.distance" />
<String fx:value="value"/>
<String fx:value="value-main"/>
<String fx:value="value-distance"/>
</styleClass>
</Label>
</VBox>
<ImageView fx:id="imgDistance" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true" styleClass=".estraba.dashboard.icon">
<ImageView fx:id="imgDistance" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true"
preserveRatio="true" styleClass="icon">
</ImageView>
</HBox>
<HBox alignment="CENTER" minHeight="-Infinity" minWidth="-Infinity" prefHeight="90.0" prefWidth="200.0" HBox.hgrow="ALWAYS" VBox.vgrow="ALWAYS">
@ -307,8 +303,8 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.label" />
<String fx:value=".estraba.dashboard.label.elevation" />
<String fx:value="label"/>
<String fx:value="label-elevation"/>
</styleClass>
</Label>
<Label fx:id="valueElevation" alignment="CENTER" maxWidth="1.7976931348623157E308" textAlignment="CENTER">
@ -316,9 +312,9 @@
<Font size="30.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.main" />
<String fx:value=".estraba.dashboard.value.elevation" />
<String fx:value="value"/>
<String fx:value="value-main"/>
<String fx:value="value-elevation"/>
</styleClass>
</Label>
<HBox>
@ -330,9 +326,9 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.sub" />
<String fx:value=".estraba.dashboard.value.ascent" />
<String fx:value="value"/>
<String fx:value="value-sub"/>
<String fx:value="value-ascent"/>
</styleClass>
</Label>
<Label fx:id="valueDescent" layoutX="10.0" layoutY="10.0" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS">
@ -343,14 +339,15 @@
<Font name="Roboto" size="13.0" />
</font>
<styleClass>
<String fx:value=".estraba.dashboard.value" />
<String fx:value=".estraba.dashboard.value.sub" />
<String fx:value=".estraba.dashboard.value.descent" />
<String fx:value="value"/>
<String fx:value="value-sub"/>
<String fx:value="value-descent"/>
</styleClass>
</Label>
</HBox>
</VBox>
<ImageView fx:id="imgElevation" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true" preserveRatio="true" styleClass=".estraba.dashboard.icon">
<ImageView fx:id="imgElevation" fitHeight="100.0" fitWidth="100.0" pickOnBounds="true"
preserveRatio="true" styleClass="icon">
</ImageView>
</HBox>
</VBox>