diff --git a/src/main/java/es/kauron/estraba/App.java b/src/main/java/es/kauron/estraba/App.java index 4b1c062..8a2461c 100644 --- a/src/main/java/es/kauron/estraba/App.java +++ b/src/main/java/es/kauron/estraba/App.java @@ -32,7 +32,6 @@ import javafx.scene.image.Image; import javafx.stage.Stage; import java.util.ResourceBundle; - import static java.util.ResourceBundle.getBundle; /** diff --git a/src/main/java/es/kauron/estraba/controller/DashboardController.java b/src/main/java/es/kauron/estraba/controller/DashboardController.java index 91c0473..3c08db8 100644 --- a/src/main/java/es/kauron/estraba/controller/DashboardController.java +++ b/src/main/java/es/kauron/estraba/controller/DashboardController.java @@ -5,6 +5,7 @@ import com.jfoenix.controls.JFXListView; import com.jfoenix.controls.JFXTabPane; import com.lynden.gmapsfx.GoogleMapView; import es.kauron.estraba.App; +import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.chart.AreaChart; @@ -70,11 +71,15 @@ public class DashboardController implements Initializable { @Override public void initialize(URL location, ResourceBundle resources) { - elevationButton.setGraphic(new ImageView(new Image(App.class.getResourceAsStream("img/elevation.png")))); - speedButton.setGraphic(new ImageView(new Image(App.class.getResourceAsStream("img/speed.png")))); - hrButton.setGraphic(new ImageView(new Image(App.class.getResourceAsStream("img/hr.png")))); - cadenceButton.setGraphic(new ImageView(new Image(App.class.getResourceAsStream("img/cadence.png")))); + ((ImageView)elevationButton.getGraphic()).setImage(new Image(App.class.getResourceAsStream("img/elevation.png"))); + ((ImageView)speedButton.getGraphic()).setImage(new Image(App.class.getResourceAsStream("img/speed.png"))); + ((ImageView)hrButton.getGraphic()).setImage(new Image(App.class.getResourceAsStream("img/hr.png"))); + ((ImageView)cadenceButton.getGraphic()).setImage(new Image(App.class.getResourceAsStream("img/cadence.png"))); + } + @FXML + private void onMapButton(ActionEvent event){ + System.out.println(((JFXButton)event.getSource()).getId()); } } diff --git a/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml b/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml index 81eb5b0..9698d01 100644 --- a/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml +++ b/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml @@ -11,12 +11,13 @@ + - + @@ -42,12 +43,36 @@ - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -64,7 +89,7 @@ - + @@ -101,9 +126,6 @@ - - -