kauron/estraba
Archived
1
0
Fork 0

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:
Jesús Vélez Palacios 2016-05-25 18:00:49 +02:00
commit 54b861ab87
2 changed files with 34 additions and 17 deletions

View file

@ -27,6 +27,7 @@ package es.kauron.estraba.controller;
import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXButton;
import com.jfoenix.controls.JFXSpinner; import com.jfoenix.controls.JFXSpinner;
import com.jfoenix.controls.JFXToggleButton;
import com.lynden.gmapsfx.GoogleMapView; import com.lynden.gmapsfx.GoogleMapView;
import com.lynden.gmapsfx.MapComponentInitializedListener; import com.lynden.gmapsfx.MapComponentInitializedListener;
import com.lynden.gmapsfx.javascript.object.*; import com.lynden.gmapsfx.javascript.object.*;
@ -45,8 +46,6 @@ import javafx.scene.Scene;
import javafx.scene.chart.AreaChart; import javafx.scene.chart.AreaChart;
import javafx.scene.chart.LineChart; import javafx.scene.chart.LineChart;
import javafx.scene.chart.PieChart; import javafx.scene.chart.PieChart;
import javafx.scene.chart.XYChart;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.Tab; import javafx.scene.control.Tab;
import javafx.scene.image.Image; import javafx.scene.image.Image;
@ -103,7 +102,7 @@ public class DashboardController implements Initializable, MapComponentInitializ
private LineChart<Long, Double> speedTChart, hrTChart, cadenceTChart; private LineChart<Long, Double> speedTChart, hrTChart, cadenceTChart;
@FXML @FXML
private ChoiceBox<String> choiceBox; private JFXToggleButton toggleCharts;
@FXML @FXML
private StackPane charts; private StackPane charts;
@ -127,10 +126,7 @@ public class DashboardController implements Initializable, MapComponentInitializ
imgDistance.setImage(new Image(App.class.getResourceAsStream("img/distance.png"))); imgDistance.setImage(new Image(App.class.getResourceAsStream("img/distance.png")));
imgElevation.setImage(new Image(App.class.getResourceAsStream("img/elevation.png"))); imgElevation.setImage(new Image(App.class.getResourceAsStream("img/elevation.png")));
choiceBox.getItems().add(App.GENERAL_BUNDLE.getString("label.distance")); toggleCharts.selectedProperty().addListener((observableValue, s, t1) -> {
choiceBox.getItems().add(App.GENERAL_BUNDLE.getString("label.time"));
choiceBox.setValue(choiceBox.getItems().get(0));
choiceBox.valueProperty().addListener((observableValue, s, t1) -> {
for (Node n : charts.getChildrenUnmodifiable()) for (Node n : charts.getChildrenUnmodifiable())
n.setVisible(!n.isVisible()); n.setVisible(!n.isVisible());
}); });

View file

@ -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 com.lynden.gmapsfx.GoogleMapView?>
<?import javafx.geometry.*?> <?import java.lang.String?>
<?import javafx.scene.chart.*?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.*?> <?import javafx.scene.chart.AreaChart?>
<?import javafx.scene.image.*?> <?import javafx.scene.chart.LineChart?>
<?import javafx.scene.layout.*?> <?import javafx.scene.chart.NumberAxis?>
<?import java.lang.*?> <?import javafx.scene.chart.PieChart?>
<AnchorPane xmlns:fx="http://javafx.com/fxml/1" fx:id="root" xmlns="http://javafx.com/javafx/8.0.76-ea" <?import javafx.scene.control.Label?>
fx:controller="es.kauron.estraba.controller.DashboardController"> <?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"> <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"> <Tab fx:id="tabDashboard" text="%tab.dashboard">
<VBox prefHeight="200.0" prefWidth="100.0"> <VBox prefHeight="200.0" prefWidth="100.0">
@ -354,7 +365,17 @@
<padding> <padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding> </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"> <StackPane fx:id="charts">
<children> <children>
<VBox> <VBox>