Revisions
-
RuZman created this gist
Mar 28, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ package de.ruzman.datafxdemo; import io.datafx.controller.flow.Flow; import io.datafx.controller.flow.FlowException; import javafx.application.Application; import javafx.stage.Stage; public class Main extends Application { @Override public void start(Stage stage) throws FlowException { new Flow(MainController.class).startInStage(stage); } public static void main(String[] args) { launch(args); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ package de.ruzman.datafxdemo; import io.datafx.controller.FXMLController; import io.datafx.controller.flow.Flow; import io.datafx.controller.flow.FlowException; import io.datafx.controller.flow.FlowHandler; import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.layout.Pane; import javax.annotation.PostConstruct; @FXMLController("fxml/main.fxml") public class MainController { @FXML private Pane programmInhalt; private FlowHandler innerFlow; @PostConstruct public void init() throws FlowException { innerFlow = new Flow(MenuProjektAnlegenController.class).createHandler(); programmInhalt.getChildren().add(innerFlow.start()); } @FXML private void anlegenProjekt(ActionEvent actionEvent) throws Exception { innerFlow.navigateTo(MenuProjektAnlegenController.class); } @FXML private void anlegenService(ActionEvent actionEvent) throws Exception { innerFlow.navigateTo(MenuServiceAnlegenController.class); } @FXML private void beendeProgramm(ActionEvent actionEvent) { Platform.exit(); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.text.*?> <?import javafx.geometry.*?> <?import java.lang.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.control.*?> <?import javafx.scene.*?> <Pane fx:id="projektAnlegen" xmlns:fx="http://javafx.com/fxml"> <Label layoutX="15.0" layoutY="70.0" text="Projektnummer" /> <Label id="beispiellabel" layoutX="525.0" layoutY="70.0" text="Beispiel : 7432" /> <TextField id="projektnummer" fx:id="projektnummer" layoutX="15.0" layoutY="90.0" prefHeight="25.0" prefWidth="670.0" /> <Button id="erstelleProjekt" fx:id="erstelleProjekt" layoutX="15.0" layoutY="430.0" mnemonicParsing="false" text="Projektordner anlegen" /> </Pane> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.text.*?> <?import javafx.geometry.*?> <?import java.lang.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.control.*?> <?import javafx.scene.*?> <Pane fx:id="serviceAnlegen" xmlns:fx="http://javafx.com/fxml"> <Label layoutX="15.0" layoutY="70.0" text="Servicenummer" /> <Label id="beispiellabel" layoutX="525.0" layoutY="70.0" text="Beispiel : 1550" /> <TextField id="servicejahr" fx:id="servicejahr" layoutX="15.0" layoutY="90.0" prefHeight="25.0" prefWidth="50.0" /> <TextField id="servicenummer" fx:id="servicenummer" layoutX="65.0" layoutY="90.0" prefHeight="25.0" prefWidth="620.0" /> <Button id="erstelleService" fx:id="erstelleService" layoutX="15.0" layoutY="430.0" onAction="#erstelleService" mnemonicParsing="false" text="Serviceordner anlegen" /> </Pane> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ package de.ruzman.datafxdemo; import io.datafx.controller.FXMLController; @FXMLController("fxml/Menu.Projekt.anlegen.fxml") public class MenuProjektAnlegenController { } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ package de.ruzman.datafxdemo; import io.datafx.controller.FXMLController; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javax.inject.Inject; @FXMLController("fxml/Menu.Service.anlegen.fxml") public class MenuServiceAnlegenController { @Inject private Model m; @FXML public void erstelleService(ActionEvent actionEvent) { System.out.println(m.getTestwert()); } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ package de.ruzman.datafxdemo; import io.datafx.controller.injection.scopes.ApplicationScoped; @ApplicationScoped public class Model { private int testwert = 22; private String version = "1.0.0"; public int getTestwert() { return testwert; } public String getVersion() { return version; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.text.*?> <?import javafx.geometry.*?> <?import java.lang.*?> <?import javafx.scene.layout.*?> <?import javafx.scene.control.*?> <?import javafx.scene.*?> <VBox prefHeight="500.0" prefWidth="700.0" xmlns:fx="http://javafx.com/fxml"> <MenuBar> <Menu text="Menü"> <Menu text="Projekt"> <MenuItem onAction="#anlegenProjekt" text="Projekt anlegen" /> </Menu> <Menu text="Service"> <MenuItem onAction="#anlegenService" text="Service anlegen" /> </Menu> <SeparatorMenuItem /> <MenuItem onAction="#beendeProgramm" text="Beenden" /> </Menu> </MenuBar> <Pane fx:id="programmInhalt" /> </VBox>