fixed controller name
This commit is contained in:
parent
6f79ff9e3b
commit
dbbe15ec9e
3 changed files with 41 additions and 15 deletions
|
@ -32,7 +32,6 @@ import javafx.scene.image.Image;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
|
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
import static java.util.ResourceBundle.getBundle;
|
import static java.util.ResourceBundle.getBundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -5,6 +5,7 @@ import com.jfoenix.controls.JFXListView;
|
||||||
import com.jfoenix.controls.JFXTabPane;
|
import com.jfoenix.controls.JFXTabPane;
|
||||||
import com.lynden.gmapsfx.GoogleMapView;
|
import com.lynden.gmapsfx.GoogleMapView;
|
||||||
import es.kauron.estraba.App;
|
import es.kauron.estraba.App;
|
||||||
|
import javafx.event.ActionEvent;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
import javafx.fxml.Initializable;
|
import javafx.fxml.Initializable;
|
||||||
import javafx.scene.chart.AreaChart;
|
import javafx.scene.chart.AreaChart;
|
||||||
|
@ -70,11 +71,15 @@ public class DashboardController implements Initializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL location, ResourceBundle resources) {
|
public void initialize(URL location, ResourceBundle resources) {
|
||||||
elevationButton.setGraphic(new ImageView(new Image(App.class.getResourceAsStream("img/elevation.png"))));
|
((ImageView)elevationButton.getGraphic()).setImage(new Image(App.class.getResourceAsStream("img/elevation.png")));
|
||||||
speedButton.setGraphic(new ImageView(new Image(App.class.getResourceAsStream("img/speed.png"))));
|
((ImageView)speedButton.getGraphic()).setImage(new Image(App.class.getResourceAsStream("img/speed.png")));
|
||||||
hrButton.setGraphic(new ImageView(new Image(App.class.getResourceAsStream("img/hr.png"))));
|
((ImageView)hrButton.getGraphic()).setImage(new Image(App.class.getResourceAsStream("img/hr.png")));
|
||||||
cadenceButton.setGraphic(new ImageView(new Image(App.class.getResourceAsStream("img/cadence.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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,13 @@
|
||||||
<?import javafx.scene.chart.NumberAxis?>
|
<?import javafx.scene.chart.NumberAxis?>
|
||||||
<?import javafx.scene.control.Label?>
|
<?import javafx.scene.control.Label?>
|
||||||
<?import javafx.scene.control.Tab?>
|
<?import javafx.scene.control.Tab?>
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
<?import javafx.scene.layout.AnchorPane?>
|
<?import javafx.scene.layout.AnchorPane?>
|
||||||
<?import javafx.scene.layout.HBox?>
|
<?import javafx.scene.layout.HBox?>
|
||||||
<?import javafx.scene.layout.VBox?>
|
<?import javafx.scene.layout.VBox?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
<JFXTabPane fx:id="root" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1">
|
<JFXTabPane fx:id="root" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="es.kauron.estraba.controller.DashboardController">
|
||||||
<tabs>
|
<tabs>
|
||||||
<Tab fx:id="tabDashboard" text="%tab.dashboard">
|
<Tab fx:id="tabDashboard" text="%tab.dashboard">
|
||||||
<content>
|
<content>
|
||||||
|
@ -42,12 +43,36 @@
|
||||||
</HBox>
|
</HBox>
|
||||||
<HBox minHeight="128.0" prefHeight="0.0">
|
<HBox minHeight="128.0" prefHeight="0.0">
|
||||||
<children>
|
<children>
|
||||||
<VBox prefHeight="200.0" prefWidth="100.0" HBox.hgrow="ALWAYS">
|
<VBox prefHeight="128.0" prefWidth="100.0" HBox.hgrow="ALWAYS">
|
||||||
<children>
|
<children>
|
||||||
<JFXButton fx:id="elevationButton" minHeight="32.0" minWidth="32.0" />
|
<JFXButton fx:id="elevationButton" minHeight="32.0" minWidth="32.0" onAction="#onMapButton">
|
||||||
<JFXButton fx:id="speedButton" layoutX="10.0" layoutY="10.0" minHeight="32.0" minWidth="32.0" />
|
<graphic>
|
||||||
<JFXButton fx:id="hrButton" layoutX="10.0" layoutY="10.0" minHeight="32.0" minWidth="32.0" />
|
<ImageView fitHeight="32.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true" />
|
||||||
<JFXButton fx:id="cadenceButton" layoutX="10.0" layoutY="42.0" minHeight="32.0" minWidth="32.0" />
|
</graphic>
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets />
|
||||||
|
</VBox.margin></JFXButton>
|
||||||
|
<JFXButton fx:id="speedButton" layoutX="10.0" layoutY="10.0" minHeight="32.0" minWidth="32.0" onAction="#onMapButton">
|
||||||
|
<graphic>
|
||||||
|
<ImageView fitHeight="32.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true" />
|
||||||
|
</graphic>
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets />
|
||||||
|
</VBox.margin></JFXButton>
|
||||||
|
<JFXButton fx:id="hrButton" layoutX="10.0" layoutY="10.0" minHeight="32.0" minWidth="32.0" onAction="#onMapButton">
|
||||||
|
<graphic>
|
||||||
|
<ImageView fitHeight="32.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true" />
|
||||||
|
</graphic>
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets />
|
||||||
|
</VBox.margin></JFXButton>
|
||||||
|
<JFXButton fx:id="cadenceButton" layoutX="10.0" layoutY="42.0" minHeight="32.0" minWidth="32.0" onAction="#onMapButton">
|
||||||
|
<graphic>
|
||||||
|
<ImageView fitHeight="32.0" fitWidth="32.0" pickOnBounds="true" preserveRatio="true" />
|
||||||
|
</graphic>
|
||||||
|
<VBox.margin>
|
||||||
|
<Insets />
|
||||||
|
</VBox.margin></JFXButton>
|
||||||
</children>
|
</children>
|
||||||
</VBox>
|
</VBox>
|
||||||
<LineChart minHeight="100.0" prefWidth="9999.0">
|
<LineChart minHeight="100.0" prefWidth="9999.0">
|
||||||
|
@ -64,7 +89,7 @@
|
||||||
</VBox>
|
</VBox>
|
||||||
</content>
|
</content>
|
||||||
</Tab>
|
</Tab>
|
||||||
<Tab fx:id="tabGraph" text="\%tab.graph">
|
<Tab fx:id="tabGraph" text="%tab.graph">
|
||||||
<content>
|
<content>
|
||||||
<VBox>
|
<VBox>
|
||||||
<children>
|
<children>
|
||||||
|
@ -101,9 +126,6 @@
|
||||||
</yAxis>
|
</yAxis>
|
||||||
</LineChart>
|
</LineChart>
|
||||||
</children>
|
</children>
|
||||||
<padding>
|
|
||||||
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
|
|
||||||
</padding>
|
|
||||||
</VBox>
|
</VBox>
|
||||||
</content>
|
</content>
|
||||||
</Tab>
|
</Tab>
|
||||||
|
|
Reference in a new issue