kauron/estraba
kauron
/
estraba
Archived
1
0
Fork 0

fixed controller name

This commit is contained in:
Jesús Vélez Palacios 2016-05-17 20:33:48 +02:00
parent 6f79ff9e3b
commit dbbe15ec9e
3 changed files with 41 additions and 15 deletions

View File

@ -32,7 +32,6 @@ import javafx.scene.image.Image;
import javafx.stage.Stage;
import java.util.ResourceBundle;
import static java.util.ResourceBundle.getBundle;
/**

View File

@ -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());
}
}

View File

@ -11,12 +11,13 @@
<?import javafx.scene.chart.NumberAxis?>
<?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.VBox?>
<?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>
<Tab fx:id="tabDashboard" text="%tab.dashboard">
<content>
@ -42,12 +43,36 @@
</HBox>
<HBox minHeight="128.0" prefHeight="0.0">
<children>
<VBox prefHeight="200.0" prefWidth="100.0" HBox.hgrow="ALWAYS">
<VBox prefHeight="128.0" prefWidth="100.0" HBox.hgrow="ALWAYS">
<children>
<JFXButton fx:id="elevationButton" minHeight="32.0" minWidth="32.0" />
<JFXButton fx:id="speedButton" layoutX="10.0" layoutY="10.0" minHeight="32.0" minWidth="32.0" />
<JFXButton fx:id="hrButton" layoutX="10.0" layoutY="10.0" minHeight="32.0" minWidth="32.0" />
<JFXButton fx:id="cadenceButton" layoutX="10.0" layoutY="42.0" minHeight="32.0" minWidth="32.0" />
<JFXButton fx:id="elevationButton" 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="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>
</VBox>
<LineChart minHeight="100.0" prefWidth="9999.0">
@ -64,7 +89,7 @@
</VBox>
</content>
</Tab>
<Tab fx:id="tabGraph" text="\%tab.graph">
<Tab fx:id="tabGraph" text="%tab.graph">
<content>
<VBox>
<children>
@ -101,9 +126,6 @@
</yAxis>
</LineChart>
</children>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</VBox>
</content>
</Tab>