Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/java/es/kauron/estraba/controller/DashboardController.java # src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml
This commit is contained in:
commit
54b861ab87
2 changed files with 34 additions and 17 deletions
|
@ -27,6 +27,7 @@ package es.kauron.estraba.controller;
|
|||
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.controls.JFXSpinner;
|
||||
import com.jfoenix.controls.JFXToggleButton;
|
||||
import com.lynden.gmapsfx.GoogleMapView;
|
||||
import com.lynden.gmapsfx.MapComponentInitializedListener;
|
||||
import com.lynden.gmapsfx.javascript.object.*;
|
||||
|
@ -45,8 +46,6 @@ import javafx.scene.Scene;
|
|||
import javafx.scene.chart.AreaChart;
|
||||
import javafx.scene.chart.LineChart;
|
||||
import javafx.scene.chart.PieChart;
|
||||
import javafx.scene.chart.XYChart;
|
||||
import javafx.scene.control.ChoiceBox;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Tab;
|
||||
import javafx.scene.image.Image;
|
||||
|
@ -103,7 +102,7 @@ public class DashboardController implements Initializable, MapComponentInitializ
|
|||
private LineChart<Long, Double> speedTChart, hrTChart, cadenceTChart;
|
||||
|
||||
@FXML
|
||||
private ChoiceBox<String> choiceBox;
|
||||
private JFXToggleButton toggleCharts;
|
||||
|
||||
@FXML
|
||||
private StackPane charts;
|
||||
|
@ -127,10 +126,7 @@ public class DashboardController implements Initializable, MapComponentInitializ
|
|||
imgDistance.setImage(new Image(App.class.getResourceAsStream("img/distance.png")));
|
||||
imgElevation.setImage(new Image(App.class.getResourceAsStream("img/elevation.png")));
|
||||
|
||||
choiceBox.getItems().add(App.GENERAL_BUNDLE.getString("label.distance"));
|
||||
choiceBox.getItems().add(App.GENERAL_BUNDLE.getString("label.time"));
|
||||
choiceBox.setValue(choiceBox.getItems().get(0));
|
||||
choiceBox.valueProperty().addListener((observableValue, s, t1) -> {
|
||||
toggleCharts.selectedProperty().addListener((observableValue, s, t1) -> {
|
||||
for (Node n : charts.getChildrenUnmodifiable())
|
||||
n.setVisible(!n.isVisible());
|
||||
});
|
||||
|
|
|
@ -25,16 +25,27 @@
|
|||
~
|
||||
-->
|
||||
|
||||
<?import com.jfoenix.controls.*?>
|
||||
<?import com.jfoenix.controls.JFXButton?>
|
||||
<?import com.jfoenix.controls.JFXSpinner?>
|
||||
<?import com.jfoenix.controls.JFXTabPane?>
|
||||
<?import com.jfoenix.controls.JFXToggleButton?>
|
||||
<?import com.lynden.gmapsfx.GoogleMapView?>
|
||||
<?import javafx.geometry.*?>
|
||||
<?import javafx.scene.chart.*?>
|
||||
<?import javafx.scene.control.*?>
|
||||
<?import javafx.scene.image.*?>
|
||||
<?import javafx.scene.layout.*?>
|
||||
<?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">
|
||||
<?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">
|
||||
<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" text="%tab.dashboard">
|
||||
<VBox prefHeight="200.0" prefWidth="100.0">
|
||||
|
@ -354,7 +365,17 @@
|
|||
<padding>
|
||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
||||
</padding>
|
||||
<ChoiceBox fx:id="choiceBox" prefWidth="150.0" />
|
||||
<HBox alignment="CENTER" spacing="5.0">
|
||||
<children>
|
||||
<Label text="%label.distance" />
|
||||
<JFXToggleButton fx:id="toggleCharts" unToggleColor="#fc4c02" unToggleLineColor="#ffba9e">
|
||||
<padding>
|
||||
<Insets bottom="-5.0" left="-5.0" right="-5.0" top="-5.0" />
|
||||
</padding>
|
||||
</JFXToggleButton>
|
||||
<Label text="%label.time" />
|
||||
</children>
|
||||
</HBox>
|
||||
<StackPane fx:id="charts">
|
||||
<children>
|
||||
<VBox>
|
||||
|
|
Reference in a new issue